8212023: Implicit narrowing in Solaris/sparc initializers
authorkbarrett
Fri, 12 Oct 2018 17:35:26 -0400
changeset 52112 76c87b213fa0
parent 52111 367b2cd49ec5
child 52113 f48838bdcc31
child 56962 a769ad2d40d6
8212023: Implicit narrowing in Solaris/sparc initializers Summary: Explicitly narrow or fix destination types. Reviewed-by: dholmes, tschatzl
src/hotspot/cpu/sparc/nativeInst_sparc.cpp
src/hotspot/os/solaris/os_solaris.cpp
--- a/src/hotspot/cpu/sparc/nativeInst_sparc.cpp	Fri Oct 12 14:16:24 2018 -0400
+++ b/src/hotspot/cpu/sparc/nativeInst_sparc.cpp	Fri Oct 12 17:35:26 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -205,9 +205,9 @@
   uint idx;
   int offsets[] = {
     0x0,
-    0xfffffff0,
-    0x7ffffff0,
-    0x80000000,
+    (int)0xfffffff0,
+    (int)0x7ffffff0,
+    (int)0x80000000,
     0x20,
     0x4000,
   };
@@ -361,9 +361,9 @@
   uint idx;
   int offsets[] = {
     0x0,
-    0x7fffffff,
-    0x80000000,
-    0xffffffff,
+    (int)0x7fffffff,
+    (int)0x80000000,
+    (int)0xffffffff,
     0x20,
     4096,
     4097,
@@ -534,9 +534,9 @@
   uint idx;
   int offsets[] = {
     0x0,
-    0x7fffffff,
-    0x80000000,
-    0xffffffff,
+    (int)0x7fffffff,
+    (int)0x80000000,
+    (int)0xffffffff,
     0x20,
     4096,
     4097,
@@ -630,9 +630,9 @@
   uint idx1;
   int offsets[] = {
     0x0,
-    0xffffffff,
-    0x7fffffff,
-    0x80000000,
+    (int)0xffffffff,
+    (int)0x7fffffff,
+    (int)0x80000000,
     4096,
     4097,
     0x20,
@@ -751,9 +751,9 @@
   uint idx;
   int offsets[] = {
     0x0,
-    0xffffffff,
-    0x7fffffff,
-    0x80000000,
+    (int)0xffffffff,
+    (int)0x7fffffff,
+    (int)0x80000000,
     4096,
     4097,
     0x20,
--- a/src/hotspot/os/solaris/os_solaris.cpp	Fri Oct 12 14:16:24 2018 -0400
+++ b/src/hotspot/os/solaris/os_solaris.cpp	Fri Oct 12 17:35:26 2018 -0400
@@ -1567,11 +1567,11 @@
   }
 
   typedef struct {
-    Elf32_Half  code;         // Actual value as defined in elf.h
-    Elf32_Half  compat_class; // Compatibility of archs at VM's sense
-    char        elf_class;    // 32 or 64 bit
-    char        endianess;    // MSB or LSB
-    char*       name;         // String representation
+    Elf32_Half    code;         // Actual value as defined in elf.h
+    Elf32_Half    compat_class; // Compatibility of archs at VM's sense
+    unsigned char elf_class;    // 32 or 64 bit
+    unsigned char endianess;    // MSB or LSB
+    char*         name;         // String representation
   } arch_t;
 
   static const arch_t arch_array[]={