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/t-dll.cc b/t-dll.cc index a06c76b3d..a5279a127 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -2283,7 +2283,7 @@ bool dll_target::net_const(const NetConst*net) unsigned idx; char*bits; static char*bits_tmp = 0; - static size_t bits_cnt = 0; + static unsigned bits_cnt = 0; struct ivl_net_const_s *obj = new struct ivl_net_const_s; @@ -2298,7 +2298,7 @@ bool dll_target::net_const(const NetConst*net) bits = obj->b.bit_; } else { - if (obj->width_+1 > bits_cnt) { + if (obj->width_ >= bits_cnt) { bits_tmp = (char*)realloc(bits_tmp, obj->width_+1); bits_cnt = obj->width_+1; } diff --git a/vvp/main.cc b/vvp/main.cc index bb447731f..bdfb3913c 100644 --- a/vvp/main.cc +++ b/vvp/main.cc @@ -372,18 +372,34 @@ 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, vvp_net_fun_t::heap_total()); 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 filters (net_fil pool=%u bytes)\n", +#else vpi_mcd_printf(1, " ... %8lu filters (net_fil pool=%zu bytes)\n", +#endif count_filters, vvp_net_fil_t::heap_total()); +#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);