diff --git a/driver-vpi/main.c b/driver-vpi/main.c index bfd1ec77b..1785fbf78 100644 --- a/driver-vpi/main.c +++ b/driver-vpi/main.c @@ -236,7 +236,9 @@ static int GetRegistryKey(char *key, char **value) } regKeyBuffer[regKeySize] = 0; /* makes sure there is a trailing NULL */ - lrv = RegQueryValueEx(hkKey,key,NULL,®KeyType,regKeyBuffer,®KeySize); + /* This needs an unsigned char *, but for MinGW the char is signed. */ + lrv = RegQueryValueEx(hkKey, key, NULL, ®KeyType, + (unsigned char *) regKeyBuffer, ®KeySize); if ((lrv != ERROR_SUCCESS) || (regKeyType != REG_SZ) || (!regKeySize)) { lrv = RegCloseKey(hkKey); free(regKeyBuffer); @@ -269,7 +271,9 @@ static void SetRegistryKey(char *key, char *value) &res) != ERROR_SUCCESS) return; - RegSetValueEx(hkKey,key,0,REG_SZ,value,strlen(value)+1); + /* This needs an unsigned char *, but for MinGW the char is signed. */ + RegSetValueEx(hkKey, key, 0, REG_SZ, (unsigned char *) value, + strlen(value)+1); RegCloseKey(hkKey); printf("info: storing %s in Windows' registry entry\n",value); diff --git a/tgt-vvp/draw_vpi.c b/tgt-vvp/draw_vpi.c index 1266b43b8..94d8e851f 100644 --- a/tgt-vvp/draw_vpi.c +++ b/tgt-vvp/draw_vpi.c @@ -161,7 +161,11 @@ static int get_vpi_taskfunc_signal_arg(struct args_info *result, fprintf(stderr, "%s:%u: tgt-vvp warning: V0.9 " "may give incorrect results for " "an array select with a signed " +#ifdef __MINGW32__ /* MinGW does not know about z. */ + "index less than %u bits.\n", +#else "index less than %zu bits.\n", +#endif ivl_expr_file(expr), ivl_expr_lineno(expr), 8*sizeof(int)); @@ -230,7 +234,11 @@ static int get_vpi_taskfunc_signal_arg(struct args_info *result, (ivl_expr_width(bexpr) < 8*sizeof(int))) { fprintf(stderr, "%s:%u: tgt-vvp warning: V0.9 may give " "incorrect results for a select with a " +#ifdef __MINGW32__ /* MinGW does not know about z. */ + "signed index less than %u bits.\n", +#else "signed index less than %zu bits.\n", +#endif ivl_expr_file(expr), ivl_expr_lineno(expr), 8*sizeof(int)); diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index fbdc4778f..d34eb6eee 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -1692,7 +1692,11 @@ static void draw_lpm_part(ivl_lpm_t net) if (ivl_lpm_signed(net) && width_of_nexus(sel) < 8*sizeof(int)) { fprintf(stderr, "%s:%u: tgt-vvp warning: V0.9 may give " "incorrect results for a select with a " +#ifdef __MINGW32__ /* MinGW does not know about z. */ + "signed index less than %u bits.\n", +#else "signed index less than %zu bits.\n", +#endif ivl_lpm_file(net), ivl_lpm_lineno(net), 8*sizeof(int)); } diff --git a/vvp/main.cc b/vvp/main.cc index 6f0649d23..a452fcd33 100644 --- a/vvp/main.cc +++ b/vvp/main.cc @@ -366,16 +366,28 @@ int main(int argc, char*argv[]) } if (verbose_flag) { +#ifdef __MINGW32__ /* MinGW does not know about z. */ + vpi_mcd_printf(1, " ... %8lu functors (net_fun pool=%u bytes)\n", +#else vpi_mcd_printf(1, " ... %8lu functors (net_fun pool=%zu bytes)\n", +#endif count_functors, size_vvp_net_funs); vpi_mcd_printf(1, " %8lu logic\n", count_functors_logic); vpi_mcd_printf(1, " %8lu bufif\n", count_functors_bufif); vpi_mcd_printf(1, " %8lu resolv\n",count_functors_resolv); vpi_mcd_printf(1, " %8lu signals\n", count_functors_sig); +#ifdef __MINGW32__ /* MinGW does not know about z. */ + vpi_mcd_printf(1, " ... %8lu opcodes (%u bytes)\n", +#else vpi_mcd_printf(1, " ... %8lu opcodes (%zu bytes)\n", +#endif count_opcodes, size_opcodes); vpi_mcd_printf(1, " ... %8lu nets\n", count_vpi_nets); +#ifdef __MINGW32__ /* MinGW does not know about z. */ + vpi_mcd_printf(1, " ... %8lu vvp_nets (%u bytes)\n", +#else vpi_mcd_printf(1, " ... %8lu vvp_nets (%zu bytes)\n", +#endif count_vvp_nets, size_vvp_nets); vpi_mcd_printf(1, " ... %8lu arrays (%lu words)\n", count_net_arrays, count_net_array_words);