diff --git a/mingw.txt b/mingw.txt index 19e861d7d..d90d32542 100644 --- a/mingw.txt +++ b/mingw.txt @@ -47,6 +47,8 @@ critical, but these are the versions I use. msys-1.0 msysDTK-1.0 Mingw32-5.x + ... including the sub-packages binutils, gcc-core and gcc-g++ + if you are given the option. readline-4.2-20010727.zip bzip2-1.0.3 zlib-1.2.3 diff --git a/vpi/sys_fileio.c b/vpi/sys_fileio.c index 9bbd5bb1c..996566640 100644 --- a/vpi/sys_fileio.c +++ b/vpi/sys_fileio.c @@ -480,23 +480,40 @@ static PLI_INT32 sys_ungetc_compiletf(PLI_BYTE8*name) vpiHandle item = vpi_scan(argv); if (item == 0) { - vpi_printf("%s: mcd parameter missing.\n", name); + vpi_printf("%s: character parameter missing.\n", name); return 0; } - type = vpi_get(vpiType, item); switch (type) { case vpiReg: - case vpiRealVal: + case vpiRealVal: // Is this correct? case vpiIntegerVar: break; default: - vpi_printf("ERROR: %s mcd parameter must be of integral", name); - vpi_printf(", got vpiType=%d\n", type); + vpi_printf("ERROR: %s character parameter must be ", name); + vpi_printf("integral, got vpiType=%d\n", type); vpi_free_object(argv); return 0; } + item = vpi_scan(argv); + type = vpi_get(vpiType, item); + switch (type) { + case vpiReg: + case vpiRealVal: // Is this correct? + case vpiIntegerVar: + break; + default: + vpi_printf("ERROR: %s mcd parameter must be integral, ", name); + vpi_printf("got vpiType=%d\n", type); + vpi_free_object(argv); + return 0; + } + + /* That should be all the arguments. */ + item = vpi_scan(argv); + assert(item == 0); + return 0; } @@ -504,7 +521,7 @@ static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name) { unsigned int mcd; unsigned char x; - s_vpi_value value, xvalue, rval; + s_vpi_value val, rval; vpiHandle sys = vpi_handle(vpiSysTfCall, 0); vpiHandle argv = vpi_iterate(vpiArgument, sys); vpiHandle item = vpi_scan(argv); @@ -512,11 +529,15 @@ static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name) rval.format = vpiIntVal; - assert(item); + val.format = vpiIntVal; + vpi_get_value(item, &val); + x = val.value.integer; - value.format = vpiIntVal; - vpi_get_value(item, &value); - mcd = value.value.integer; + item = vpi_scan(argv); + + val.format = vpiIntVal; + vpi_get_value(item, &val); + mcd = val.value.integer; if (IS_MCD(mcd)) { rval.value.integer = EOF; @@ -524,12 +545,6 @@ static PLI_INT32 sys_ungetc_calltf(PLI_BYTE8*name) return 0; } - item = vpi_scan(argv); - - xvalue.format = vpiIntVal; - vpi_get_value(item, &xvalue); - x = xvalue.value.integer; - fp = vpi_get_file(mcd); if ( !fp ) { rval.value.integer = EOF; diff --git a/vvp/vpi_priv.cc b/vvp/vpi_priv.cc index ec629c0cb..ee863a8cb 100644 --- a/vvp/vpi_priv.cc +++ b/vvp/vpi_priv.cc @@ -863,10 +863,16 @@ vpiHandle vpi_handle_by_name(const char *name, vpiHandle scope) */ if (scope) { /* Some implementations support either a module or a scope. */ - if (vpi_get(vpiType, scope ) == vpiScope) { + switch (vpi_get(vpiType, scope)) { + case vpiScope: hand = vpi_handle(vpiModule, scope); - } else { + break; + case vpiModule: hand = scope; + break; + default: + // Use vpi_chk_error() here when it is implemented. + return 0; } } else { hand = find_scope(name, NULL, 0);