[gjs/wip/js24: 9/29] build: fix implicit pointer conversion errors



commit c756e9d29fdebb7ae605b37b2d58acb68489f85d
Author: Tim Lunn <tim feathertop org>
Date:   Wed Sep 25 13:11:39 2013 +1000

    build: fix implicit pointer conversion errors

 gi/arg.cpp                           |   86 +++++++++++++++++-----------------
 gi/boxed.cpp                         |    8 ++--
 gi/closure.cpp                       |    2 +-
 gi/foreign.cpp                       |    4 +-
 gi/function.cpp                      |   30 ++++++------
 gi/gerror.cpp                        |   16 +++---
 gi/gtype.cpp                         |    2 +-
 gi/interface.cpp                     |    2 +-
 gi/keep-alive.cpp                    |   18 ++++----
 gi/ns.cpp                            |    4 +-
 gi/object.cpp                        |   52 ++++++++++----------
 gi/param.cpp                         |    2 +-
 gi/repo.cpp                          |    4 +-
 gi/union.cpp                         |    2 +-
 gi/value.cpp                         |   14 +++---
 gjs/byteArray.cpp                    |    8 ++--
 gjs/console.cpp                      |    4 +-
 gjs/context.cpp                      |   20 ++++----
 gjs/importer.cpp                     |   10 ++--
 gjs/jsapi-util-string.cpp            |    4 +-
 gjs/jsapi-util.cpp                   |   14 +++---
 gjs/jsapi-util.h                     |    2 +-
 gjs/native.cpp                       |    4 +-
 gjs/profiler.cpp                     |   20 ++++----
 gjs/stack.cpp                        |    2 +-
 gjs/type-module.cpp                  |    2 +-
 installed-tests/gjs-unit.cpp         |   10 ++--
 libgjs-private/gjs-gdbus-wrapper.cpp |   12 ++--
 modules/cairo-context.cpp            |    2 +-
 modules/cairo-image-surface.cpp      |    2 +-
 modules/cairo-path.cpp               |    4 +-
 modules/cairo-pattern.cpp            |    4 +-
 modules/cairo-surface.cpp            |    4 +-
 modules/system.cpp                   |    2 +-
 test/gjs-tests.cpp                   |    4 +-
 util/glib.cpp                        |    2 +-
 util/log.cpp                         |    2 +-
 37 files changed, 192 insertions(+), 192 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index e9105d6..6a8cefe 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -64,7 +64,7 @@ _gjs_flags_value_is_valid(JSContext   *context,
     }
 
     while (tmpval) {
-        v = g_flags_get_first_value(klass, tmpval);
+        v = g_flags_get_first_value((GFlagsClass *) klass, tmpval);
         if (!v) {
             gjs_throw(context,
                       "0x%x is not a valid value for flags %s",
@@ -614,7 +614,7 @@ gjs_gtypearray_to_array(JSContext   *context,
     unsigned i;
 
     /* add one so we're always zero terminated */
-    result = g_malloc0((length+1) * sizeof(GType));
+    result = (GType *) g_malloc0((length+1) * sizeof(GType));
 
     for (i = 0; i < length; ++i) {
         jsval elem;
@@ -712,7 +712,7 @@ gjs_array_to_ptrarray(JSContext   *context,
     unsigned int i;
 
     /* Always one extra element, to cater for null terminated arrays */
-    void **array = g_malloc((length + 1) * sizeof(gpointer));
+    void **array = (void **) g_malloc((length + 1) * sizeof(gpointer));
     array[length] = NULL;
 
     for (i = 0; i < length; i++) {
@@ -1332,7 +1332,7 @@ gjs_value_to_g_argument(JSContext      *context,
                                                        JSVAL_TO_OBJECT(value));
 
                 if (transfer != GI_TRANSFER_NOTHING)
-                    arg->v_pointer = g_error_copy (arg->v_pointer);
+                    arg->v_pointer = g_error_copy ((const GError *) arg->v_pointer);
             } else {
                 wrong = TRUE;
             }
@@ -1451,7 +1451,7 @@ gjs_value_to_g_argument(JSContext      *context,
                         if (g_type_is_a(gtype, G_TYPE_BOXED))
                             arg->v_pointer = g_boxed_copy (gtype, arg->v_pointer);
                         else if (g_type_is_a(gtype, G_TYPE_VARIANT))
-                            g_variant_ref (arg->v_pointer);
+                            g_variant_ref ((GVariant *) arg->v_pointer);
                         else {
                             gjs_throw(context,
                                       "Can't transfer ownership of a structure type not registered as 
boxed");
@@ -1500,8 +1500,8 @@ gjs_value_to_g_argument(JSContext      *context,
                             arg->v_pointer = gjs_closure_new_marshaled(context,
                                                                        JSVAL_TO_OBJECT(value),
                                                                        "boxed");
-                            g_closure_ref(arg->v_pointer);
-                            g_closure_sink(arg->v_pointer);
+                            g_closure_ref((GClosure *) arg->v_pointer);
+                            g_closure_sink((GClosure *) arg->v_pointer);
                         } else {
                             /* Should have been caught above as STRUCT/BOXED/UNION */
                             gjs_throw(context,
@@ -1732,7 +1732,7 @@ gjs_value_to_g_argument(JSContext      *context,
         } else if (array_type == GI_ARRAY_TYPE_BYTE_ARRAY) {
             GByteArray *byte_array = g_byte_array_sized_new(length);
 
-            g_byte_array_append(byte_array, data, length);
+            g_byte_array_append(byte_array, (const guint8 *) data, length);
             arg->v_pointer = byte_array;
 
             g_free(data);
@@ -2039,7 +2039,7 @@ gjs_array_from_carray_internal (JSContext  *context,
     if (element_type == GI_TYPE_TAG_UINT8) {
         GByteArray gbytearray;
 
-        gbytearray.data = array;
+        gbytearray.data = (guint8 *) array;
         gbytearray.len = length;
         
         obj = gjs_byte_array_from_byte_array (context, &gbytearray);
@@ -2225,8 +2225,8 @@ gjs_array_from_zero_terminated_c_array (JSContext  *context,
     if (element_type == GI_TYPE_TAG_UINT8) {
         GByteArray gbytearray;
 
-        gbytearray.data = c_array;
-        gbytearray.len = strlen(c_array);
+        gbytearray.data = (guint8 *) c_array;
+        gbytearray.len = strlen((const char *) c_array);
 
         obj = gjs_byte_array_from_byte_array (context, &gbytearray);
         if (obj == NULL)
@@ -2246,7 +2246,7 @@ gjs_array_from_zero_terminated_c_array (JSContext  *context,
 
 #define ITERATE(type) \
     do { \
-        g##type *array = c_array; \
+        g##type *array = (g##type *) c_array; \
         for (i = 0; array[i]; i++) { \
             arg.v_##type = array[i]; \
             if (!gjs_value_from_g_argument(context, &elem, param_info, &arg, TRUE)) \
@@ -2477,7 +2477,7 @@ gjs_value_from_g_argument (JSContext  *context,
 
     case GI_TYPE_TAG_FILENAME:
         if (arg->v_pointer)
-            return gjs_string_from_filename(context, arg->v_pointer, -1, value_p);
+            return gjs_string_from_filename(context, (const char *) arg->v_pointer, -1, value_p);
         else {
             /* For NULL we'll return JSVAL_NULL, which is already set
              * in *value_p
@@ -2486,7 +2486,7 @@ gjs_value_from_g_argument (JSContext  *context,
         }
     case GI_TYPE_TAG_UTF8:
         if (arg->v_pointer)
-            return gjs_string_from_utf8(context, arg->v_pointer, -1, value_p);
+            return gjs_string_from_utf8(context, (const char *) arg->v_pointer, -1, value_p);
         else {
             /* For NULL we'll return JSVAL_NULL, which is already set
              * in *value_p
@@ -2497,7 +2497,7 @@ gjs_value_from_g_argument (JSContext  *context,
     case GI_TYPE_TAG_ERROR:
         {
             if (arg->v_pointer) {
-                JSObject *obj = gjs_error_from_gerror(context, arg->v_pointer, FALSE);
+                JSObject *obj = gjs_error_from_gerror(context, (GError *) arg->v_pointer, FALSE);
                 if (obj) {
                     *value_p = OBJECT_TO_JSVAL(obj);
                     return JS_TRUE;
@@ -2572,7 +2572,7 @@ gjs_value_from_g_argument (JSContext  *context,
 
             /* Test GValue and GError before Struct, or it will be handled as the latter */
             if (g_type_is_a(gtype, G_TYPE_VALUE)) {
-                if (!gjs_value_from_g_value(context, &value, arg->v_pointer))
+                if (!gjs_value_from_g_value(context, &value, (const GValue *) arg->v_pointer))
                     value = JSVAL_VOID; /* Make sure error is flagged */
 
                 goto out;
@@ -2580,7 +2580,7 @@ gjs_value_from_g_argument (JSContext  *context,
             if (g_type_is_a(gtype, G_TYPE_ERROR)) {
                 JSObject *obj;
 
-                obj = gjs_error_from_gerror(context, arg->v_pointer, FALSE);
+                obj = gjs_error_from_gerror(context, (GError *) arg->v_pointer, FALSE);
                 if (obj)
                     value = OBJECT_TO_JSVAL(obj);
                 else
@@ -2721,9 +2721,9 @@ gjs_value_from_g_argument (JSContext  *context,
                                            type_tag,
                                            param_info,
                                            type_tag == GI_TYPE_TAG_GLIST ?
-                                           arg->v_pointer : NULL,
+                                           (GList *) arg->v_pointer : NULL,
                                            type_tag == GI_TYPE_TAG_GSLIST ?
-                                           arg->v_pointer : NULL);
+                                           (GSList *) arg->v_pointer : NULL);
 
             g_base_info_unref((GIBaseInfo*) param_info);
 
@@ -2745,7 +2745,7 @@ gjs_value_from_g_argument (JSContext  *context,
                                             value_p,
                                             key_param_info,
                                             val_param_info,
-                                            arg->v_pointer);
+                                            (GHashTable *) arg->v_pointer);
 
             g_base_info_unref((GIBaseInfo*) key_param_info);
             g_base_info_unref((GIBaseInfo*) val_param_info);
@@ -2778,7 +2778,7 @@ typedef struct {
 
 static gboolean
 gjs_ghr_helper(gpointer key, gpointer val, gpointer user_data) {
-    GHR_closure *c = user_data;
+    GHR_closure *c = (GHR_closure *) user_data;
     GArgument key_arg, val_arg;
     key_arg.v_pointer = key;
     val_arg.v_pointer = val;
@@ -2839,7 +2839,7 @@ gjs_g_arg_release_internal(JSContext  *context,
 
     case GI_TYPE_TAG_ERROR:
         if (transfer != TRANSFER_IN_NOTHING)
-            g_error_free (arg->v_pointer);
+            g_error_free ((GError *) arg->v_pointer);
         break;
 
     case GI_TYPE_TAG_INTERFACE:
@@ -2879,19 +2879,19 @@ gjs_g_arg_release_internal(JSContext  *context,
                 if (transfer != TRANSFER_IN_NOTHING)
                     g_object_unref(G_OBJECT(arg->v_pointer));
             } else if (g_type_is_a(gtype, G_TYPE_CLOSURE)) {
-                g_closure_unref(arg->v_pointer);
+                g_closure_unref((GClosure *) arg->v_pointer);
             } else if (g_type_is_a(gtype, G_TYPE_VALUE)) {
                 /* G_TYPE_VALUE is-a G_TYPE_BOXED, but we special case it */
                 if (g_type_info_is_pointer (type_info))
                     g_boxed_free(gtype, arg->v_pointer);
                 else
-                    g_value_unset (arg->v_pointer);
+                    g_value_unset ((GValue *) arg->v_pointer);
             } else if (g_type_is_a(gtype, G_TYPE_BOXED)) {
                 if (transfer != TRANSFER_IN_NOTHING)
                     g_boxed_free(gtype, arg->v_pointer);
             } else if (g_type_is_a(gtype, G_TYPE_VARIANT)) {
                 if (transfer != TRANSFER_IN_NOTHING)
-                    g_variant_unref (arg->v_pointer);
+                    g_variant_unref ((GVariant *) arg->v_pointer);
             } else if (gtype == G_TYPE_NONE) {
                 if (transfer != TRANSFER_IN_NOTHING) {
                     gjs_throw(context, "Don't know how to release GArgument: not an object or boxed type");
@@ -2916,7 +2916,7 @@ gjs_g_arg_release_internal(JSContext  *context,
             param_info = g_type_info_get_param_type(type_info, 0);
             g_assert(param_info != NULL);
 
-            for (list = arg->v_pointer;
+            for (list = (GList *) arg->v_pointer;
                  list != NULL;
                  list = list->next) {
                 GArgument elem;
@@ -2934,7 +2934,7 @@ gjs_g_arg_release_internal(JSContext  *context,
             g_base_info_unref((GIBaseInfo*) param_info);
         }
 
-        g_list_free(arg->v_pointer);
+        g_list_free((GList *) arg->v_pointer);
         break;
 
     case GI_TYPE_TAG_ARRAY:
@@ -2980,7 +2980,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                 if (transfer == GI_TRANSFER_CONTAINER)
                     g_free(arg->v_pointer);
                 else
-                    g_strfreev (arg->v_pointer);
+                    g_strfreev ((gchar **) arg->v_pointer);
                 break;
 
             case GI_TYPE_TAG_UINT8:
@@ -3005,7 +3005,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                         gpointer *array;
                         GArgument elem;
 
-                        for (array = arg->v_pointer; *array; array++) {
+                        for (array = (void **) arg->v_pointer; *array; array++) {
                             elem.v_pointer = *array;
                             if (!gjs_g_arg_release_internal(context,
                                                             GI_TRANSFER_EVERYTHING,
@@ -3076,7 +3076,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                 if (transfer == GI_TRANSFER_CONTAINER) {
                     g_array_free((GArray*) arg->v_pointer, TRUE);
                 } else if (type_needs_out_release (param_info, element_type)) {
-                    GArray *array = arg->v_pointer;
+                    GArray *array = (GArray *) arg->v_pointer;
                     guint i;
 
                     for (i = 0; i < array->len; i++) {
@@ -3110,7 +3110,7 @@ gjs_g_arg_release_internal(JSContext  *context,
             GPtrArray *array;
 
             param_info = g_type_info_get_param_type(type_info, 0);
-            array = arg->v_pointer;
+            array = (GPtrArray *) arg->v_pointer;
 
             if (transfer != GI_TRANSFER_CONTAINER) {
                 guint i;
@@ -3143,7 +3143,7 @@ gjs_g_arg_release_internal(JSContext  *context,
             param_info = g_type_info_get_param_type(type_info, 0);
             g_assert(param_info != NULL);
 
-            for (slist = arg->v_pointer;
+            for (slist = (GSList *) arg->v_pointer;
                  slist != NULL;
                  slist = slist->next) {
                 GArgument elem;
@@ -3161,18 +3161,18 @@ gjs_g_arg_release_internal(JSContext  *context,
             g_base_info_unref((GIBaseInfo*) param_info);
         }
 
-        g_slist_free(arg->v_pointer);
+        g_slist_free((GSList *) arg->v_pointer);
         break;
 
     case GI_TYPE_TAG_GHASH:
         if (arg->v_pointer) {
             if (transfer == GI_TRANSFER_CONTAINER)
-                g_hash_table_steal_all (arg->v_pointer);
+                g_hash_table_steal_all ((GHashTable *) arg->v_pointer);
             else {
                 GHR_closure c = {
-                    .context = context,
-                    .transfer = transfer,
-                    .failed = JS_FALSE
+                    context, NULL, NULL,
+                    transfer,
+                    JS_FALSE
                 };
 
                 c.key_param_info = g_type_info_get_param_type(type_info, 0);
@@ -3180,7 +3180,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                 c.val_param_info = g_type_info_get_param_type(type_info, 1);
                 g_assert(c.val_param_info != NULL);
 
-                g_hash_table_foreach_steal (arg->v_pointer,
+                g_hash_table_foreach_steal ((GHashTable *) arg->v_pointer,
                                             gjs_ghr_helper, &c);
 
                 failed = c.failed;
@@ -3189,7 +3189,7 @@ gjs_g_arg_release_internal(JSContext  *context,
                 g_base_info_unref ((GIBaseInfo *)c.val_param_info);
             }
 
-            g_hash_table_destroy (arg->v_pointer);
+            g_hash_table_destroy ((GHashTable *) arg->v_pointer);
         }
         break;
 
@@ -3246,7 +3246,7 @@ gjs_g_argument_release_in_arg(JSContext  *context,
                       g_type_tag_to_string(type_tag));
 
     if (type_needs_release (type_info, type_tag))
-        return gjs_g_arg_release_internal(context, TRANSFER_IN_NOTHING,
+        return gjs_g_arg_release_internal(context, (GITransfer) TRANSFER_IN_NOTHING,
                                           type_info, type_tag, arg);
 
     return JS_TRUE;
@@ -3272,7 +3272,7 @@ gjs_g_argument_release_in_array (JSContext  *context,
     gjs_debug_marshal(GJS_DEBUG_GFUNCTION,
                       "Releasing GArgument array in param");
 
-    array = arg->v_pointer;
+    array = (gpointer *) arg->v_pointer;
 
     param_type = g_type_info_get_param_type(type_info, 0);
     type_tag = g_type_info_get_tag(param_type);
@@ -3287,7 +3287,7 @@ gjs_g_argument_release_in_array (JSContext  *context,
     if (type_needs_release(param_type, type_tag)) {
         for (i = 0; i < length; i++) {
             elem.v_pointer = array[i];
-            if (!gjs_g_arg_release_internal(context, TRANSFER_IN_NOTHING,
+            if (!gjs_g_arg_release_internal(context, (GITransfer) TRANSFER_IN_NOTHING,
                                             param_type, type_tag, &elem)) {
                 ret = JS_FALSE;
                 break;
@@ -3321,7 +3321,7 @@ gjs_g_argument_release_out_array (JSContext  *context,
     gjs_debug_marshal(GJS_DEBUG_GFUNCTION,
                       "Releasing GArgument array out param");
 
-    array = arg->v_pointer;
+    array = (gpointer *) arg->v_pointer;
 
     param_type = g_type_info_get_param_type(type_info, 0);
     type_tag = g_type_info_get_tag(param_type);
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 2e9ad5a..8598520 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -296,7 +296,7 @@ boxed_init_from_props(JSContext   *context,
         if (!gjs_get_string_id(context, prop_id, &name))
             goto out;
 
-        field_info = g_hash_table_lookup(field_map, name);
+        field_info = (GIFieldInfo *) g_hash_table_lookup(field_map, name);
         if (field_info == NULL) {
             gjs_throw(context, "No field %s on boxed type %s",
                       name, g_base_info_get_name((GIBaseInfo *)priv->info));
@@ -513,7 +513,7 @@ boxed_finalize(JSFreeOp *fop,
 {
     Boxed *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Boxed *) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GBOXED,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
@@ -526,7 +526,7 @@ boxed_finalize(JSFreeOp *fop,
             if (g_type_is_a (priv->gtype, G_TYPE_BOXED))
                 g_boxed_free (priv->gtype,  priv->gboxed);
             else if (g_type_is_a (priv->gtype, G_TYPE_VARIANT))
-                g_variant_unref (priv->gboxed);
+                g_variant_unref ((GVariant *) priv->gboxed);
             else
                 g_assert_not_reached ();
         }
@@ -1238,7 +1238,7 @@ gjs_boxed_from_c_struct(JSContext             *context,
         if (priv->gtype != G_TYPE_NONE && g_type_is_a (priv->gtype, G_TYPE_BOXED)) {
             priv->gboxed = g_boxed_copy(priv->gtype, gboxed);
         } else if (priv->gtype == G_TYPE_VARIANT) {
-            priv->gboxed = g_variant_ref_sink (gboxed);
+            priv->gboxed = g_variant_ref_sink ((GVariant *) gboxed);
         } else if (priv->can_allocate_directly) {
             boxed_new_direct(priv);
             memcpy(priv->gboxed, gboxed, g_struct_info_get_size (priv->info));
diff --git a/gi/closure.cpp b/gi/closure.cpp
index 2784a0f..b03882b 100644
--- a/gi/closure.cpp
+++ b/gi/closure.cpp
@@ -98,7 +98,7 @@ global_context_finalized(JSObject *obj,
     Closure *c;
     gboolean need_unref;
 
-    c = data;
+    c = (Closure *) data;
 
     gjs_debug_closure("Context global object destroy notifier on closure %p "
                       "which calls object %p",
diff --git a/gi/foreign.cpp b/gi/foreign.cpp
index a81cf18..efbadfd 100644
--- a/gi/foreign.cpp
+++ b/gi/foreign.cpp
@@ -36,7 +36,7 @@ static struct {
     char *module; // relative to "imports."
     gboolean loaded;
 } foreign_modules[] = {
-    { "cairo", "cairo", FALSE },
+    { (char*)"cairo", (char*)"cairo", FALSE },
     { NULL }
 };
 
@@ -76,7 +76,7 @@ gjs_foreign_load_foreign_module(JSContext *context,
         // FIXME: Find a way to check if a module is imported
         //        and only execute this statement if isn't
         script = g_strdup_printf("imports.%s;", gi_namespace);
-        if (!gjs_context_eval(JS_GetContextPrivate(context), script, strlen(script),
+        if (!gjs_context_eval((GjsContext*) JS_GetContextPrivate(context), script, strlen(script),
                               "<internal>", &code,
                               &error)) {
             g_printerr("ERROR: %s\n", error->message);
diff --git a/gi/function.cpp b/gi/function.cpp
index 93815f7..e2e731f 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -177,7 +177,7 @@ gjs_callback_closure(ffi_cif *cif,
     gboolean success = FALSE;
     gboolean ret_type_is_void;
 
-    trampoline = data;
+    trampoline = (GjsCallbackTrampoline *) data;
     g_assert(trampoline);
     gjs_callback_trampoline_ref(trampoline);
 
@@ -225,11 +225,11 @@ gjs_callback_closure(ffi_cif *cif,
                 g_arg_info_load_type(&array_length_arg, &arg_type_info);
                 if (!gjs_value_from_g_argument(context, &length,
                                                &arg_type_info,
-                                               args[array_length_pos], TRUE))
+                                               (GArgument *) args[array_length_pos], TRUE))
                     goto out;
 
                 if (!gjs_value_from_explicit_array(context, &jsargs[n_jsargs++],
-                                                   &type_info, args[i], JSVAL_TO_INT(length)))
+                                                   &type_info, (GArgument*) args[i], JSVAL_TO_INT(length)))
                     goto out;
                 break;
             }
@@ -237,7 +237,7 @@ gjs_callback_closure(ffi_cif *cif,
                 if (!gjs_value_from_g_argument(context,
                                                &jsargs[n_jsargs++],
                                                &type_info,
-                                               args[i], FALSE))
+                                               (GArgument *) args[i], FALSE))
                     goto out;
                 break;
             default:
@@ -302,7 +302,7 @@ gjs_callback_closure(ffi_cif *cif,
                                          GJS_ARGUMENT_ARGUMENT,
                                          GI_TRANSFER_NOTHING,
                                          TRUE,
-                                         *(gpointer *)args[i]))
+                                         *(GArgument **)args[i]))
                 goto out;
 
             break;
@@ -354,7 +354,7 @@ gjs_callback_closure(ffi_cif *cif,
                                          GJS_ARGUMENT_ARGUMENT,
                                          GI_TRANSFER_NOTHING,
                                          TRUE,
-                                         *(gpointer *)args[i]))
+                                         *(GArgument **)args[i]))
                 goto out;
 
             elem_idx++;
@@ -369,7 +369,7 @@ out:
 
         /* Fill in the result with some hopefully neutral value */
         g_callable_info_load_return_type(trampoline->info, &ret_type);
-        gjs_g_argument_init_default (context, &ret_type, result);
+        gjs_g_argument_init_default (context, &ret_type, (GArgument *) result);
     }
 
     if (trampoline->scope == GI_SCOPE_TYPE_ASYNC) {
@@ -386,7 +386,7 @@ out:
 static void
 gjs_destroy_notify_callback(gpointer data)
 {
-    GjsCallbackTrampoline *trampoline = data;
+    GjsCallbackTrampoline *trampoline = (GjsCallbackTrampoline *) data;
 
     g_assert(trampoline);
     gjs_callback_trampoline_unref(trampoline);
@@ -612,7 +612,7 @@ gjs_invoke_c_function(JSContext      *context,
      */
     if (completed_trampolines) {
         for (iter = completed_trampolines; iter; iter = iter->next) {
-            GjsCallbackTrampoline *trampoline = iter->data;
+            GjsCallbackTrampoline *trampoline = (GjsCallbackTrampoline *) iter->data;
             gjs_callback_trampoline_unref(trampoline);
         }
         g_slist_free(completed_trampolines);
@@ -776,7 +776,7 @@ gjs_invoke_c_function(JSContext      *context,
                 if (destroy_pos >= 0) {
                     gint c_pos = is_method ? destroy_pos + 1 : destroy_pos;
                     g_assert (function->param_types[destroy_pos] == PARAM_SKIPPED);
-                    in_arg_cvalues[c_pos].v_pointer = trampoline ? gjs_destroy_notify_callback : NULL;
+                    in_arg_cvalues[c_pos].v_pointer = trampoline ? (gpointer) gjs_destroy_notify_callback : 
NULL;
                 }
                 if (closure_pos >= 0) {
                     gint c_pos = is_method ? closure_pos + 1 : closure_pos;
@@ -891,7 +891,7 @@ gjs_invoke_c_function(JSContext      *context,
         return_value_p = &return_value.v_uint64;
     else
         return_value_p = &return_value.v_long;
-    ffi_call(&(function->invoker.cif), function->invoker.native_address, return_value_p, ffi_arg_pointers);
+    ffi_call(&(function->invoker.cif), FFI_FN(function->invoker.native_address), return_value_p, 
ffi_arg_pointers);
 
     /* Return value and out arguments are valid only if invocation doesn't
      * return error. In arguments need to be released always.
@@ -999,9 +999,9 @@ release:
                 transfer = GI_TRANSFER_NOTHING;
             }
             if (param_type == PARAM_CALLBACK) {
-                ffi_closure *closure = arg->v_pointer;
+                ffi_closure *closure = (ffi_closure *) arg->v_pointer;
                 if (closure) {
-                    GjsCallbackTrampoline *trampoline = closure->user_data;
+                    GjsCallbackTrampoline *trampoline = (GjsCallbackTrampoline *) closure->user_data;
                     /* CallbackTrampolines are refcounted because for notified/async closures
                        it is possible to destroy it while in call, and therefore we cannot check
                        its scope at this point */
@@ -1229,7 +1229,7 @@ function_finalize(JSFreeOp *fop,
 {
     Function *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Function *) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GFUNCTION,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
@@ -1298,7 +1298,7 @@ function_to_string (JSContext *context,
 
     priv = priv_from_js (context, self);
     if (priv == NULL) {
-        string = "function () {\n}";
+        string = (gchar *) "function () {\n}";
         free = FALSE;
         goto out;
     }
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index 178c8df..eb6fa1c 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -135,7 +135,7 @@ error_finalize(JSFreeOp *fop,
 {
     Error *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Error*) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GERROR,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
@@ -371,7 +371,7 @@ gjs_define_error_class(JSContext    *context,
 
     constructor_name = g_base_info_get_name( (GIBaseInfo*) info);
 
-    g_irepository_require(NULL, "GLib", "2.0", 0, NULL);
+    g_irepository_require(NULL, "GLib", "2.0", (GIRepositoryLoadFlags) 0, NULL);
     glib_error_info = (GIBoxedInfo*) g_irepository_find_by_name(NULL, "GLib", "Error");
     parent_proto = gjs_lookup_generic_prototype(context, glib_error_info);
     g_base_info_unref((GIBaseInfo*)glib_error_info);
@@ -421,16 +421,16 @@ find_error_domain_info(GQuark domain)
         return info;
 
     /* load standard stuff */
-    g_irepository_require(NULL, "GLib", "2.0", 0, NULL);
-    g_irepository_require(NULL, "GObject", "2.0", 0, NULL);
-    g_irepository_require(NULL, "Gio", "2.0", 0, NULL);
+    g_irepository_require(NULL, "GLib", "2.0", (GIRepositoryLoadFlags) 0, NULL);
+    g_irepository_require(NULL, "GObject", "2.0", (GIRepositoryLoadFlags) 0, NULL);
+    g_irepository_require(NULL, "Gio", "2.0", (GIRepositoryLoadFlags) 0, NULL);
     info = g_irepository_find_by_error_domain(NULL, domain);
     if (info)
         return info;
 
     /* last attempt: load GIRepository (for invoke errors, rarely
        needed) */
-    g_irepository_require(NULL, "GIRepository", "1.0", 0, NULL);
+    g_irepository_require(NULL, "GIRepository", "1.0", (GIRepositoryLoadFlags) 0, NULL);
     info = g_irepository_find_by_error_domain(NULL, domain);
 
     return info;
@@ -492,7 +492,7 @@ gjs_error_from_gerror(JSContext             *context,
         JSObject *retval;
 
         glib_boxed = g_irepository_find_by_name(NULL, "GLib", "Error");
-        retval = gjs_boxed_from_c_struct(context, glib_boxed, gerror, 0);
+        retval = gjs_boxed_from_c_struct(context, glib_boxed, gerror, (GjsBoxedCreationFlags) 0);
 
         g_base_info_unref(glib_boxed);
         return retval;
@@ -536,7 +536,7 @@ gjs_gerror_from_error(JSContext    *context,
        delegate marshalling.
     */
     if (gjs_typecheck_boxed (context, obj, NULL, G_TYPE_ERROR, JS_FALSE))
-        return gjs_c_struct_from_boxed (context, obj);
+        return (GError*) gjs_c_struct_from_boxed (context, obj);
 
     priv = priv_from_js(context, obj);
 
diff --git a/gi/gtype.cpp b/gi/gtype.cpp
index 11fa385..a13b4f4 100644
--- a/gi/gtype.cpp
+++ b/gi/gtype.cpp
@@ -129,7 +129,7 @@ gjs_gtype_create_gtype_wrapper (JSContext *context,
     global = gjs_get_import_global(context);
     gjs_gtype_create_proto(context, global, "GIRepositoryGType", NULL);
 
-    object = g_type_get_qdata(gtype, gjs_get_gtype_wrapper_quark());
+    object = (JSObject*) g_type_get_qdata(gtype, gjs_get_gtype_wrapper_quark());
     if (object != NULL)
         goto out;
 
diff --git a/gi/interface.cpp b/gi/interface.cpp
index 1241c84..2766304 100644
--- a/gi/interface.cpp
+++ b/gi/interface.cpp
@@ -52,7 +52,7 @@ interface_finalize(JSFreeOp *fop,
 {
     Interface *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Interface*) JS_GetPrivate(obj);
 
     if (priv == NULL)
         return;
diff --git a/gi/keep-alive.cpp b/gi/keep-alive.cpp
index 0f5d3fa..e63337b 100644
--- a/gi/keep-alive.cpp
+++ b/gi/keep-alive.cpp
@@ -51,7 +51,7 @@ GJS_DEFINE_PRIV_FROM_JS(KeepAlive, gjs_keep_alive_class)
 static guint
 child_hash(gconstpointer  v)
 {
-    const Child *child = v;
+    const Child *child = (const Child *) v;
 
     return
         GPOINTER_TO_UINT(child->notify) ^
@@ -63,8 +63,8 @@ static gboolean
 child_equal (gconstpointer  v1,
              gconstpointer  v2)
 {
-    const Child *child1 = v1;
-    const Child *child2 = v2;
+    const Child *child1 = (const Child *) v1;
+    const Child *child2 = (const Child *) v2;
 
     /* notify is most likely to be equal, so check it last */
     return child1->data == child2->data &&
@@ -75,7 +75,7 @@ child_equal (gconstpointer  v1,
 static void
 child_free(void *data)
 {
-    Child *child = data;
+    Child *child = (Child *) data;
     g_slice_free(Child, child);
 }
 
@@ -89,7 +89,7 @@ keep_alive_finalize(JSFreeOp *fop,
     void *key;
     void *value;
 
-    priv = JS_GetPrivate(obj);
+    priv = (KeepAlive *) JS_GetPrivate(obj);
 
     gjs_debug_lifecycle(GJS_DEBUG_KEEP_ALIVE,
                         "keep_alive finalizing, obj %p priv %p", obj, priv);
@@ -101,7 +101,7 @@ keep_alive_finalize(JSFreeOp *fop,
 
     while (gjs_g_hash_table_steal_one(priv->children,
                                       &key, &value)) {
-        Child *child = value;
+        Child *child = (Child *) value;
         if (child->notify)
             (* child->notify) (child->child, child->data);
 
@@ -117,8 +117,8 @@ trace_foreach(void *key,
               void *value,
               void *data)
 {
-    Child *child = value;
-    JSTracer *tracer = data;
+    Child *child = (Child *) value;
+    JSTracer *tracer = (JSTracer *) data;
 
     if (child->child != NULL) {
         jsval val;
@@ -134,7 +134,7 @@ keep_alive_trace(JSTracer *tracer,
 {
     KeepAlive *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (KeepAlive *) JS_GetPrivate(obj);
 
     if (priv == NULL) /* prototype */
         return;
diff --git a/gi/ns.cpp b/gi/ns.cpp
index b23907a..64385dd 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -134,7 +134,7 @@ ns_finalize(JSFreeOp *fop,
 {
     Ns *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Ns *)JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GNAMESPACE,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
@@ -236,7 +236,7 @@ ns_new(JSContext    *context,
     gjs_debug_lifecycle(GJS_DEBUG_GNAMESPACE, "ns constructor, obj %p priv %p", ns, priv);
 
     priv = priv_from_js(context, ns);
-    priv->repo = g_object_ref(repo);
+    priv->repo = (GIRepository*) g_object_ref(repo);
     priv->gi_namespace = g_strdup(ns_name);
 
     return ns;
diff --git a/gi/object.cpp b/gi/object.cpp
index 3eed09c..fc06471 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -730,7 +730,7 @@ object_instance_props_to_g_parameters(JSContext   *context,
     if (n_gparams_p)
         *n_gparams_p = gparams->len;
     if (gparams_p)
-        *gparams_p = (void*) g_array_free(gparams, FALSE);
+        *gparams_p = (GParameter*) g_array_free(gparams, FALSE);
 
     return JS_TRUE;
 
@@ -739,7 +739,7 @@ object_instance_props_to_g_parameters(JSContext   *context,
         GParameter *to_free;
         int count;
         count = gparams->len;
-        to_free = (void*) g_array_free(gparams, FALSE);
+        to_free = (GParameter*) g_array_free(gparams, FALSE);
         free_g_params(to_free, count);
     }
     return JS_FALSE;
@@ -761,7 +761,7 @@ gobj_no_longer_kept_alive_func(JSObject *obj,
 {
     ObjectInstance *priv;
 
-    priv = data;
+    priv = (ObjectInstance *) data;
 
     gjs_debug_lifecycle(GJS_DEBUG_GOBJECT,
                         "GObject wrapper %p will no longer be kept alive, eligible for collection",
@@ -820,7 +820,7 @@ cancel_toggle_idle(GObject         *gobj,
 
     qdata_key = get_qdata_key_for_toggle_direction(direction);
 
-    source = g_object_steal_qdata(gobj, qdata_key);
+    source = (GSource*) g_object_steal_qdata(gobj, qdata_key);
 
     if (source)
         g_source_destroy(source);
@@ -910,7 +910,7 @@ out:
 static gboolean
 idle_handle_toggle(gpointer data)
 {
-    ToggleRefNotifyOperation *operation = data;
+    ToggleRefNotifyOperation *operation = (ToggleRefNotifyOperation *) data;
 
     if (!clear_toggle_idle_source(operation->gobj, operation->direction)) {
         /* Already cleared, the JSObject is going away, abort mission */
@@ -961,7 +961,7 @@ queue_toggle_idle(GObject         *gobj,
              * only ever have at most two toggle notifications queued.
              * (either only up, or down-up)
              */
-            operation->gobj = g_object_ref(gobj);
+            operation->gobj = (GObject*) g_object_ref(gobj);
             operation->needs_unref = TRUE;
             break;
         case TOGGLE_DOWN:
@@ -1006,7 +1006,7 @@ wrapped_gobj_toggle_notify(gpointer      data,
     gboolean gc_blocked = FALSE;
     gboolean toggle_up_queued, toggle_down_queued;
 
-    runtime = data;
+    runtime = (JSRuntime*) data;
 
     /* During teardown, this can return NULL if runtime is being destroyed.
      * In that case we effectively already converted to a weak ref without
@@ -1187,7 +1187,7 @@ object_instance_init (JSContext *context,
     if (g_type_get_qdata(gtype, gjs_is_custom_type_quark()))
         object_init_list = g_slist_prepend(object_init_list, *object);
 
-    gobj = g_object_newv(gtype, n_params, params);
+    gobj = (GObject*) g_object_newv(gtype, n_params, params);
 
     free_g_params(params, n_params);
 
@@ -1278,7 +1278,7 @@ invalidate_all_signals(ObjectInstance *priv)
     GList *iter, *next;
 
     for (iter = priv->signals; iter; ) {
-        ConnectData *cd = iter->data;
+        ConnectData *cd = (ConnectData*) iter->data;
         next = iter->next;
 
         /* This will also free cd and iter, through
@@ -1296,10 +1296,10 @@ object_instance_trace(JSTracer *tracer,
     ObjectInstance *priv;
     GList *iter;
 
-    priv = JS_GetPrivate(obj);
+    priv = (ObjectInstance *) JS_GetPrivate(obj);
 
     for (iter = priv->signals; iter; iter = iter->next) {
-        ConnectData *cd = iter->data;
+        ConnectData *cd = (ConnectData *) iter->data;
 
         gjs_closure_trace(cd->closure, tracer);
     }
@@ -1311,7 +1311,7 @@ object_instance_finalize(JSFreeOp  *fop,
 {
     ObjectInstance *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (ObjectInstance *) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GOBJECT,
                         "finalize obj %p priv %p gtype %s gobj %p", obj, priv,
                         (priv && priv->gobj) ?
@@ -1454,7 +1454,7 @@ static void
 signal_connection_invalidated (gpointer  user_data,
                                GClosure *closure)
 {
-    ConnectData *connect_data = user_data;
+    ConnectData *connect_data = (ConnectData *) user_data;
 
     connect_data->obj->signals = g_list_delete_link(connect_data->obj->signals,
                                                     connect_data->link);
@@ -1956,7 +1956,7 @@ gjs_define_object_class(JSContext      *context,
     if (info)
         g_base_info_ref((GIBaseInfo*) info);
     priv->gtype = gtype;
-    priv->klass = g_type_class_ref (gtype);
+    priv->klass = (GTypeClass*) g_type_class_ref (gtype);
     JS_SetPrivate(prototype, priv);
 
     gjs_debug(GJS_DEBUG_GOBJECT, "Defined class %s prototype %p class %p in object %p",
@@ -1976,7 +1976,7 @@ gjs_define_object_class(JSContext      *context,
 static JSObject*
 peek_js_obj(GObject *gobj)
 {
-    return g_object_get_qdata(gobj, gjs_object_priv_quark());
+    return (JSObject*) g_object_get_qdata(gobj, gjs_object_priv_quark());
 }
 
 static void
@@ -2135,7 +2135,7 @@ find_vfunc_info (JSContext *context,
     implementor_class = g_type_class_ref(implementor_gtype);
     if (is_interface) {
         GTypeInstance *implementor_iface_class;
-        implementor_iface_class = g_type_interface_peek(implementor_class,
+        implementor_iface_class = (GTypeInstance*) g_type_interface_peek(implementor_class,
                                                         ancestor_gtype);
         if (implementor_iface_class == NULL) {
             g_type_class_unref(implementor_class);
@@ -2318,7 +2318,7 @@ gjs_object_get_gproperty (GObject    *object,
     gchar *underscore_name;
 
     gjs_context = gjs_context_get_current();
-    context = gjs_context_get_native_context(gjs_context);
+    context = (JSContext*) gjs_context_get_native_context(gjs_context);
 
     js_obj = peek_js_obj(object);
 
@@ -2343,7 +2343,7 @@ gjs_object_set_gproperty (GObject      *object,
     gchar *underscore_name;
 
     gjs_context = gjs_context_get_current();
-    context = gjs_context_get_native_context(gjs_context);
+    context = (JSContext*) gjs_context_get_native_context(gjs_context);
 
     js_obj = peek_js_obj(object);
 
@@ -2370,10 +2370,10 @@ gjs_object_class_init(GObjectClass *g_class,
 
     gjs_eval_thread = g_thread_self();
 
-    properties = gjs_hash_table_for_gsize_lookup (class_init_properties, gtype);
+    properties = (GPtrArray*) gjs_hash_table_for_gsize_lookup (class_init_properties, gtype);
     if (properties != NULL) {
         for (i = 0; i < properties->len; i++) {
-            GParamSpec *pspec = properties->pdata[i];
+            GParamSpec *pspec = (GParamSpec*) properties->pdata[i];
             g_param_spec_set_qdata(pspec, gjs_is_custom_property_quark(), GINT_TO_POINTER(1));
             g_object_class_install_property (g_class, i+1, pspec);
         }
@@ -2391,8 +2391,8 @@ gjs_object_custom_init(GTypeInstance *instance,
     JSObject *object;
     ObjectInstance *priv;
 
-    object = object_init_list->data;
-    priv = JS_GetPrivate(object);
+    object = (JSObject*) object_init_list->data;
+    priv = (ObjectInstance*) JS_GetPrivate(object);
 
     if (priv->gtype != G_TYPE_FROM_INSTANCE (instance)) {
         /* This is not the most derived instance_init function,
@@ -2405,7 +2405,7 @@ gjs_object_custom_init(GTypeInstance *instance,
                                            object_init_list);
 
     gjs_context = gjs_context_get_current();
-    context = gjs_context_get_native_context(gjs_context);
+    context = (JSContext*) gjs_context_get_native_context(gjs_context);
 
     associate_js_gobject(context, object, G_OBJECT (instance));
 }
@@ -2484,7 +2484,7 @@ gjs_register_type(JSContext *cx,
     if (!JS_GetArrayLength(cx, properties, &n_properties))
         goto out;
 
-    iface_types = g_alloca(sizeof(GType) * n_interfaces);
+    iface_types = (GType*) g_alloca(sizeof(GType) * n_interfaces);
 
     /* We do interface addition in two passes so that any failure
        is caught early, before registering the GType (which we can't undo) */
@@ -2531,7 +2531,7 @@ gjs_register_type(JSContext *cx,
                                                 parent_type,
                                                 name,
                                                 &type_info,
-                                                0);
+                                                (GTypeFlags) 0);
 
     g_free(name);
 
@@ -2647,7 +2647,7 @@ gjs_signal_new(JSContext *cx,
 
     signal_id = g_signal_newv(signal_name,
                               gtype,
-                              JSVAL_TO_INT(argv[2]), /* signal_flags */
+                              (GSignalFlags) JSVAL_TO_INT(argv[2]), /* signal_flags */
                               NULL, /* class closure */
                               accumulator,
                               NULL, /* accu_data */
diff --git a/gi/param.cpp b/gi/param.cpp
index 9cea73e..18b95b9 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -164,7 +164,7 @@ param_finalize(JSFreeOp *fop,
 {
     Param *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Param*) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GPARAM,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 0fc020f..17f60fd 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -108,7 +108,7 @@ resolve_namespace_object(JSContext  *context,
     repo = g_irepository_get_default();
 
     error = NULL;
-    g_irepository_require(repo, ns_name, version, 0, &error);
+    g_irepository_require(repo, ns_name, version, (GIRepositoryLoadFlags) 0, &error);
     if (error != NULL) {
         gjs_throw(context,
                   "Requiring %s, version %s: %s",
@@ -216,7 +216,7 @@ repo_finalize(JSFreeOp *fop,
 {
     Repo *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Repo*) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GREPO,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
diff --git a/gi/union.cpp b/gi/union.cpp
index 7a1cf8e..31550cd 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -259,7 +259,7 @@ union_finalize(JSFreeOp *fop,
 {
     Union *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Union*) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_GBOXED,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
diff --git a/gi/value.cpp b/gi/value.cpp
index 2cfec25..4f2426f 100644
--- a/gi/value.cpp
+++ b/gi/value.cpp
@@ -386,7 +386,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                                         length, &result))
                     return JS_FALSE;
                 /* cast to strv in a separate step to avoid type-punning */
-                strv = result;
+                strv = (char**) result;
                 g_value_take_boxed (gvalue, strv);
             }
         } else {
@@ -454,7 +454,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
                                      NULL, G_TYPE_VARIANT, JS_TRUE))
                 return JS_FALSE;
 
-            variant = gjs_c_struct_from_boxed(context, obj);
+            variant = (GVariant*) gjs_c_struct_from_boxed(context, obj);
         } else {
             gjs_throw(context,
                       "Wrong type %s; boxed type %s expected",
@@ -528,7 +528,7 @@ gjs_value_to_g_value_internal(JSContext    *context,
             return JS_FALSE;
         }
 
-        g_value_set_param(gvalue, gparam);
+        g_value_set_param(gvalue, (GParamSpec*) gparam);
     } else if (g_type_is_a(gtype, G_TYPE_GTYPE)) {
         GType type;
 
@@ -687,14 +687,14 @@ gjs_value_from_g_value_internal(JSContext    *context,
         GObject *gobj;
         JSObject *obj;
 
-        gobj = g_value_get_object(gvalue);
+        gobj = (GObject*) g_value_get_object(gvalue);
 
         obj = gjs_object_from_g_object(context, gobj);
         *value_p = OBJECT_TO_JSVAL(obj);
     } else if (gtype == G_TYPE_STRV) {
         if (!gjs_array_from_strv (context,
                                   value_p,
-                                  g_value_get_boxed (gvalue))) {
+                                  (const char**) g_value_get_boxed (gvalue))) {
             gjs_throw(context, "Failed to convert strv to array");
             return JS_FALSE;
         }
@@ -720,7 +720,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
 
         /* special case GError */
         if (g_type_is_a(gtype, G_TYPE_ERROR)) {
-            obj = gjs_error_from_gerror(context, gboxed, FALSE);
+            obj = gjs_error_from_gerror(context, (GError*) gboxed, FALSE);
             *value_p = OBJECT_TO_JSVAL(obj);
 
             return TRUE;
@@ -751,7 +751,7 @@ gjs_value_from_g_value_internal(JSContext    *context,
         case GI_INFO_TYPE_BOXED:
         case GI_INFO_TYPE_STRUCT:
             if (no_copy)
-                boxed_flags |= GJS_BOXED_CREATION_NO_COPY;
+                boxed_flags = (GjsBoxedCreationFlags) (boxed_flags | GJS_BOXED_CREATION_NO_COPY);
             obj = gjs_boxed_from_c_struct(context, (GIStructInfo *)info, gboxed, boxed_flags);
             break;
         case GI_INFO_TYPE_UNION:
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index d449530..f7648ab 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -397,7 +397,7 @@ byte_array_finalize(JSFreeOp *fop,
 {
     ByteArrayInstance *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (ByteArrayInstance*) JS_GetPrivate(obj);
 
     if (priv == NULL)
         return; /* prototype, not instance */
@@ -454,7 +454,7 @@ to_string_func(JSContext *context,
 
     if (priv->array->len == 0)
         /* the internal data pointer could be NULL in this case */
-        data = "";
+        data = (gchar*)"";
     else
         data = (gchar*)priv->array->data;
 
@@ -744,7 +744,7 @@ from_gbytes_func(JSContext *context,
     if (!gjs_typecheck_boxed(context, bytes_obj, NULL, G_TYPE_BYTES, TRUE))
         return JS_FALSE;
 
-    gbytes = gjs_c_struct_from_boxed(context, bytes_obj);
+    gbytes = (GBytes*) gjs_c_struct_from_boxed(context, bytes_obj);
 
     obj = byte_array_new(context);
     if (obj == NULL)
@@ -801,7 +801,7 @@ gjs_byte_array_from_byte_array (JSContext *context,
     g_assert(priv_from_js(context, object) == NULL);
     JS_SetPrivate(object, priv);
     priv->array = g_byte_array_new();
-    priv->array->data = g_memdup(array->data, array->len);
+    priv->array->data = (guint8*) g_memdup(array->data, array->len);
     priv->array->len = array->len;
 
     return object;
diff --git a/gjs/console.cpp b/gjs/console.cpp
index 4593d7e..f8ccb93 100644
--- a/gjs/console.cpp
+++ b/gjs/console.cpp
@@ -120,13 +120,13 @@ main(int argc, char **argv)
     if (js_version != NULL)
         source_js_version = js_version;
     if (source_js_version != NULL)
-        js_context = g_object_new(GJS_TYPE_CONTEXT,
+        js_context = (GjsContext*) g_object_new(GJS_TYPE_CONTEXT,
                                   "search-path", include_path,
                                   "js-version", source_js_version,
                                   "program-name", program_name,
                                   NULL);
     else
-        js_context = g_object_new(GJS_TYPE_CONTEXT,
+        js_context = (GjsContext*) g_object_new(GJS_TYPE_CONTEXT,
                                   "search-path", include_path,
                                   "program-name", program_name,
                                   NULL);
diff --git a/gjs/context.cpp b/gjs/context.cpp
index cb2fe1b..7d19581 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -303,7 +303,7 @@ gjs_context_class_init(GjsContextClass *klass)
                                "Search path",
                                "Path where modules to import should reside",
                                G_TYPE_STRV,
-                               G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
+                               (GParamFlags) (G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
 
     g_object_class_install_property(object_class,
                                     PROP_SEARCH_PATH,
@@ -313,7 +313,7 @@ gjs_context_class_init(GjsContextClass *klass)
                                  "JS Version",
                                  "A string giving the default for the (SpiderMonkey) JavaScript version",
                                  _GJS_JS_VERSION_DEFAULT,
-                                 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+                                 (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
     g_object_class_install_property(object_class,
                                     PROP_JS_VERSION,
@@ -323,7 +323,7 @@ gjs_context_class_init(GjsContextClass *klass)
                                  "",
                                  "Whether or not to emit the \"gc\" signal",
                                  FALSE,
-                                 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+                                 (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
     g_object_class_install_property(object_class,
                                     PROP_GC_NOTIFICATIONS,
@@ -333,7 +333,7 @@ gjs_context_class_init(GjsContextClass *klass)
                                 "Program Name",
                                 "The filename of the launched JS program",
                                 "",
-                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+                                (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
     g_object_class_install_property(object_class,
                                     PROP_PROGRAM_NAME,
@@ -351,7 +351,7 @@ gjs_context_class_init(GjsContextClass *klass)
     {
         char *priv_typelib_dir = g_build_filename (PKGLIBDIR, "girepository-1.0", NULL);
         g_irepository_prepend_search_path(priv_typelib_dir);
-        g_free (priv_typelib_dir);
+    g_free (priv_typelib_dir);
     }
 
     gjs_register_native_module("byteArray", gjs_define_byte_array_stuff);
@@ -727,7 +727,7 @@ gjs_context_set_property (GObject      *object,
 
     switch (prop_id) {
     case PROP_SEARCH_PATH:
-        js_context->search_path = g_value_dup_boxed(value);
+        js_context->search_path = (char**) g_value_dup_boxed(value);
         break;
     case PROP_JS_VERSION:
         g_free(js_context->jsversion_string);
@@ -841,13 +841,13 @@ gjs_context_scan_file_for_js_version (const char *file_path)
 GjsContext*
 gjs_context_new(void)
 {
-    return g_object_new (GJS_TYPE_CONTEXT, NULL);
+    return (GjsContext*) g_object_new (GJS_TYPE_CONTEXT, NULL);
 }
 
 GjsContext*
 gjs_context_new_with_search_path(char** search_path)
 {
-    return g_object_new (GJS_TYPE_CONTEXT,
+    return (GjsContext*) g_object_new (GJS_TYPE_CONTEXT,
                          "search-path", search_path,
                          NULL);
 }
@@ -895,7 +895,7 @@ gjs_context_gc (GjsContext  *context)
 static gboolean
 gjs_context_idle_emit_gc (gpointer data)
 {
-    GjsContext *gjs_context = data;
+    GjsContext *gjs_context = (GjsContext*) data;
 
     g_mutex_lock(&gc_idle_lock);
     gjs_context->idle_emit_gc_id = 0;
@@ -911,7 +911,7 @@ gjs_on_context_gc (JSRuntime *rt,
                    JSGCStatus status)
 {
     JSContext *context = gjs_runtime_get_context(rt);
-    GjsContext *gjs_context = JS_GetContextPrivate(context);
+    GjsContext *gjs_context = (GjsContext*) JS_GetContextPrivate(context);
 
     switch (status) {
         case JSGC_BEGIN:
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index c306f46..b073c5c 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -552,7 +552,7 @@ do_import(JSContext  *context,
                                      NULL);
         gfile = g_file_new_for_commandline_arg(full_path);
 
-        if (g_file_query_file_type(gfile, 0, NULL) == G_FILE_TYPE_DIRECTORY) {
+        if (g_file_query_file_type(gfile, (GFileQueryInfoFlags) 0, NULL) == G_FILE_TYPE_DIRECTORY) {
             gjs_debug(GJS_DEBUG_IMPORTER,
                       "Adding directory '%s' to child importer '%s'",
                       full_path, name);
@@ -831,11 +831,11 @@ importer_new_enumerate(JSContext  *context,
         if (JSVAL_IS_NULL(*state_p)) /* Iterating prototype */
             return JS_TRUE;
 
-        iter = JSVAL_TO_PRIVATE(*state_p);
+        iter = (ImporterIterator*) JSVAL_TO_PRIVATE(*state_p);
 
         if (iter->index < iter->elements->len) {
             if (!gjs_string_from_utf8(context,
-                                         g_ptr_array_index(iter->elements,
+                                         (const char*) g_ptr_array_index(iter->elements,
                                                            iter->index++),
                                          -1,
                                          &element_val))
@@ -851,7 +851,7 @@ importer_new_enumerate(JSContext  *context,
 
     case JSENUMERATE_DESTROY: {
         if (state_p && !JSVAL_IS_NULL(*state_p)) {
-            iter = JSVAL_TO_PRIVATE(*state_p);
+            iter = (ImporterIterator*) JSVAL_TO_PRIVATE(*state_p);
 
             importer_iterator_free(iter);
 
@@ -929,7 +929,7 @@ importer_finalize(JSFreeOp *fop,
 {
     Importer *priv;
 
-    priv = JS_GetPrivate(obj);
+    priv = (Importer*) JS_GetPrivate(obj);
     gjs_debug_lifecycle(GJS_DEBUG_IMPORTER,
                         "finalize, obj %p priv %p", obj, priv);
     if (priv == NULL)
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index 9ffc9e2..d4b96d0 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -55,7 +55,7 @@ gjs_string_to_utf8 (JSContext  *context,
     }
 
     if (utf8_string_p) {
-        bytes = g_malloc((len + 1) * sizeof(char));
+        bytes = (char*) g_malloc((len + 1) * sizeof(char));
         JS_EncodeStringToBuffer(str, bytes, len);
         bytes[len] = '\0';
         *utf8_string_p = bytes;
@@ -180,7 +180,7 @@ gjs_string_get_uint16_data(JSContext       *context,
     if (js_data == NULL)
         goto out;
 
-    *data_p = g_memdup(js_data, sizeof(*js_data)*(*len_p));
+    *data_p = (guint16*) g_memdup(js_data, sizeof(*js_data)*(*len_p));
 
     retval = JS_TRUE;
 out:
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 203621a..0a58669 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -337,7 +337,7 @@ gjs_value_debug_string(JSContext      *context,
 
     size_t len = JS_GetStringEncodingLength(context, str);
     if (len != (size_t)(-1)) {
-        bytes = g_malloc((len + 1) * sizeof(char));
+        bytes = (char*) g_malloc((len + 1) * sizeof(char));
         JS_EncodeStringToBuffer(str, bytes, len);
         bytes[len] = '\0';
     } else {
@@ -465,7 +465,7 @@ gjs_log_exception_full(JSContext *context,
         gjs_typecheck_boxed(context, JSVAL_TO_OBJECT(exc), NULL, G_TYPE_ERROR, FALSE)) {
         GError *gerror;
 
-        gerror = gjs_c_struct_from_boxed(context, JSVAL_TO_OBJECT(exc));
+        gerror = (GError*) gjs_c_struct_from_boxed(context, JSVAL_TO_OBJECT(exc));
         utf8_exception = g_strdup_printf("GLib.Error %s: %s",
                                          g_quark_to_string(gerror->domain),
                                          gerror->message);
@@ -935,7 +935,7 @@ gjs_parse_args (JSContext  *context,
             fmt_iter++;
 
             if (JSVAL_IS_NULL (js_value)) {
-                gpointer *arg = arg_location;
+                gpointer *arg = (gpointer*) arg_location;
                 *arg = NULL;
                 goto got_value;
             }
@@ -946,7 +946,7 @@ gjs_parse_args (JSContext  *context,
             if (!JSVAL_IS_BOOLEAN(js_value)) {
                 arg_error_message = "Not a boolean";
             } else {
-                gboolean *arg = arg_location;
+                gboolean *arg = (gboolean*) arg_location;
                 *arg = JSVAL_TO_BOOLEAN(js_value);
             }
         }
@@ -955,13 +955,13 @@ gjs_parse_args (JSContext  *context,
             if (!JSVAL_IS_OBJECT(js_value)) {
                 arg_error_message = "Not an object";
             } else {
-                JSObject **arg = arg_location;
+                JSObject **arg = (JSObject**) arg_location;
                 *arg = JSVAL_TO_OBJECT(js_value);
             }
         }
             break;
         case 's': {
-            char **arg = arg_location;
+            char **arg = (char**) arg_location;
 
             if (gjs_string_to_utf8 (context, js_value, arg)) {
                 unwind_strings[n_unwind++] = *arg;
@@ -974,7 +974,7 @@ gjs_parse_args (JSContext  *context,
         }
             break;
         case 'F': {
-            char **arg = arg_location;
+            char **arg = (char**) arg_location;
 
             if (gjs_string_to_filename (context, js_value, arg)) {
                 unwind_strings[n_unwind++] = *arg;
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 9754830..d666aaa 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -88,7 +88,7 @@ typedef struct GjsRootedArray GjsRootedArray;
     {                                                                   \
         type *priv;                                                     \
         JS_BeginRequest(context);                                       \
-        priv = JS_GetInstancePrivate(context, object, &g_class, NULL);  \
+        priv = (type*) JS_GetInstancePrivate(context, object, &g_class, NULL);  \
         JS_EndRequest(context);                                         \
         return priv;                                                    \
     }                                                                   \
diff --git a/gjs/native.cpp b/gjs/native.cpp
index 5041dbe..ad1c648 100644
--- a/gjs/native.cpp
+++ b/gjs/native.cpp
@@ -47,7 +47,7 @@ gjs_register_native_module (const char          *module_id,
         return;
     }
 
-    g_hash_table_replace(modules, g_strdup(module_id), func);
+    g_hash_table_replace(modules, g_strdup(module_id), (void*) func);
 
     gjs_debug(GJS_DEBUG_NATIVE,
               "Registered native JS module '%s'",
@@ -94,7 +94,7 @@ gjs_import_native_module(JSContext   *context,
               name);
 
     if (modules != NULL)
-        func = g_hash_table_lookup(modules, name);
+        func = (GjsDefineModuleFunc) g_hash_table_lookup(modules, name);
     else
         func = NULL;
 
diff --git a/gjs/profiler.cpp b/gjs/profiler.cpp
index 47a1d47..9c46c9d 100644
--- a/gjs/profiler.cpp
+++ b/gjs/profiler.cpp
@@ -79,7 +79,7 @@ struct _GjsProfileFunction {
 static guint
 gjs_profile_function_key_hash(gconstpointer keyp)
 {
-    const GjsProfileFunctionKey *key = keyp;
+    const GjsProfileFunctionKey *key = (const GjsProfileFunctionKey*) keyp;
 
     return g_str_hash(key->filename) ^
         key->lineno ^
@@ -90,8 +90,8 @@ static gboolean
 gjs_profile_function_key_equal(gconstpointer ap,
                                gconstpointer bp)
 {
-    const GjsProfileFunctionKey *a = ap;
-    const GjsProfileFunctionKey *b = bp;
+    const GjsProfileFunctionKey *a = (const GjsProfileFunctionKey*) ap;
+    const GjsProfileFunctionKey *b = (const GjsProfileFunctionKey*) bp;
 
     g_assert(a != NULL);
     g_assert(b != NULL);
@@ -144,7 +144,7 @@ gjs_profile_function_key_from_js(JSContext             *cx,
         key->filename = (char*)JS_GetScriptFilename(cx, script);
         key->lineno = JS_GetScriptBaseLineNumber(cx, script);
     } else {
-        key->filename = "(native)";
+        key->filename = (char*)"(native)";
         key->lineno = 0;
     }
 
@@ -173,7 +173,7 @@ gjs_profiler_lookup_function(GjsProfiler  *self,
 
     gjs_profile_function_key_from_js(cx, fp, &key);
 
-    function = g_hash_table_lookup(self->by_file, &key);
+    function = (GjsProfileFunction*) g_hash_table_lookup(self->by_file, &key);
     if (function)
         goto error;
 
@@ -280,7 +280,7 @@ gjs_profiler_execute_hook(JSContext    *cx,
                           JSBool       *ok,
                           void         *callerdata)
 {
-    GjsProfiler *self = callerdata;
+    GjsProfiler *self = (GjsProfiler*) callerdata;
 
     gjs_profiler_log_call(self, cx, fp, before, ok);
 
@@ -294,7 +294,7 @@ gjs_profiler_call_hook(JSContext    *cx,
                        JSBool       *ok,
                        void         *callerdata)
 {
-    GjsProfiler *self = callerdata;
+    GjsProfiler *self = (GjsProfiler*) callerdata;
 
     gjs_profiler_log_call(self, cx, fp, before, ok);
 
@@ -360,7 +360,7 @@ by_file_reset_one(gpointer key,
                   gpointer value,
                   gpointer user_data)
 {
-    GjsProfileFunction *function = value;
+    GjsProfileFunction *function = (GjsProfileFunction*) value;
     GjsProfileData *p;
 
     p = &function->profile;
@@ -383,8 +383,8 @@ by_file_dump_one(gpointer key,
                  gpointer value,
                  gpointer user_data)
 {
-    GjsProfileFunction *function = value;
-    FILE *fp = user_data;
+    GjsProfileFunction *function = (GjsProfileFunction*) value;
+    FILE *fp = (FILE*) user_data;
     GjsProfileData *p;
 
     p = &function->profile;
diff --git a/gjs/stack.cpp b/gjs/stack.cpp
index 49a1260..dcf4380 100644
--- a/gjs/stack.cpp
+++ b/gjs/stack.cpp
@@ -96,7 +96,7 @@ gjs_context_get_frame_info (JSContext  *context,
 void
 gjs_context_print_stack_stderr(GjsContext *context)
 {
-    JSContext *cx = gjs_context_get_native_context(context);
+    JSContext *cx = (JSContext*) gjs_context_get_native_context(context);
     jsval v_stack;
     char *stack;
 
diff --git a/gjs/type-module.cpp b/gjs/type-module.cpp
index 380c52f..36d3df5 100644
--- a/gjs/type-module.cpp
+++ b/gjs/type-module.cpp
@@ -39,7 +39,7 @@ GjsTypeModule *
 gjs_type_module_get ()
 {
     if (global_type_module == NULL) {
-        global_type_module = g_object_new (GJS_TYPE_TYPE_MODULE, NULL);
+        global_type_module = (GjsTypeModule *) g_object_new (GJS_TYPE_TYPE_MODULE, NULL);
     }
 
     return global_type_module;
diff --git a/installed-tests/gjs-unit.cpp b/installed-tests/gjs-unit.cpp
index 5fa10f0..c8dd70f 100644
--- a/installed-tests/gjs-unit.cpp
+++ b/installed-tests/gjs-unit.cpp
@@ -39,14 +39,14 @@ static void
 setup(GjsTestJSFixture *fix,
       gconstpointer     test_data)
 {
-    const char *test_filename = test_data;
+    const char *test_filename = (const char*) test_data;
     const char *js_version;
 
     js_version = gjs_context_scan_file_for_js_version(test_filename);
 
-    fix->context = g_object_new (GJS_TYPE_CONTEXT,
-                                 "js-version", js_version,
-                                 NULL);
+    fix->context = (GjsContext*) g_object_new (GJS_TYPE_CONTEXT,
+                                               "js-version", js_version,
+                                               NULL);
 }
 
 static void
@@ -121,7 +121,7 @@ main(int argc, char **argv)
 
     all_tests = read_all_dir_sorted(js_test_dir);
     for (iter = all_tests; iter; iter = iter->next) {
-        char *name = iter->data;
+        char *name = (char*) iter->data;
         char *test_name;
         char *file_name;
 
diff --git a/libgjs-private/gjs-gdbus-wrapper.cpp b/libgjs-private/gjs-gdbus-wrapper.cpp
index fc0692b..2e4619e 100644
--- a/libgjs-private/gjs-gdbus-wrapper.cpp
+++ b/libgjs-private/gjs-gdbus-wrapper.cpp
@@ -116,7 +116,7 @@ gjs_dbus_implementation_set_property(GObject *object, guint property_id, const G
 
     switch (property_id) {
     case PROP_G_INTERFACE_INFO:
-        self->priv->ifaceinfo = g_value_dup_boxed (value);
+        self->priv->ifaceinfo = (GDBusInterfaceInfo*) g_value_dup_boxed (value);
         break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -152,7 +152,7 @@ gjs_dbus_implementation_get_properties (GDBusInterfaceSkeleton *skeleton) {
         GVariant *value;
 
         /* If we have a cached value, we use that instead of querying again */
-        if ((value = g_hash_table_lookup(self->priv->outstanding_properties, prop->name))) {
+        if ((value = (GVariant*) g_hash_table_lookup(self->priv->outstanding_properties, prop->name))) {
             g_variant_builder_add(&builder, "{sv}", prop->name, value);
             continue;
         }
@@ -223,11 +223,11 @@ gjs_dbus_implementation_class_init(GjsDBusImplementationClass *klass) {
                                                        "Interface Info",
                                                        "A DBusInterfaceInfo representing the exported 
object",
                                                        G_TYPE_DBUS_INTERFACE_INFO,
-                                                       G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | 
G_PARAM_CONSTRUCT_ONLY));
+                                                       (GParamFlags) (G_PARAM_STATIC_STRINGS | 
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
 
     signals[SIGNAL_HANDLE_METHOD] = g_signal_new("handle-method-call",
                                                  G_TYPE_FROM_CLASS(klass),
-                                                 0, /* flags */
+                                                 (GSignalFlags) 0, /* flags */
                                                  0, /* closure */
                                                  NULL, /* accumulator */
                                                  NULL, /* accumulator data */
@@ -240,7 +240,7 @@ gjs_dbus_implementation_class_init(GjsDBusImplementationClass *klass) {
 
     signals[SIGNAL_HANDLE_PROPERTY_GET] = g_signal_new("handle-property-get",
                                                        G_TYPE_FROM_CLASS(klass),
-                                                       0, /* flags */
+                                                       (GSignalFlags) 0, /* flags */
                                                        0, /* closure */
                                                        g_signal_accumulator_first_wins,
                                                        NULL, /* accumulator data */
@@ -252,7 +252,7 @@ gjs_dbus_implementation_class_init(GjsDBusImplementationClass *klass) {
 
     signals[SIGNAL_HANDLE_PROPERTY_SET] = g_signal_new("handle-property-set",
                                                        G_TYPE_FROM_CLASS(klass),
-                                                       0, /* flags */
+                                                       (GSignalFlags) 0, /* flags */
                                                        0, /* closure */
                                                        NULL, /* accumulator */
                                                        NULL, /* accumulator data */
diff --git a/modules/cairo-context.cpp b/modules/cairo-context.cpp
index a252914..6887f90 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -309,7 +309,7 @@ gjs_cairo_context_finalize(JSFreeOp *fop,
                            JSObject *obj)
 {
     GjsCairoContext *priv;
-    priv = JS_GetPrivate(obj);
+    priv = (GjsCairoContext*) JS_GetPrivate(obj);
     if (priv == NULL)
         return;
 
diff --git a/modules/cairo-image-surface.cpp b/modules/cairo-image-surface.cpp
index 215ac5d..78cccaf 100644
--- a/modules/cairo-image-surface.cpp
+++ b/modules/cairo-image-surface.cpp
@@ -44,7 +44,7 @@ GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_image_surface)
                         "height", &height))
         return JS_FALSE;
 
-    surface = cairo_image_surface_create(format, width, height);
+    surface = cairo_image_surface_create((cairo_format_t) format, width, height);
 
     if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface"))
         return JS_FALSE;
diff --git a/modules/cairo-path.cpp b/modules/cairo-path.cpp
index fc979cc..21bb805 100644
--- a/modules/cairo-path.cpp
+++ b/modules/cairo-path.cpp
@@ -41,7 +41,7 @@ gjs_cairo_path_finalize(JSFreeOp *fop,
                         JSObject *obj)
 {
     GjsCairoPath *priv;
-    priv = JS_GetPrivate(obj);
+    priv = (GjsCairoPath*) JS_GetPrivate(obj);
     if (priv == NULL)
         return;
     cairo_path_destroy(priv->path);
@@ -111,7 +111,7 @@ gjs_cairo_path_get_path(JSContext *context,
     g_return_val_if_fail(context != NULL, NULL);
     g_return_val_if_fail(object != NULL, NULL);
 
-    priv = JS_GetPrivate(object);
+    priv = (GjsCairoPath*) JS_GetPrivate(object);
     if (priv == NULL)
         return NULL;
     return priv->path;
diff --git a/modules/cairo-pattern.cpp b/modules/cairo-pattern.cpp
index 2926fd7..e2c48c0 100644
--- a/modules/cairo-pattern.cpp
+++ b/modules/cairo-pattern.cpp
@@ -42,7 +42,7 @@ gjs_cairo_pattern_finalize(JSFreeOp *fop,
                            JSObject *obj)
 {
     GjsCairoPattern *priv;
-    priv = JS_GetPrivate(obj);
+    priv = (GjsCairoPattern*) JS_GetPrivate(obj);
     if (priv == NULL)
         return;
     cairo_pattern_destroy(priv->pattern);
@@ -192,7 +192,7 @@ gjs_cairo_pattern_get_pattern(JSContext *context,
     g_return_val_if_fail(context != NULL, NULL);
     g_return_val_if_fail(object != NULL, NULL);
 
-    priv = JS_GetPrivate(object);
+    priv = (GjsCairoPattern*) JS_GetPrivate(object);
     if (priv == NULL)
         return NULL;
 
diff --git a/modules/cairo-surface.cpp b/modules/cairo-surface.cpp
index 7b78077..054b65d 100644
--- a/modules/cairo-surface.cpp
+++ b/modules/cairo-surface.cpp
@@ -43,7 +43,7 @@ gjs_cairo_surface_finalize(JSFreeOp *fop,
                            JSObject *obj)
 {
     GjsCairoSurface *priv;
-    priv = JS_GetPrivate(obj);
+    priv = (GjsCairoSurface*) JS_GetPrivate(obj);
     if (priv == NULL)
         return;
     cairo_surface_destroy(priv->surface);
@@ -238,7 +238,7 @@ gjs_cairo_surface_get_surface(JSContext *context,
     g_return_val_if_fail(context != NULL, NULL);
     g_return_val_if_fail(object != NULL, NULL);
 
-    priv = JS_GetPrivate(object);
+    priv = (GjsCairoSurface*) JS_GetPrivate(object);
     if (priv == NULL)
         return NULL;
     return priv->surface;
diff --git a/modules/system.cpp b/modules/system.cpp
index 41523c5..b12f766 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -145,7 +145,7 @@ gjs_js_define_system_stuff(JSContext  *context,
 
     retval = JS_FALSE;
 
-    gjs_context = JS_GetContextPrivate(context);
+    gjs_context = (GjsContext*) JS_GetContextPrivate(context);
     g_object_get(gjs_context,
                  "program-name", &program_name,
                  NULL);
diff --git a/test/gjs-tests.cpp b/test/gjs-tests.cpp
index 8fb67d3..26b5ece 100644
--- a/test/gjs-tests.cpp
+++ b/test/gjs-tests.cpp
@@ -245,10 +245,10 @@ gjstest_test_func_util_glib_strv_concat_null(void)
 static void
 gjstest_test_func_util_glib_strv_concat_pointers(void)
 {
-    char  *strv0[2] = {"foo", NULL};
+    char  *strv0[2] = {(char*)"foo", NULL};
     char  *strv1[1] = {NULL};
     char **strv2    = NULL;
-    char  *strv3[2] = {"bar", NULL};
+    char  *strv3[2] = {(char*)"bar", NULL};
     char **stuff[4];
     char **ret;
 
diff --git a/util/glib.cpp b/util/glib.cpp
index 3e4452d..7045fde 100644
--- a/util/glib.cpp
+++ b/util/glib.cpp
@@ -37,7 +37,7 @@ get_first_one_predicate(void  *key,
                         void  *value,
                         void  *data)
 {
-    StoreOneData *sod = data;
+    StoreOneData *sod = (StoreOneData *) data;
 
     sod->key = key;
     sod->value = value;
diff --git a/util/log.cpp b/util/log.cpp
index c2e3220..7e00c51 100644
--- a/util/log.cpp
+++ b/util/log.cpp
@@ -123,7 +123,7 @@ gjs_debug(GjsDebugTopic topic,
              * (printf below should be safe as we check '%u' is the only format
              * string)
              */
-            c = strchr(debug_output, '%');
+            c = strchr((char *) debug_output, '%');
             if (c && c[1] == 'u' && !strchr(c+1, '%')) {
                 free_me = g_strdup_printf(debug_output, (guint)getpid());
                 log_file = free_me;


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