From 922bc8ae845f06702a05eedf99dec9eecb615430 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 22 Sep 2017 16:32:41 -0700 Subject: [PATCH] Some windows build errors --- src/core/lib/support/log_windows.cc | 4 ++-- src/core/lib/support/string_windows.cc | 2 +- src/core/lib/support/subprocess_windows.cc | 2 +- src/core/lib/support/sync_windows.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/lib/support/log_windows.cc b/src/core/lib/support/log_windows.cc index b71dacd80a0..ee52abea730 100644 --- a/src/core/lib/support/log_windows.cc +++ b/src/core/lib/support/log_windows.cc @@ -47,7 +47,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, } else { /* Allocate a new buffer, with space for the NUL terminator. */ size_t strp_buflen = (size_t)ret + 1; - message = gpr_malloc(strp_buflen); + message = (char *)gpr_malloc(strp_buflen); /* Print to the buffer. */ va_start(args, format); @@ -66,7 +66,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, /* Simple starter implementation */ extern "C" void gpr_default_log(gpr_log_func_args *args) { - char *final_slash; + const char *final_slash; const char *display_file; char time_buffer[64]; time_t timer; diff --git a/src/core/lib/support/string_windows.cc b/src/core/lib/support/string_windows.cc index bae524d7cb1..d37863c0662 100644 --- a/src/core/lib/support/string_windows.cc +++ b/src/core/lib/support/string_windows.cc @@ -47,7 +47,7 @@ int gpr_asprintf(char **strp, const char *format, ...) { /* Allocate a new buffer, with space for the NUL terminator. */ strp_buflen = (size_t)ret + 1; - if ((*strp = gpr_malloc(strp_buflen)) == NULL) { + if ((*strp = (char *)gpr_malloc(strp_buflen)) == NULL) { /* This shouldn't happen, because gpr_malloc() calls abort(). */ return -1; } diff --git a/src/core/lib/support/subprocess_windows.cc b/src/core/lib/support/subprocess_windows.cc index 7412f8d3444..6769f1d3a4b 100644 --- a/src/core/lib/support/subprocess_windows.cc +++ b/src/core/lib/support/subprocess_windows.cc @@ -61,7 +61,7 @@ gpr_subprocess *gpr_subprocess_create(int argc, const char **argv) { } gpr_free(args_tchar); - r = gpr_malloc(sizeof(gpr_subprocess)); + r = (gpr_subprocess *)gpr_malloc(sizeof(gpr_subprocess)); memset(r, 0, sizeof(*r)); r->pi = pi; return r; diff --git a/src/core/lib/support/sync_windows.cc b/src/core/lib/support/sync_windows.cc index 008c5aecba6..62fdd40af70 100644 --- a/src/core/lib/support/sync_windows.cc +++ b/src/core/lib/support/sync_windows.cc @@ -104,7 +104,7 @@ struct run_once_func_arg { void (*init_function)(void); }; static BOOL CALLBACK run_once_func(gpr_once *once, void *v, void **pv) { - struct run_once_func_arg *arg = v; + struct run_once_func_arg *arg = (struct run_once_func_arg *)v; (*arg->init_function)(); return 1; }