[gjs/wip/ptomato/warnings: 16/18] WIP - add superfluous switch defaults :-P
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/warnings: 16/18] WIP - add superfluous switch defaults :-P
- Date: Wed, 5 Oct 2016 07:26:31 +0000 (UTC)
commit df3e146e68bf8c30d7f5d44b992473c1ead62c37
Author: Philip Chimento <philip endlessm com>
Date: Mon Oct 3 13:48:12 2016 -0700
WIP - add superfluous switch defaults :-P
gi/arg.cpp | 4 +-
gi/boxed.cpp | 53 +++++++++++++++++++++++++------------------------
gi/function.cpp | 3 ++
gi/object.cpp | 2 +
gi/repo.cpp | 4 +-
gjs/importer.cpp | 3 ++
gjs/jsapi-private.cpp | 2 +
7 files changed, 41 insertions(+), 30 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index 7044ce1..4375062 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -1028,9 +1028,9 @@ get_argument_display_name(const char *arg_name,
return g_strdup("Hash element");
case GJS_ARGUMENT_ARRAY_ELEMENT:
return g_strdup("Array element");
+ default:
+ g_assert_not_reached ();
}
-
- g_assert_not_reached ();
}
static const char *
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index b74e6d2..dce99ff 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -971,29 +971,6 @@ type_can_be_allocated_directly(GITypeInfo *type_info)
}
} else {
switch (g_type_info_get_tag(type_info)) {
- case GI_TYPE_TAG_BOOLEAN:
- case GI_TYPE_TAG_INT8:
- case GI_TYPE_TAG_UINT8:
- case GI_TYPE_TAG_INT16:
- case GI_TYPE_TAG_UINT16:
- case GI_TYPE_TAG_INT32:
- case GI_TYPE_TAG_UINT32:
- case GI_TYPE_TAG_INT64:
- case GI_TYPE_TAG_UINT64:
- case GI_TYPE_TAG_FLOAT:
- case GI_TYPE_TAG_DOUBLE:
- case GI_TYPE_TAG_UNICHAR:
- break;
- case GI_TYPE_TAG_VOID:
- case GI_TYPE_TAG_GTYPE:
- case GI_TYPE_TAG_ERROR:
- case GI_TYPE_TAG_UTF8:
- case GI_TYPE_TAG_FILENAME:
- case GI_TYPE_TAG_ARRAY:
- case GI_TYPE_TAG_GLIST:
- case GI_TYPE_TAG_GSLIST:
- case GI_TYPE_TAG_GHASH:
- break;
case GI_TYPE_TAG_INTERFACE:
{
GIBaseInfo *interface = g_type_info_get_interface(type_info);
@@ -1007,9 +984,6 @@ type_can_be_allocated_directly(GITypeInfo *type_info)
/* FIXME: Need to implement */
is_simple = false;
break;
- case GI_INFO_TYPE_ENUM:
- case GI_INFO_TYPE_FLAGS:
- break;
case GI_INFO_TYPE_OBJECT:
case GI_INFO_TYPE_VFUNC:
case GI_INFO_TYPE_CALLBACK:
@@ -1029,11 +1003,38 @@ type_can_be_allocated_directly(GITypeInfo *type_info)
case GI_INFO_TYPE_INVALID_0:
g_assert_not_reached();
break;
+ case GI_INFO_TYPE_ENUM:
+ case GI_INFO_TYPE_FLAGS:
+ default:
+ break;
}
g_base_info_unref(interface);
break;
}
+ case GI_TYPE_TAG_BOOLEAN:
+ case GI_TYPE_TAG_INT8:
+ case GI_TYPE_TAG_UINT8:
+ case GI_TYPE_TAG_INT16:
+ case GI_TYPE_TAG_UINT16:
+ case GI_TYPE_TAG_INT32:
+ case GI_TYPE_TAG_UINT32:
+ case GI_TYPE_TAG_INT64:
+ case GI_TYPE_TAG_UINT64:
+ case GI_TYPE_TAG_FLOAT:
+ case GI_TYPE_TAG_DOUBLE:
+ case GI_TYPE_TAG_UNICHAR:
+ case GI_TYPE_TAG_VOID:
+ case GI_TYPE_TAG_GTYPE:
+ case GI_TYPE_TAG_ERROR:
+ case GI_TYPE_TAG_UTF8:
+ case GI_TYPE_TAG_FILENAME:
+ case GI_TYPE_TAG_ARRAY:
+ case GI_TYPE_TAG_GLIST:
+ case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
+ default:
+ break;
}
}
return is_simple;
diff --git a/gi/function.cpp b/gi/function.cpp
index 01bf596..ee4aa3f 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -942,6 +942,9 @@ gjs_invoke_c_function(JSContext *context,
failed = true;
break;
}
+
+ default:
+ ;
}
if (direction == GI_DIRECTION_INOUT && !arg_removed && !failed) {
diff --git a/gi/object.cpp b/gi/object.cpp
index f1fee8f..82e3884 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -359,6 +359,7 @@ object_instance_set_prop(JSContext *context,
case NO_SUCH_G_PROPERTY:
goto out;
case VALUE_WAS_SET:
+ default:
break;
}
@@ -721,6 +722,7 @@ object_instance_props_to_g_parameters(JSContext *context,
g_free(name);
goto free_array_and_fail;
case VALUE_WAS_SET:
+ default:
break;
}
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 1975355..65f54f3 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -703,9 +703,9 @@ gjs_info_type_name(GIInfoType type)
case GI_INFO_TYPE_INVALID_0:
g_assert_not_reached();
break;
+ default:
+ return "???";
}
-
- return "???";
}
char*
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 9e07c65..4b5383d 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -824,6 +824,9 @@ importer_new_enumerate(JSContext *context,
statep.setNull();
}
}
+
+ default:
+ ;
}
return true;
diff --git a/gjs/jsapi-private.cpp b/gjs/jsapi-private.cpp
index d7713f6..e0314e3 100644
--- a/gjs/jsapi-private.cpp
+++ b/gjs/jsapi-private.cpp
@@ -67,6 +67,8 @@ gjs_error_reporter(JSContext *context,
*/
case 162:
return;
+ default:
+ ;
}
} else {
warning = "REPORTED";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]