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



commit 9b0adf566d9433b9799da7350b768c3ecbab888d
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/object.cpp     |    3 ---
 gi/repo.cpp       |    1 -
 gjs/byteArray.cpp |    1 -
 gjs/coverage.cpp  |   41 ++---------------------------------------
 6 files changed, 2 insertions(+), 47 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 66a232d..1f9012e 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1771,11 +1771,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 fb83128..fd2d646 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -539,7 +539,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/object.cpp b/gi/object.cpp
index 05c7a8a..e7cd0b6 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1905,7 +1905,6 @@ gjs_define_object_class(JSContext      *context,
     JSObject *prototype;
     JSObject *constructor;
     JSObject *parent_proto;
-    JSObject *global;
 
     JS::Value value;
     ObjectInstance *priv;
@@ -2030,8 +2029,6 @@ JSObject*
 gjs_object_from_g_object(JSContext    *context,
                          GObject      *gobj)
 {
-    JSObject *global;
-
     if (gobj == NULL)
         return NULL;
 
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 1b60039..c4e63ec 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 6287b79..0d8036f 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -515,7 +515,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 888a0aa..430d898 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -975,8 +975,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:
  *
  * {
@@ -1043,22 +1041,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,
@@ -1123,8 +1105,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,
@@ -1391,22 +1372,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,
@@ -1446,8 +1411,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)
@@ -1480,7 +1444,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", args, "s",


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