[gjs/wip/ptomato/warnings: 6/15] warnings: Remove unused variables and functions



commit ae9fecebb0ec4cd5e3b0a368791c433fb8ff3ff6
Author: Philip Chimento <philip chimento gmail com>
Date:   Thu Sep 29 08:42:25 2016 -0700

    warnings: Remove unused variables and functions
    
    In order to compile everything to the exacting standards of
    AX_COMPILER_FLAGS, this fixes all instances of -Wunused by removing the
    unused code.

 gi/arg.cpp        |    2 --
 gi/boxed.cpp      |    1 -
 gi/function.cpp   |    1 -
 gi/object.cpp     |    2 --
 gi/repo.cpp       |    1 -
 gjs/byteArray.cpp |    1 -
 gjs/coverage.cpp  |   41 ++---------------------------------------
 7 files changed, 2 insertions(+), 47 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 0df20ee..aea0fdf 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1722,11 +1722,9 @@ gjs_value_to_g_argument(JSContext      *context,
         gpointer data;
         gsize length;
         GIArrayType array_type = g_type_info_get_array_type(type_info);
-        GITypeTag element_type;
         GITypeInfo *param_info;
 
         param_info = g_type_info_get_param_type(type_info, 0);
-        element_type = g_type_info_get_tag(param_info);
 
         /* First, let's handle the case where we're passed an instance
          * of our own byteArray class.
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 87c6433..cee8547 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -549,7 +549,6 @@ get_field_info (JSContext *context,
 {
     GIFieldInfo *field_info;
     char *name;
-    JS::Value value;
 
     if (!priv->field_map)
         priv->field_map = get_field_map(priv->info);
diff --git a/gi/function.cpp b/gi/function.cpp
index fe650ad..97ca8ae 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -1365,7 +1365,6 @@ get_num_arguments (JSContext *context,
                    JS::MutableHandleValue vp)
 {
     int n_args, n_jsargs, i;
-    JS::Value retval;
     Function *priv;
 
     JS::CallReceiver rec = JS::CallReceiverFromVp(vp.address());
diff --git a/gi/object.cpp b/gi/object.cpp
index 2a0eacb..aa55dd7 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1936,7 +1936,6 @@ gjs_define_object_class(JSContext      *context,
     JSObject *prototype;
     JSObject *constructor;
     JSObject *parent_proto;
-    JSObject *global;
 
     JS::Value value;
     ObjectInstance *priv;
@@ -2062,7 +2061,6 @@ gjs_object_from_g_object(JSContext    *context,
                          GObject      *gobj)
 {
     JSObject *obj;
-    JSObject *global;
 
     if (gobj == NULL)
         return NULL;
diff --git a/gi/repo.cpp b/gi/repo.cpp
index ccd5ca8..73bd316 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -761,7 +761,6 @@ gjs_lookup_generic_constructor(JSContext  *context,
                                GIBaseInfo *info)
 {
     JSObject *in_object;
-    JSObject *constructor;
     const char *constructor_name;
     JS::Value value;
 
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index 7695463..9a1af34 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -537,7 +537,6 @@ static JSObject *
 byte_array_get_prototype(JSContext *context)
 {
     JS::Value retval;
-    JSObject *prototype;
 
     retval = gjs_get_global_slot (context, GJS_GLOBAL_SLOT_BYTE_ARRAY_PROTOTYPE);
 
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index b5fbcfc..c5e80fc 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -973,8 +973,6 @@ gjs_get_path_checksum(const char *path)
     return checksum;
 }
 
-static unsigned int COVERAGE_STATISTICS_CACHE_MAGIC = 0xC0432463;
-
 /* The binary data for the cache has the following structure:
  *
  * {
@@ -1041,22 +1039,6 @@ gjs_serialize_statistics(GjsCoverage *coverage)
                             strlen(statistics_as_json_string));
 }
 
-static JSObject *
-gjs_get_generic_object_constructor(JSContext        *context,
-                                   JSRuntime        *runtime,
-                                   JS::HandleObject  global_object)
-{
-    JSAutoRequest ar(context);
-    JSAutoCompartment ac(context, global_object);
-
-    JS::Value object_constructor_value;
-    if (!JS_GetProperty(context, global_object, "Object", &object_constructor_value) ||
-        !object_constructor_value.isObject())
-        g_assert_not_reached();
-
-    return &object_constructor_value.toObject();
-}
-
 static JSString *
 gjs_deserialize_cache_to_object_for_compartment(JSContext        *context,
                                                 JS::HandleObject global_object,
@@ -1121,8 +1103,7 @@ gjs_fetch_statistics_from_js(GjsCoverage *coverage,
     JS::RootedObject rooted_coverage_statistics(JS_GetRuntime(js_context),
                                                 priv->coverage_statistics);
 
-    char                      **file_iter = coverage_files;
-    GjsCoverageFileStatistics *statistics_iter = (GjsCoverageFileStatistics *) file_statistics_array->data;
+    char **file_iter = coverage_files;
     while (*file_iter) {
         GjsCoverageFileStatistics statistics;
         if (fetch_coverage_file_statistics_from_js(js_context,
@@ -1390,22 +1371,6 @@ get_filename_from_filename_as_js_string(JSContext    *context,
     return filename;
 }
 
-static GFile *
-get_file_from_filename_as_js_string(JSContext    *context,
-                                    JS::CallArgs &args) {
-    char *filename = get_filename_from_filename_as_js_string(context, args);
-
-    if (!filename) {
-        gjs_throw(context, "Failed to parse arguments for filename");
-        return NULL;
-    }
-
-    GFile *file = g_file_new_for_commandline_arg(filename);
-
-    g_free(filename);
-    return file;
-}
-
 static JSBool
 coverage_get_file_modification_time(JSContext *context,
                                     unsigned  argc,
@@ -1445,8 +1410,7 @@ coverage_get_file_checksum(JSContext *context,
                            JS::Value *vp)
 {
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-    JSRuntime    *runtime = JS_GetRuntime(context);
-    GTimeVal mtime;
+    JSRuntime *runtime = JS_GetRuntime(context);
     char *filename = get_filename_from_filename_as_js_string(context, args);
 
     if (!filename)
@@ -1479,7 +1443,6 @@ coverage_get_file_contents(JSContext *context,
     GFile *file = NULL;
     char *script = NULL;
     gsize script_len;
-    JSString *script_jsstr;
     GError *error = NULL;
 
     if (!gjs_parse_call_args(context, "getFileContents", "s", args,


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