[gjs/wip/ptomato/mozjs31: 2/3] js: Remove remaining usage of JSBool



commit ad8f5631dacdf781145a177224104fe6796defce
Author: Philip Chimento <philip endlessm com>
Date:   Wed Sep 7 18:00:06 2016 -0700

    js: Remove remaining usage of JSBool
    
    Since mozjs31 does away with JSBool entirely, we can now replace the
    remaining occurrences of it in the API with C++ bool.

 gi/arg.cpp                |    4 ++--
 gi/boxed.cpp              |    6 +++---
 gi/function.cpp           |    6 +++---
 gi/keep-alive.cpp         |    2 +-
 gi/ns.cpp                 |    2 +-
 gi/object.cpp             |    6 +++---
 gi/repo.cpp               |    2 +-
 gi/value.cpp              |    4 ++--
 gjs/byteArray.cpp         |    6 +++---
 gjs/context.cpp           |    8 ++++----
 gjs/coverage.cpp          |    8 ++++----
 gjs/importer.cpp          |    6 +++---
 gjs/jsapi-util-string.cpp |    4 ++--
 gjs/jsapi-util.h          |    6 +++---
 gjs/runtime.cpp           |   10 +++++-----
 modules/system.cpp        |   12 ++++++------
 16 files changed, 46 insertions(+), 46 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index cce3d42..19582e1 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1082,7 +1082,7 @@ gjs_array_to_explicit_array_internal(JSContext       *context,
     bool ret = false;
     GITypeInfo *param_info;
     jsid length_name;
-    JSBool found_length;
+    bool found_length;
 
     param_info = g_type_info_get_param_type(type_info, 0);
 
@@ -1633,7 +1633,7 @@ gjs_value_to_g_argument(JSContext      *context,
     case GI_TYPE_TAG_GLIST:
     case GI_TYPE_TAG_GSLIST: {
         jsid length_name;
-        JSBool found_length;
+        bool found_length;
 
         length_name = gjs_context_get_const_string(context, GJS_STRING_LENGTH);
 
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index b73408a..a2ef808 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -629,7 +629,7 @@ get_nested_interface_object (JSContext   *context,
     return true;
 }
 
-static JSBool
+static bool
 boxed_field_getter (JSContext              *context,
                     JS::HandleObject        obj,
                     JS::HandleId            id,
@@ -808,11 +808,11 @@ out:
     return success;
 }
 
-static JSBool
+static bool
 boxed_field_setter (JSContext              *context,
                     JS::HandleObject        obj,
                     JS::HandleId            id,
-                    JSBool                  strict,
+                    bool                    strict,
                     JS::MutableHandleValue  value)
 {
     Boxed *priv;
diff --git a/gi/function.cpp b/gi/function.cpp
index fe650ad..7cbeada 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -1294,7 +1294,7 @@ release:
     }
 }
 
-static JSBool
+static bool
 function_call(JSContext *context,
               unsigned   js_argc,
               JS::Value *vp)
@@ -1393,7 +1393,7 @@ get_num_arguments (JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 function_to_string (JSContext *context,
                     guint      argc,
                     JS::Value *vp)
@@ -1664,7 +1664,7 @@ function_new(JSContext      *context,
     JSObject *function;
     JSObject *global;
     Function *priv;
-    JSBool found;
+    bool found;
 
     /* put constructor for GIRepositoryFunction() in the global namespace */
     global = gjs_get_import_global(context);
diff --git a/gi/keep-alive.cpp b/gi/keep-alive.cpp
index ae98a44..b7f369a 100644
--- a/gi/keep-alive.cpp
+++ b/gi/keep-alive.cpp
@@ -180,7 +180,7 @@ gjs_keep_alive_new(JSContext *context)
     KeepAlive *priv;
     JSObject *keep_alive = NULL;
     JSObject *global;
-    JSBool found;
+    bool found;
 
     /* This function creates an unattached KeepAlive object; following our
      * general strategy, we have a single KeepAlive class with a constructor
diff --git a/gi/ns.cpp b/gi/ns.cpp
index 2000fd8..27c193e 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -206,7 +206,7 @@ ns_new(JSContext    *context,
     JSObject *ns;
     JSObject *global;
     Ns *priv;
-    JSBool found;
+    bool found;
 
     /* put constructor in the global namespace */
     global = gjs_get_import_global(context);
diff --git a/gi/object.cpp b/gi/object.cpp
index 9d5b081..18f6f0d 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -250,7 +250,7 @@ proto_priv_from_js(JSContext *context,
 /* a hook on getting a property; set value_p to override property's value.
  * Return value is false on OOM/exception.
  */
-static JSBool
+static bool
 object_instance_get_prop(JSContext              *context,
                          JS::HandleObject        obj,
                          JS::HandleId            id,
@@ -320,11 +320,11 @@ object_instance_get_prop(JSContext              *context,
 /* a hook on setting a property; set value_p to override property value to
  * be set. Return value is false on OOM/exception.
  */
-static JSBool
+static bool
 object_instance_set_prop(JSContext              *context,
                          JS::HandleObject        obj,
                          JS::HandleId            id,
-                         JSBool                  strict,
+                         bool                    strict,
                          JS::MutableHandleValue  value_p)
 {
     ObjectInstance *priv;
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 2a15439..7f99235 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -260,7 +260,7 @@ repo_new(JSContext *context)
     JSObject *global;
     JSObject *versions;
     JSObject *private_ns;
-    JSBool found;
+    bool found;
     jsid versions_name, private_ns_name;
 
     global = gjs_get_import_global(context);
diff --git a/gi/value.cpp b/gi/value.cpp
index c1e855b..b326c86 100644
--- a/gi/value.cpp
+++ b/gi/value.cpp
@@ -471,7 +471,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             return false;
         }
     } else if (gtype == G_TYPE_BOOLEAN) {
-        JSBool b;
+        bool b;
 
         /* JS_ValueToBoolean() pretty much always succeeds,
          * which is maybe surprising sometimes, but could
@@ -510,7 +510,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
         g_value_set_object(gvalue, gobj);
     } else if (gtype == G_TYPE_STRV) {
         jsid length_name;
-        JSBool found_length;
+        bool found_length;
 
         length_name = gjs_context_get_const_string(context, GJS_STRING_LENGTH);
         if (value.isNull()) {
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index e69eb85..8d0793e 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -569,7 +569,7 @@ byte_array_new(JSContext *context)
 }
 
 /* fromString() function implementation */
-static JSBool
+static bool
 from_string_func(JSContext *context,
                  unsigned   argc,
                  JS::Value *vp)
@@ -673,7 +673,7 @@ from_string_func(JSContext *context,
 }
 
 /* fromArray() function implementation */
-static JSBool
+static bool
 from_array_func(JSContext *context,
                 unsigned   argc,
                 JS::Value *vp)
@@ -740,7 +740,7 @@ from_array_func(JSContext *context,
     return ret;
 }
 
-static JSBool
+static bool
 from_gbytes_func(JSContext *context,
                  unsigned   argc,
                  JS::Value *vp)
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 1954d86..111a3ac 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -102,7 +102,7 @@ enum {
 static GMutex contexts_lock;
 static GList *all_contexts = NULL;
 
-static JSBool
+static bool
 gjs_log(JSContext *context,
         unsigned   argc,
         JS::Value *vp)
@@ -146,7 +146,7 @@ gjs_log(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 gjs_log_error(JSContext *context,
               unsigned   argc,
               JS::Value *vp)
@@ -233,7 +233,7 @@ gjs_print_parse_args(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 gjs_print(JSContext *context,
           unsigned   argc,
           JS::Value *vp)
@@ -252,7 +252,7 @@ gjs_print(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 gjs_printerr(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 417b895..abe5403 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1333,7 +1333,7 @@ gjs_context_eval_file_in_compartment(GjsContext *context,
     return true;
 }
 
-static JSBool
+static bool
 coverage_log(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
@@ -1408,7 +1408,7 @@ get_file_from_filename_as_js_string(JSContext    *context,
     return file;
 }
 
-static JSBool
+static bool
 coverage_get_file_modification_time(JSContext *context,
                                     unsigned  argc,
                                     JS::Value *vp)
@@ -1441,7 +1441,7 @@ out:
     return ret;
 }
 
-static JSBool
+static bool
 coverage_get_file_checksum(JSContext *context,
                            unsigned  argc,
                            JS::Value *vp)
@@ -1470,7 +1470,7 @@ coverage_get_file_checksum(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 coverage_get_file_contents(JSContext *context,
                            unsigned   argc,
                            JS::Value *vp)
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 9ecea53..fafe632 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -152,7 +152,7 @@ seal_import(JSContext  *context,
             JSObject   *obj,
             const char *name)
 {
-    JSBool found;
+    bool found;
     unsigned attrs;
 
     if (!JS_GetPropertyAttributes(context, obj, name,
@@ -299,7 +299,7 @@ load_module_init(JSContext  *context,
                  const char *full_path)
 {
     JSObject *module_obj;
-    JSBool found;
+    bool found;
     jsid module_init_name;
     GFile *file;
 
@@ -939,7 +939,7 @@ importer_new(JSContext *context,
     JSObject *importer;
     Importer *priv;
     JSObject *global;
-    JSBool found;
+    bool found;
 
     global = gjs_get_import_global(context);
 
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index f845d15..4120fda 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -28,7 +28,7 @@
 #include "jsapi-util.h"
 #include "compat.h"
 
-JSBool
+bool
 gjs_string_to_utf8 (JSContext      *context,
                     const JS::Value value,
                     char          **utf8_string_p)
@@ -106,7 +106,7 @@ gjs_string_from_utf8(JSContext  *context,
     return str != NULL;
 }
 
-JSBool
+bool
 gjs_string_to_filename(JSContext      *context,
                        const JS::Value filename_val,
                        char          **filename_string_p)
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 363209a..ab34ffc 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -207,7 +207,7 @@ JS::Value gjs_##cname##_create_proto(JSContext *context, JSObject *module, const
  * Prototype a constructor.
  */
 #define GJS_NATIVE_CONSTRUCTOR_DECLARE(name)            \
-static JSBool                                           \
+static bool                                             \
 gjs_##name##_constructor(JSContext  *context,           \
                          unsigned    argc,              \
                          JS::Value  *vp)
@@ -372,14 +372,14 @@ bool        gjs_delete_prop_verbose_stub     (JSContext       *context,
                                               JS::Value        id,
                                               JS::Value       *value_p);
 
-JSBool      gjs_string_to_utf8               (JSContext       *context,
+bool        gjs_string_to_utf8               (JSContext       *context,
                                               const JS::Value  string_val,
                                               char           **utf8_string_p);
 bool        gjs_string_from_utf8             (JSContext       *context,
                                               const char      *utf8_string,
                                               gssize           n_bytes,
                                               JS::Value       *value_p);
-JSBool      gjs_string_to_filename           (JSContext       *context,
+bool        gjs_string_to_filename           (JSContext       *context,
                                               const JS::Value  string_val,
                                               char           **filename_string_p);
 bool        gjs_string_from_filename         (JSContext       *context,
diff --git a/gjs/runtime.cpp b/gjs/runtime.cpp
index de2e779..fc2f151 100644
--- a/gjs/runtime.cpp
+++ b/gjs/runtime.cpp
@@ -44,7 +44,7 @@ gjs_runtime_is_sweeping (JSRuntime *runtime)
  * to UTF-8, using the appropriate GLib functions, and converting
  * back if necessary.
  */
-static JSBool
+static bool
 gjs_locale_to_upper_case (JSContext *context,
                           JS::HandleString src,
                           JS::MutableHandleValue retval)
@@ -70,7 +70,7 @@ out:
     return success;
 }
 
-static JSBool
+static bool
 gjs_locale_to_lower_case (JSContext *context,
                           JS::HandleString src,
                           JS::MutableHandleValue retval)
@@ -96,7 +96,7 @@ out:
     return success;
 }
 
-static JSBool
+static bool
 gjs_locale_compare (JSContext *context,
                     JS::HandleString src_1,
                     JS::HandleString src_2,
@@ -120,7 +120,7 @@ out:
     return success;
 }
 
-static JSBool
+static bool
 gjs_locale_to_unicode (JSContext  *context,
                        const char *src,
                        JS::MutableHandleValue retval)
@@ -167,7 +167,7 @@ static JSLocaleCallbacks gjs_locale_callbacks =
 void
 gjs_finalize_callback(JSFreeOp         *fop,
                       JSFinalizeStatus  status,
-                      JSBool            isCompartment)
+                      bool              isCompartment)
 {
   JSRuntime *runtime;
   RuntimeData *data;
diff --git a/modules/system.cpp b/modules/system.cpp
index 333f86a..cb26ad5 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -32,7 +32,7 @@
 #include <gi/object.h>
 #include "system.h"
 
-static JSBool
+static bool
 gjs_address_of(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -57,7 +57,7 @@ gjs_address_of(JSContext *context,
     return ret;
 }
 
-static JSBool
+static bool
 gjs_refcount(JSContext *context,
              unsigned   argc,
              JS::Value *vp)
@@ -80,7 +80,7 @@ gjs_refcount(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 gjs_breakpoint(JSContext *context,
                unsigned   argc,
                JS::Value *vp)
@@ -93,7 +93,7 @@ gjs_breakpoint(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 gjs_gc(JSContext *context,
        unsigned   argc,
        JS::Value *vp)
@@ -106,7 +106,7 @@ gjs_gc(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 gjs_exit(JSContext *context,
          unsigned   argc,
          JS::Value *vp)
@@ -119,7 +119,7 @@ gjs_exit(JSContext *context,
     return true;
 }
 
-static JSBool
+static bool
 gjs_clear_date_caches(JSContext *context,
                       unsigned   argc,
                       JS::Value *vp)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]