summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-06 22:55:33 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-06 22:55:33 (GMT)
commitae2be2044d39abebfa7b8d5ce64571e72f7ff6fd (patch)
tree71b2a2bc85ec23100c9d584bcd7409080418af53 /src
parentb070fb755b9e32bfa80e8854606f431d285ca23e (diff)
Removed some compilation warnings.
Diffstat (limited to 'src')
-rw-r--r--src/arch/target.c2
-rw-r--r--src/common/compression.c4
-rw-r--r--src/core/collections.c23
-rw-r--r--src/gui/panels/bintree.c6
-rw-r--r--src/gui/panels/strings.c6
-rw-r--r--src/gui/panels/symbols.c6
6 files changed, 38 insertions, 9 deletions
diff --git a/src/arch/target.c b/src/arch/target.c
index a2e1f34..64b12dd 100644
--- a/src/arch/target.c
+++ b/src/arch/target.c
@@ -627,6 +627,8 @@ static bool g_target_operand_unserialize(GTargetOperand *operand, GAsmStorage *s
* La désérialisation est donc prise en compte par ce dernier type d'opérande.
*/
+ result = false;
+
return result;
}
diff --git a/src/common/compression.c b/src/common/compression.c
index d443924..982ac6a 100644
--- a/src/common/compression.c
+++ b/src/common/compression.c
@@ -68,7 +68,7 @@ CPError add_file_into_archive(struct archive *output, const char *filename, cons
{
perror("stat");
result = CPE_SYSTEM_ERROR;
- goto afia_exit;
+ goto afia_quick_exit;
}
entry = archive_entry_new();
@@ -105,6 +105,8 @@ CPError add_file_into_archive(struct archive *output, const char *filename, cons
archive_entry_free(entry);
+ afia_quick_exit:
+
return result;
}
diff --git a/src/core/collections.c b/src/core/collections.c
index c00c760..2f28857 100644
--- a/src/core/collections.c
+++ b/src/core/collections.c
@@ -93,7 +93,9 @@ uint32_t register_collection_type(GType items)
bool load_hard_coded_collection_definitions(void)
{
+#ifndef NDEBUG
uint32_t id; /* Identifiant unique retourné */
+#endif
/**
* La liste des chargements doit se faire dans le même ordre que
@@ -101,17 +103,22 @@ bool load_hard_coded_collection_definitions(void)
* afin de garder la correspondance entre les identifiants.
*/
- id = register_collection_type(G_TYPE_BM_COLLECTION);
- assert(id == DBF_BOOKMARKS);
+#ifndef NDEBUG
+# define REGISTER_COLLECTION(tp, exp) \
+ id = register_collection_type(tp); \
+ assert(id == exp);
+#else
+# define REGISTER_COLLECTION(tp, exp) \
+ register_collection_type(tp);
+#endif
- id = register_collection_type(G_TYPE_COMMENT_COLLECTION);
- assert(id == DBF_COMMENTS);
+ REGISTER_COLLECTION(G_TYPE_BM_COLLECTION, DBF_BOOKMARKS);
- id = register_collection_type(G_TYPE_MOVE_COLLECTION);
- assert(id == DBF_MOVES);
+ REGISTER_COLLECTION(G_TYPE_COMMENT_COLLECTION, DBF_COMMENTS);
- id = register_collection_type(G_TYPE_SWITCHER_COLLECTION);
- assert(id == DBF_DISPLAY_SWITCHERS);
+ REGISTER_COLLECTION(G_TYPE_MOVE_COLLECTION, DBF_MOVES);
+
+ REGISTER_COLLECTION(G_TYPE_SWITCHER_COLLECTION, DBF_DISPLAY_SWITCHERS);
return true;
diff --git a/src/gui/panels/bintree.c b/src/gui/panels/bintree.c
index 5da7e99..e425e92 100644
--- a/src/gui/panels/bintree.c
+++ b/src/gui/panels/bintree.c
@@ -1069,7 +1069,9 @@ static bool is_bintree_column_matching(const bintree_update_data *data, GBinPort
static const char *g_bintree_panel_setup(const GBintreePanel *panel, unsigned int uid, size_t *count, bintree_update_data **data)
{
const char *result; /* Message à retourner */
+#ifndef NDEBUG
int ret; /* Bilan de mise en place */
+#endif
GtkBuilder *builder; /* Constructeur utilisé */
GtkTreeView *treeview; /* Arborescence graphique */
@@ -1106,8 +1108,12 @@ static const char *g_bintree_panel_setup(const GBintreePanel *panel, unsigned in
{
(*data)->filter = (regex_t *)malloc(sizeof(regex_t));
+#ifndef NDEBUG
ret = regcomp((*data)->filter, G_PANEL_ITEM(panel)->filter, REG_EXTENDED | REG_ICASE);
assert(ret == 0);
+#else
+ regcomp((*data)->filter, G_PANEL_ITEM(panel)->filter, REG_EXTENDED | REG_ICASE);
+#endif
}
diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c
index 268634f..0c147d5 100644
--- a/src/gui/panels/strings.c
+++ b/src/gui/panels/strings.c
@@ -1439,7 +1439,9 @@ static const char *g_strings_panel_setup(const GStringsPanel *panel, unsigned in
{
const char *result; /* Message à retourner */
GBinFormat *format; /* Format du binaire */
+#ifndef NDEBUG
int ret; /* Bilan de mise en place */
+#endif
*data = malloc(sizeof(strings_update_data));
@@ -1481,8 +1483,12 @@ static const char *g_strings_panel_setup(const GStringsPanel *panel, unsigned in
{
(*data)->filter = (regex_t *)malloc(sizeof(regex_t));
+#ifndef NDEBUG
ret = regcomp((*data)->filter, G_PANEL_ITEM(panel)->filter, REG_EXTENDED | REG_ICASE);
assert(ret == 0);
+#else
+ regcomp((*data)->filter, G_PANEL_ITEM(panel)->filter, REG_EXTENDED | REG_ICASE);
+#endif
}
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c
index 385bfad..8168313 100644
--- a/src/gui/panels/symbols.c
+++ b/src/gui/panels/symbols.c
@@ -1520,7 +1520,9 @@ static const char *g_symbols_panel_setup(const GSymbolsPanel *panel, unsigned in
{
const char *result; /* Message à retourner */
GBinFormat *format; /* Format du binaire */
+#ifndef NDEBUG
int ret; /* Bilan de mise en place */
+#endif
GtkBuilder *builder; /* Constructeur utilisé */
GtkTreeView *treeview; /* Arborescence graphique */
@@ -1564,8 +1566,12 @@ static const char *g_symbols_panel_setup(const GSymbolsPanel *panel, unsigned in
{
(*data)->filter = (regex_t *)malloc(sizeof(regex_t));
+#ifndef NDEBUG
ret = regcomp((*data)->filter, G_PANEL_ITEM(panel)->filter, REG_EXTENDED | REG_ICASE);
assert(ret == 0);
+#else
+ regcomp((*data)->filter, G_PANEL_ITEM(panel)->filter, REG_EXTENDED | REG_ICASE);
+#endif
}