[njs] Fixed integer constant is too large compilation error by gcc 4.4.

Dmitry Volyntsev xeioex at nginx.com
Tue Mar 3 16:01:50 UTC 2020


details:   https://hg.nginx.org/njs/rev/c5c6aab76bb4
branches:  
changeset: 1348:c5c6aab76bb4
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Mar 03 19:00:54 2020 +0300
description:
Fixed integer constant is too large compilation error by gcc 4.4.

diffstat:

 src/njs_number.c |  2 +-
 src/njs_number.h |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r ef30d99ea2be -r c5c6aab76bb4 src/njs_number.c
--- a/src/njs_number.c	Tue Mar 03 18:57:15 2020 +0300
+++ b/src/njs_number.c	Tue Mar 03 19:00:54 2020 +0300
@@ -236,7 +236,7 @@ njs_uint64_to_string(njs_vm_t *vm, njs_v
     u_char  *dst, *p;
     u_char  buf[128];
 
-    if (njs_fast_path(u64 < 0x3fffffffffff)) {
+    if (njs_fast_path(u64 < 0x3fffffffffffULL)) {
         /* Fits to short_string. */
         dst = njs_string_short_start(value);
 
diff -r ef30d99ea2be -r c5c6aab76bb4 src/njs_number.h
--- a/src/njs_number.h	Tue Mar 03 18:57:15 2020 +0300
+++ b/src/njs_number.h	Tue Mar 03 19:00:54 2020 +0300
@@ -8,7 +8,7 @@
 #define _NJS_NUMBER_H_INCLUDED_
 
 
-#define NJS_MAX_LENGTH           (0x1fffffffffffff)
+#define NJS_MAX_LENGTH           (0x1fffffffffffffULL)
 
 
 double njs_key_to_index(const njs_value_t *value);


More information about the nginx-devel mailing list