aboutsummaryrefslogtreecommitdiff
path: root/editors/awk.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/awk.c')
-rw-r--r--editors/awk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c
index c88b8e1c4..5a26d389f 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -915,7 +915,7 @@ static int fmt_num(char *b, int size, const char *format, double n, int int_as_i
915 const char *s = format; 915 const char *s = format;
916 916
917 if (int_as_int && n == (long long)n) { 917 if (int_as_int && n == (long long)n) {
918 r = snprintf(b, size, "%lld", (long long)n); 918 r = snprintf(b, size, "%"LL_FMT"d", (long long)n);
919 } else { 919 } else {
920 do { c = *s; } while (c && *++s); 920 do { c = *s; } while (c && *++s);
921 if (strchr("diouxX", c)) { 921 if (strchr("diouxX", c)) {
@@ -3206,6 +3206,12 @@ static var *evaluate(node *op, var *res)
3206 v &= 0x7fffffffffffffffULL; 3206 v &= 0x7fffffffffffffffULL;
3207# endif 3207# endif
3208 R_d = (double)v / 0x8000000000000000ULL; 3208 R_d = (double)v / 0x8000000000000000ULL;
3209#elif ENABLE_PLATFORM_MINGW32 && RAND_MAX == 0x7fff
3210 /* 45 bits of randomness ought to be enough for anyone */
3211 uint64_t v = ((uint64_t)rand() << 48) |
3212 ((uint64_t)rand() << 33) |
3213 ((uint64_t)rand() << 18);
3214 R_d = (double)v / 0x8000000000000000ULL;
3209#else 3215#else
3210# error Not implemented for this value of RAND_MAX 3216# error Not implemented for this value of RAND_MAX
3211#endif 3217#endif