Dmitry Volyntsev
January 29, 2024 08:20PM
details: https://hg.nginx.org/njs/rev/fca50ba4db9d
branches:
changeset: 2278:fca50ba4db9d
user: Dmitry Volyntsev <xeioex@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;
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Style.

Dmitry Volyntsev 324 January 29, 2024 08:20PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 188
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready