[njs] Style.

Dmitry Volyntsev xeioex at nginx.com
Tue Jan 30 01:17:29 UTC 2024


details:   https://hg.nginx.org/njs/rev/fca50ba4db9d
branches:  
changeset: 2278:fca50ba4db9d
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon Jan 29 17:16:08 2024 -0800
description:
Style.

diffstat:

 src/njs_builtin.c |   2 +-
 src/njs_clang.h   |  26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diffs (48 lines):

diff -r 478795e3296b -r fca50ba4db9d src/njs_builtin.c
--- a/src/njs_builtin.c	Mon Jan 29 17:16:07 2024 -0800
+++ b/src/njs_builtin.c	Mon Jan 29 17:16:08 2024 -0800
@@ -28,7 +28,7 @@ static njs_int_t njs_global_this_prop_ha
 static njs_arr_t *njs_vm_expression_completions(njs_vm_t *vm,
     njs_str_t *expression);
 static njs_arr_t *njs_vm_global_var_completions(njs_vm_t *vm,
-	njs_str_t *expression);
+    njs_str_t *expression);
 static njs_arr_t *njs_object_completions(njs_vm_t *vm, njs_value_t *object,
     njs_str_t *expression);
 static njs_int_t njs_env_hash_init(njs_vm_t *vm, njs_lvlhsh_t *hash,
diff -r 478795e3296b -r fca50ba4db9d src/njs_clang.h
--- a/src/njs_clang.h	Mon Jan 29 17:16:07 2024 -0800
+++ b/src/njs_clang.h	Mon Jan 29 17:16:08 2024 -0800
@@ -193,19 +193,19 @@ njs_leading_zeros64(uint64_t x)
 njs_inline NJS_NOSANITIZE("float-cast-overflow") int64_t
 njs_unsafe_cast_double_to_int64(double num)
 {
-	/*
-	 * Casting NaN to integer is undefined behavior,
-	 * but it is fine in some cases where we do additional checks later.
-	 * For example:
-	 *  int64_t i64 = njs_unsafe_cast_double_to_int64(num);
-	 *  if (i64 == num) {
-	 *    // num is integer
-	 *  }
-	 *
-	 * We do this as inline function to avoid UndefinedBehaviorSanitizer
-	 * warnings.
-	 */
-	return (int64_t) num;
+    /*
+     * Casting NaN to integer is undefined behavior,
+     * but it is fine in some cases where we do additional checks later.
+     * For example:
+     *  int64_t i64 = njs_unsafe_cast_double_to_int64(num);
+     *  if (i64 == num) {
+     *    // num is integer
+     *  }
+     *
+     * We do this as inline function to avoid UndefinedBehaviorSanitizer
+     * warnings.
+     */
+    return (int64_t) num;
 }
 
 


More information about the nginx-devel mailing list