8223810: HotSpot compile warnings from VS2017

Reviewed-by: dholmes, stuefe
This commit is contained in:
Andrew Luo 2019-05-14 20:29:40 -04:00 committed by David Holmes
parent 712c9911ef
commit 5bdacf11bd
3 changed files with 8 additions and 8 deletions

View File

@ -201,7 +201,7 @@ void os::init_system_properties_values() {
char *home_path;
char *dll_path;
char *pslash;
char *bin = "\\bin";
const char *bin = "\\bin";
char home_dir[MAX_PATH + 1];
char *alt_home_dir = ::getenv("_ALT_JAVA_HOME_DIR");
@ -2185,7 +2185,7 @@ extern "C" void events();
#define def_excpt(val) { #val, (val) }
static const struct { char* name; uint number; } exceptlabels[] = {
static const struct { const char* name; uint number; } exceptlabels[] = {
def_excpt(EXCEPTION_ACCESS_VIOLATION),
def_excpt(EXCEPTION_DATATYPE_MISALIGNMENT),
def_excpt(EXCEPTION_BREAKPOINT),
@ -5335,7 +5335,7 @@ int os::fork_and_exec(char* cmd, bool use_vfork_if_available) {
DWORD exit_code;
char * cmd_string;
char * cmd_prefix = "cmd /C ";
const char * cmd_prefix = "cmd /C ";
size_t len = strlen(cmd) + strlen(cmd_prefix) + 1;
cmd_string = NEW_C_HEAP_ARRAY_RETURN_NULL(char, len, mtInternal);
if (cmd_string == NULL) {
@ -5674,8 +5674,8 @@ void TestReserveMemorySpecial_test() {
*/
int os::get_signal_number(const char* name) {
static const struct {
char* name;
int number;
const char* name;
int number;
} siglabels [] =
// derived from version 6.0 VC98/include/signal.h
{"ABRT", SIGABRT, // abnormal termination triggered by abort cl

View File

@ -121,7 +121,7 @@ class AttachOperation: public CHeapObj<mtInternal> {
const char* name() const { return _name; }
// set the operation name
void set_name(char* name) {
void set_name(const char* name) {
assert(strlen(name) <= name_length_max, "exceeds maximum name length");
size_t len = MIN2(strlen(name), (size_t)name_length_max);
memcpy(_name, name, len);
@ -148,7 +148,7 @@ class AttachOperation: public CHeapObj<mtInternal> {
}
// create an operation of a given name
AttachOperation(char* name) {
AttachOperation(const char* name) {
set_name(name);
for (int i=0; i<arg_count_max; i++) {
set_arg(i, NULL);

View File

@ -231,7 +231,7 @@ static void runUnitTestsInner(int argc, char** argv) {
#endif // __APPLE__
#else // _WIN32
char* java_home_var = "_ALT_JAVA_HOME_DIR";
const char* java_home_var = "_ALT_JAVA_HOME_DIR";
size_t len = strlen(java_home) + strlen(java_home_var) + 2;
char * envString = new char[len];
sprintf_s(envString, len, "%s=%s", java_home_var, java_home);