[gjs/wip/ptomato/warnings: 3/12] warnings: Remove unused variables and functions
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/warnings: 3/12] warnings: Remove unused variables and functions
- Date: Wed, 19 Oct 2016 04:03:17 +0000 (UTC)
commit b248cb122888a22be959948897a76b07b9ce866e
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 | 3 ---
gi/repo.cpp | 1 -
gjs/byteArray.cpp | 1 -
gjs/coverage.cpp | 41 ++---------------------------------------
7 files changed, 2 insertions(+), 48 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 3d252e7..1672fb7 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1778,11 +1778,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 13275a3..1f03555 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 e26f4f5..764e4ff 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -1362,7 +1362,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 97644dd..3942190 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1940,7 +1940,6 @@ gjs_define_object_class(JSContext *context,
JSObject *prototype;
JSObject *constructor;
JSObject *parent_proto;
- JSObject *global;
JS::Value value;
ObjectInstance *priv;
@@ -2065,8 +2064,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 2f5ae4e..ae04450 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 a5e6ede..2038843 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -533,7 +533,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 a415a13..54f808b 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -974,8 +974,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:
*
* {
@@ -1042,22 +1040,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,
@@ -1122,8 +1104,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]