summaryrefslogtreecommitdiff
path: root/gi/fundamental.h
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2016-09-01 18:41:38 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2016-09-27 19:29:00 -0700
commite26191a137fc671b5e8fc8c18d5d6103edaa8b35 (patch)
tree71da4541f7d571cafdcfd58f4dc21833de48508b /gi/fundamental.h
parentb136107eef97db27b12fafe74e86fe29f8ebd772 (diff)
downloadgjs-e26191a137fc671b5e8fc8c18d5d6103edaa8b35.tar.gz
js: Discontinue usage of JSBool
In mozjs31, JSBool and its values JS_TRUE and JS_FALSE are discontinued in favor of regular C++ bool, true, and false. In order to ease porting to mozjs31, we switch to C++ booleans everywhere. Almost everywhere, that is. In some cases bool *, or function pointers with bool return types, will not automatically be cast. We therefore leave a few instances of JSBool in the code. These will be removed when the actual port to mozjs31 happens. Fixes a few formatting glitches in lines of code that were touched anyway. https://bugzilla.gnome.org/show_bug.cgi?id=742249
Diffstat (limited to 'gi/fundamental.h')
-rw-r--r--gi/fundamental.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/gi/fundamental.h b/gi/fundamental.h
index 50e10864..31bd2d01 100644
--- a/gi/fundamental.h
+++ b/gi/fundamental.h
@@ -25,13 +25,14 @@
#ifndef __GJS_FUNDAMENTAL_H__
#define __GJS_FUNDAMENTAL_H__
+#include <stdbool.h>
#include <glib.h>
#include <girepository.h>
#include "gjs/jsapi-util.h"
G_BEGIN_DECLS
-JSBool gjs_define_fundamental_class (JSContext *context,
+bool gjs_define_fundamental_class (JSContext *context,
JSObject *in_object,
GIObjectInfo *info,
JSObject **constructor_p,
@@ -44,13 +45,13 @@ void* gjs_g_fundamental_from_object (JSContext *context,
JSObject *gjs_fundamental_from_g_value (JSContext *context,
const GValue *value,
GType gtype);
-JSBool gjs_typecheck_fundamental (JSContext *context,
+bool gjs_typecheck_fundamental (JSContext *context,
JSObject *object,
GType expected_gtype,
- JSBool throw_error);
-JSBool gjs_typecheck_is_fundamental (JSContext *context,
+ bool throw_error);
+bool gjs_typecheck_is_fundamental (JSContext *context,
JSObject *object,
- JSBool throw_error);
+ bool throw_error);
void* gjs_fundamental_ref (JSContext *context,
void *fobj);
void gjs_fundamental_unref (JSContext *context,