[gjs/wip/ptomato/autotools: 1/2] warnings: Remove unused variables and functions



commit a68d820956444f5c6cb96d23ec124d82b075d16d
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/boxed.cpp      |    1 -
 gi/function.cpp   |    1 -
 gi/object.cpp     |    2 --
 gi/repo.cpp       |    1 -
 gjs/byteArray.cpp |    1 -
 gjs/coverage.cpp  |   42 ++----------------------------------------
 6 files changed, 2 insertions(+), 46 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 5acf673..286f9f8 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -551,7 +551,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 eab4313..800369f 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -1368,7 +1368,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 ba8d663..1616acc 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 20cefe2..4bbb95c 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -769,7 +769,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 a06b11d..da816e9 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 8afd762..c0034dd 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,9 +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;
-    JSBool ret = JS_FALSE;
+    JSRuntime *runtime = JS_GetRuntime(context);
     char *filename = get_filename_from_filename_as_js_string(context, args);
 
     if (!filename)
@@ -1480,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]