[njs] Adding const qualifier to njs_value_property().

Dmitry Volyntsev xeioex at nginx.com
Fri Apr 5 14:16:57 UTC 2019


details:   https://hg.nginx.org/njs/rev/38262ccd9571
branches:  
changeset: 869:38262ccd9571
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Apr 05 16:49:21 2019 +0300
description:
Adding const qualifier to njs_value_property().

diffstat:

 njs/njs_object.h |  2 +-
 njs/njs_vm.c     |  8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r b137489312e1 -r 38262ccd9571 njs/njs_object.h
--- a/njs/njs_object.h	Tue Mar 26 00:42:39 2019 +0800
+++ b/njs/njs_object.h	Fri Apr 05 16:49:21 2019 +0300
@@ -88,7 +88,7 @@ njs_object_t *njs_object_value_alloc(njs
     nxt_uint_t type);
 njs_array_t *njs_object_enumerate(njs_vm_t *vm, const njs_value_t *value,
     njs_object_enum_t kind, nxt_bool_t all);
-njs_ret_t njs_value_property(njs_vm_t *vm, njs_value_t *value,
+njs_ret_t njs_value_property(njs_vm_t *vm, const njs_value_t *value,
     const njs_value_t *property, njs_value_t *retval);
 njs_object_prop_t *njs_object_property(njs_vm_t *vm, const njs_object_t *obj,
     nxt_lvlhsh_query_t *lhq);
diff -r b137489312e1 -r 38262ccd9571 njs/njs_vm.c
--- a/njs/njs_vm.c	Tue Mar 26 00:42:39 2019 +0800
+++ b/njs/njs_vm.c	Fri Apr 05 16:49:21 2019 +0300
@@ -2956,7 +2956,7 @@ njs_primitive_value(njs_vm_t *vm, njs_va
  *      retval will contain undefined
  */
 njs_ret_t
-njs_value_property(njs_vm_t *vm, njs_value_t *value,
+njs_value_property(njs_vm_t *vm, const njs_value_t *value,
     const njs_value_t *property, njs_value_t *retval)
 {
     njs_ret_t             ret;
@@ -2965,7 +2965,7 @@ njs_value_property(njs_vm_t *vm, njs_val
 
     njs_property_query_init(&pq, NJS_PROPERTY_QUERY_GET, 0);
 
-    ret = njs_property_query(vm, &pq, value, property);
+    ret = njs_property_query(vm, &pq, (njs_value_t *) value, property);
 
     switch (ret) {
 
@@ -2994,8 +2994,8 @@ njs_value_property(njs_vm_t *vm, njs_val
         case NJS_PROPERTY_HANDLER:
             pq.scratch = *prop;
             prop = &pq.scratch;
-            ret = prop->value.data.u.prop_handler(vm, value, NULL,
-                                                  &prop->value);
+            ret = prop->value.data.u.prop_handler(vm, (njs_value_t *) value,
+                                                  NULL, &prop->value);
 
             if (nxt_slow_path(ret != NXT_OK)) {
                 return ret;


More information about the nginx-devel mailing list