# HG changeset patch # User kbarrett # Date 1539380126 14400 # Node ID 76c87b213fa0d8dc8d411b83de0fda28d4f4ba6f # Parent 367b2cd49ec5efad2f89346d3c0d1ddcc115d70c 8212023: Implicit narrowing in Solaris/sparc initializers Summary: Explicitly narrow or fix destination types. Reviewed-by: dholmes, tschatzl diff -r 367b2cd49ec5 -r 76c87b213fa0 src/hotspot/cpu/sparc/nativeInst_sparc.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, diff -r 367b2cd49ec5 -r 76c87b213fa0 src/hotspot/os/solaris/os_solaris.cpp --- 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[]={