diff options
author | Mike Pall <mike> | 2010-12-31 00:46:29 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-12-31 00:46:29 +0100 |
commit | dc4b82c33d04930bbc2e54673ebea41ffa3368fc (patch) | |
tree | 4feab1b979ef6ecd1bccb5af613410ccd823a9fd /src/lj_cconv.c | |
parent | 4668b229de64a839857391808c90f92290125ad8 (diff) | |
download | luajit-dc4b82c33d04930bbc2e54673ebea41ffa3368fc.tar.gz luajit-dc4b82c33d04930bbc2e54673ebea41ffa3368fc.tar.bz2 luajit-dc4b82c33d04930bbc2e54673ebea41ffa3368fc.zip |
Add lj_num2u64 for number to uint64_t conversion.
Diffstat (limited to 'src/lj_cconv.c')
-rw-r--r-- | src/lj_cconv.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lj_cconv.c b/src/lj_cconv.c index 5df33d04..b123c081 100644 --- a/src/lj_cconv.c +++ b/src/lj_cconv.c | |||
@@ -200,13 +200,8 @@ void lj_cconv_ct_ct(CTState *cts, CType *d, CType *s, | |||
200 | } else if (dsize == 8) { | 200 | } else if (dsize == 8) { |
201 | if (!(dinfo & CTF_UNSIGNED)) | 201 | if (!(dinfo & CTF_UNSIGNED)) |
202 | *(int64_t *)dp = (int64_t)n; | 202 | *(int64_t *)dp = (int64_t)n; |
203 | #ifdef _MSC_VER | ||
204 | else if (n >= 9223372036854775808.0) /* They think it's a feature. */ | ||
205 | *(uint64_t *)dp = (uint64_t)(int64_t)(n - 9223372036854775808.0) + | ||
206 | U64x(80000000,00000000); | ||
207 | #endif | ||
208 | else | 203 | else |
209 | *(uint64_t *)dp = (uint64_t)n; | 204 | *(uint64_t *)dp = lj_num2u64(n); |
210 | } else { | 205 | } else { |
211 | goto err_conv; /* NYI: conversion to >64 bit integers. */ | 206 | goto err_conv; /* NYI: conversion to >64 bit integers. */ |
212 | } | 207 | } |