diff --git a/libveriuser/a_fetch_param.c b/libveriuser/a_fetch_param.c index 5993a47da..bf7b5ba8c 100644 --- a/libveriuser/a_fetch_param.c +++ b/libveriuser/a_fetch_param.c @@ -36,7 +36,7 @@ double acc_fetch_paramval(handle object) fprintf(pli_trace, "acc_fetch_paramval(%s) --> \"%s\"\n", vpi_get_str(vpiName, object), val.value.str); } - return (double) (long)val.value.str; + return (double) (intptr_t)val.value.str; default: vpi_printf("XXXX: parameter %s has type %d\n", diff --git a/tgt-vlog95/logic_lpm.c b/tgt-vlog95/logic_lpm.c index 7e390d809..1cffbd1e0 100644 --- a/tgt-vlog95/logic_lpm.c +++ b/tgt-vlog95/logic_lpm.c @@ -1900,7 +1900,7 @@ void emit_signal_net_const_as_ca(ivl_scope_t scope, ivl_signal_t sig) { ivl_nexus_t nex = ivl_signal_nex(sig, 0); unsigned idx, count = ivl_nexus_ptrs(nex); - unsigned long emitted = (unsigned long) ivl_nexus_get_private(nex); + unsigned long emitted = (uintptr_t) ivl_nexus_get_private(nex); for (idx = 0; idx < count; idx += 1) { ivl_nexus_ptr_t nex_ptr = ivl_nexus_ptr(nex, idx); ivl_net_const_t net_const = ivl_nexus_ptr_con(nex_ptr); @@ -1930,7 +1930,7 @@ void emit_signal_net_const_as_ca(ivl_scope_t scope, ivl_signal_t sig) fprintf(vlog_out, "\n"); /* Increment the emitted constant count by one. */ ivl_nexus_set_private(nex, - (void *) ((unsigned long) ivl_nexus_get_private(nex) + 1U)); + (void *) ((uintptr_t) ivl_nexus_get_private(nex) + 1U)); return; } /* We must find the constant in the nexus. */ diff --git a/vpi/fstapi.c b/vpi/fstapi.c index 5ec842da2..693722ce3 100644 --- a/vpi/fstapi.c +++ b/vpi/fstapi.c @@ -1449,12 +1449,12 @@ for(i=0;imaxhandle;i++) PPvoid_t pv = JudyHSIns(&PJHSArray, dmem, destlen, NULL); if(*pv) { - uint32_t pvi = (long)(*pv); + uint32_t pvi = (intptr_t)(*pv); vm4ip[2] = -pvi; } else { - *pv = (void *)(long)(i+1); + *pv = (void *)(intptr_t)(i+1); #endif fpos += fstWriterVarint(f, wrlen); fpos += destlen; @@ -1469,12 +1469,12 @@ for(i=0;imaxhandle;i++) PPvoid_t pv = JudyHSIns(&PJHSArray, scratchpnt, wrlen, NULL); if(*pv) { - uint32_t pvi = (long)(*pv); + uint32_t pvi = (intptr_t)(*pv); vm4ip[2] = -pvi; } else { - *pv = (void *)(long)(i+1); + *pv = (void *)(intptr_t)(i+1); #endif fpos += fstWriterVarint(f, 0); fpos += wrlen; @@ -1504,12 +1504,12 @@ for(i=0;imaxhandle;i++) PPvoid_t pv = JudyHSIns(&PJHSArray, dmem, rc, NULL); if(*pv) { - uint32_t pvi = (long)(*pv); + uint32_t pvi = (intptr_t)(*pv); vm4ip[2] = -pvi; } else { - *pv = (void *)(long)(i+1); + *pv = (void *)(intptr_t)(i+1); #endif fpos += fstWriterVarint(f, wrlen); fpos += rc; @@ -1524,12 +1524,12 @@ for(i=0;imaxhandle;i++) PPvoid_t pv = JudyHSIns(&PJHSArray, scratchpnt, wrlen, NULL); if(*pv) { - uint32_t pvi = (long)(*pv); + uint32_t pvi = (intptr_t)(*pv); vm4ip[2] = -pvi; } else { - *pv = (void *)(long)(i+1); + *pv = (void *)(intptr_t)(i+1); #endif fpos += fstWriterVarint(f, 0); fpos += wrlen; @@ -1546,12 +1546,12 @@ for(i=0;imaxhandle;i++) PPvoid_t pv = JudyHSIns(&PJHSArray, scratchpnt, wrlen, NULL); if(*pv) { - uint32_t pvi = (long)(*pv); + uint32_t pvi = (intptr_t)(*pv); vm4ip[2] = -pvi; } else { - *pv = (void *)(long)(i+1); + *pv = (void *)(intptr_t)(i+1); #endif fpos += fstWriterVarint(f, 0); fpos += wrlen; @@ -2307,14 +2307,14 @@ if(xc && path && path[0]) PPvoid_t pv = JudyHSIns(&(xc->path_array), path2, slen, NULL); if(*pv) { - sidx = (long)(*pv); + sidx = (intptr_t)(*pv); } else { char *rp = NULL; sidx = ++xc->path_array_count; - *pv = (void *)(long)(xc->path_array_count); + *pv = (void *)(intptr_t)(xc->path_array_count); if(use_realpath) { diff --git a/vpi/sys_fst.c b/vpi/sys_fst.c index f8c26404f..a0a770c6b 100644 --- a/vpi/sys_fst.c +++ b/vpi/sys_fst.c @@ -623,18 +623,18 @@ static void scan_item(unsigned depth, vpiHandle item, int skip) new_ident = fstWriterCreateVar(dump_file, type, dir, size, buf, - (fstHandle)(long)ident); + (fstHandle)(intptr_t)ident); free(buf); } else { new_ident = fstWriterCreateVar(dump_file, type, dir, size, escname, - (fstHandle)(long)ident); + (fstHandle)(intptr_t)ident); } free(escname); if (!ident) { if (nexus_id) set_nexus_ident(nexus_id, - (const char *)(long)new_ident); + (const char *)(intptr_t)new_ident); /* Add a callback for the signal. */ info = malloc(sizeof(*info)); diff --git a/vvp/vpi_signal.cc b/vvp/vpi_signal.cc index 81b10cece..8750c3a65 100644 --- a/vvp/vpi_signal.cc +++ b/vvp/vpi_signal.cc @@ -580,7 +580,7 @@ static int signal_get(int code, vpiHandle ref) // This private property must return zero when undefined. case _vpiNexusId: if (rfp->msb.get_value() == rfp->lsb.get_value()) - return (int) (unsigned long) rfp->node; + return (int) (uintptr_t) rfp->node; else return 0; diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index d86f3a1ba..6e89a1850 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -1039,7 +1039,7 @@ template class vvp_sub_pointer_t { vvp_sub_pointer_t(T*ptr__, unsigned port__) { - bits_ = reinterpret_cast (ptr__); + bits_ = reinterpret_cast (ptr__); assert( (bits_ & 3) == 0 ); assert( (port__ & ~3) == 0 ); bits_ |= port__; @@ -1061,7 +1061,7 @@ template class vvp_sub_pointer_t { bool operator != (vvp_sub_pointer_t that) const { return bits_ != that.bits_; } private: - unsigned long bits_; + uintptr_t bits_; }; typedef vvp_sub_pointer_t vvp_net_ptr_t;