diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-11-20 14:10:53 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2019-11-20 15:27:49 +0100 |
commit | 02a9c9791a9acf4770e6dec16e6962645af36c9f (patch) | |
tree | 38f1e975a19f6b9891b7fb14d94b451bcb39c135 | |
parent | b9c011634ea5e890610f431456c973d20d4dee2b (diff) | |
download | libmbim-02a9c9791a9acf4770e6dec16e6962645af36c9f.tar.gz |
build-aux: fix warning in the built _get_string() methods with -Wsign-compare
mbim-error-types.c: In function ‘mbim_core_error_get_string’:
mbim-error-types.c:53:17: warning: comparison of integer expressions of different signedness: ‘MbimCoreError’ {aka ‘enum <anonymous>’} and ‘gint’ {aka ‘const int’} [-Wsign-compare]
53 | if (val == mbim_core_error_values[i].value)
| ^~
mbim-enum-types.c: In function ‘mbim_cid_basic_connect_get_string’:
mbim-enum-types.c:68:17: warning: comparison of integer expressions of different signedness: ‘MbimCidBasicConnect’ {aka ‘enum <anonymous>’} and ‘gint’ {aka ‘const int’} [-Wsign-compare]
68 | if (val == mbim_cid_basic_connect_values[i].value)
| ^~
mbim-enum-types.c: In function ‘mbim_data_class_build_string_from_mask’:
mbim-enum-types.c:1958:18: warning: comparison of integer expressions of different signedness: ‘MbimDataClass’ {aka ‘enum <anonymous>’} and ‘guint’ {aka ‘const unsigned int’} [-Wsign-compare]
1958 | if (mask == mbim_data_class_values[i].value) {
| ^~
CC libmbim_glib_generated_la-mbim-basic-connect.lo
-rw-r--r-- | build-aux/templates/mbim-enum-types-template.c | 4 | ||||
-rw-r--r-- | build-aux/templates/mbim-error-types-template.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/build-aux/templates/mbim-enum-types-template.c b/build-aux/templates/mbim-enum-types-template.c index 635147f..bb75a1e 100644 --- a/build-aux/templates/mbim-enum-types-template.c +++ b/build-aux/templates/mbim-enum-types-template.c @@ -51,7 +51,7 @@ const gchar * guint i; for (i = 0; @enum_name@_values[i].value_nick; i++) { - if (val == @enum_name@_values[i].value) + if ((gint)val == @enum_name@_values[i].value) return @enum_name@_values[i].value_nick; } @@ -82,7 +82,7 @@ gchar * for (i = 0; @enum_name@_values[i].value_nick; i++) { /* We also look for exact matches */ - if (mask == @enum_name@_values[i].value) { + if ((guint)mask == @enum_name@_values[i].value) { if (str) g_string_free (str, TRUE); return g_strdup (@enum_name@_values[i].value_nick); diff --git a/build-aux/templates/mbim-error-types-template.c b/build-aux/templates/mbim-error-types-template.c index 66ab892..7ed24b9 100644 --- a/build-aux/templates/mbim-error-types-template.c +++ b/build-aux/templates/mbim-error-types-template.c @@ -49,7 +49,7 @@ const gchar * guint i; for (i = 0; @enum_name@_values[i].value_nick; i++) { - if (val == @enum_name@_values[i].value) + if ((gint)val == @enum_name@_values[i].value) return @enum_name@_values[i].value_nick; } |