aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2011-11-15 20:10:21 +0100
committerPatrik Nyblom <[email protected]>2011-12-02 15:26:16 +0100
commite04704b1f40511a6e1090b4cb04ef543580cdcc7 (patch)
tree53b552ed234927259261550f49e88629389e6ba2 /erts/emulator/beam/io.c
parente78a1582dc13d770bf1a9de64ff817369c741ef5 (diff)
downloadotp-e04704b1f40511a6e1090b4cb04ef543580cdcc7.tar.gz
otp-e04704b1f40511a6e1090b4cb04ef543580cdcc7.tar.bz2
otp-e04704b1f40511a6e1090b4cb04ef543580cdcc7.zip
Iron out bugs in Win64 found in daily builds
Almost all uses of the 'long' datatype is removed from VM and tests Emulator test now runs w/o drivers crashing Nasty abs bug fixed in VM as well as type errors in allocator debug functions Still one allocator test that fails, domain knowledge is needed to fix that. Fix type inconsistency in beam_load causing crashes
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r--erts/emulator/beam/io.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 132dc78515..c2cc03509e 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -445,7 +445,7 @@ setup_port(Port* prt, Eterm pid, erts_driver_t *driver,
prt->control_flags = 0;
prt->connected = pid;
- prt->drv_data = (long) drv_data;
+ prt->drv_data = (SWord) drv_data;
prt->bytes_in = 0;
prt->bytes_out = 0;
prt->dist_entry = NULL;
@@ -648,7 +648,7 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
if (IS_TRACED_FL(port, F_TRACE_SCHED_PORTS)) {
trace_sched_ports_where(port, am_out, am_start);
}
- if (error_number_ptr && ((long) drv_data) == (long) -2)
+ if (error_number_ptr && ((SWord) drv_data) == (SWord) -2)
*error_number_ptr = errno;
#ifdef ERTS_SMP
if (port->xports)
@@ -657,10 +657,10 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
#endif
}
- if (((long)drv_data) == -1 ||
- ((long)drv_data) == -2 ||
- ((long)drv_data) == -3) {
- int res = (int) ((long) drv_data);
+ if (((SWord)drv_data) == -1 ||
+ ((SWord)drv_data) == -2 ||
+ ((SWord)drv_data) == -3) {
+ int res = (int) ((SWord) drv_data);
if (res == -3 && error_number_ptr) {
*error_number_ptr = BADARG;
@@ -689,7 +689,7 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
erts_port_release(port);
return res;
}
- port->drv_data = (long) drv_data;
+ port->drv_data = (SWord) drv_data;
return port_ix;
}
@@ -3083,7 +3083,7 @@ driver_deliver_term(ErlDrvPort port,
Binary* bp = erts_bin_nrml_alloc(size);
ASSERT(bufp);
bp->flags = 0;
- bp->orig_size = (long) size;
+ bp->orig_size = (SWord) size;
erts_refc_init(&bp->refc, 1);
sys_memcpy((void *) bp->orig_bytes, (void *) bufp, size);
pbp = (ProcBin *) hp;
@@ -3449,7 +3449,7 @@ driver_alloc_binary(int size)
return NULL; /* The driver write must take action */
bin->flags = BIN_FLAG_DRV;
erts_refc_init(&bin->refc, 1);
- bin->orig_size = (long) size;
+ bin->orig_size = (SWord) size;
return Binary2ErlDrvBinary(bin);
}
@@ -4076,7 +4076,7 @@ drv_cancel_timer(Port *prt)
erts_port_task_abort(prt->id, &prt->timeout_task);
}
-int driver_set_timer(ErlDrvPort ix, UWord t)
+int driver_set_timer(ErlDrvPort ix, unsigned long t)
{
Port* prt = erts_drvport2port(ix);