summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/pychrysalide/arch/instruction.c18
-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
7 files changed, 56 insertions, 9 deletions
diff --git a/plugins/pychrysalide/arch/instruction.c b/plugins/pychrysalide/arch/instruction.c
index 8c3d78d..d659c87 100644
--- a/plugins/pychrysalide/arch/instruction.c
+++ b/plugins/pychrysalide/arch/instruction.c
@@ -115,7 +115,9 @@ static PyObject *py_arch_instruction_get_sources(PyObject *self, void *unused)
size_t i; /* Boucle de parcours */
PyObject *linked; /* Source de lien Python */
PyObject *type; /* Nature du lien en Python */
+#ifndef NDEBUG
int ret; /* Bilan d'une écriture d'arg. */
+#endif
instr = G_ARCH_INSTRUCTION(pygobject_get(self));
@@ -132,8 +134,12 @@ static PyObject *py_arch_instruction_get_sources(PyObject *self, void *unused)
linked = pygobject_new(G_OBJECT(source->linked));
type = PyLong_FromLong(source->type);
+#ifndef NDEBUG
ret = PyTuple_SetItem(result, i, Py_BuildValue("(OO)", linked, type));
assert(ret == 0);
+#else
+ PyTuple_SetItem(result, i, Py_BuildValue("(OO)", linked, type));
+#endif
unref_instr_link(source);
@@ -168,7 +174,9 @@ static PyObject *py_arch_instruction_get_destinations(PyObject *self, void *unus
size_t i; /* Boucle de parcours */
PyObject *linked; /* Destination de lien Python */
PyObject *type; /* Nature du lien en Python */
+#ifndef NDEBUG
int ret; /* Bilan d'une écriture d'arg. */
+#endif
instr = G_ARCH_INSTRUCTION(pygobject_get(self));
@@ -185,8 +193,12 @@ static PyObject *py_arch_instruction_get_destinations(PyObject *self, void *unus
linked = pygobject_new(G_OBJECT(dest->linked));
type = PyLong_FromLong(dest->type);
+#ifndef NDEBUG
ret = PyTuple_SetItem(result, i, Py_BuildValue("(OO)", linked, type));
assert(ret == 0);
+#else
+ PyTuple_SetItem(result, i, Py_BuildValue("(OO)", linked, type));
+#endif
unref_instr_link(dest);
@@ -359,7 +371,9 @@ static PyObject *py_arch_instruction_get_operands(PyObject *self, void *unused)
size_t i; /* Boucle de parcours */
GArchOperand *operand; /* Opérande à manipuler */
PyObject *opobj; /* Version Python */
+#ifndef NDEBUG
int ret; /* Bilan d'une écriture d'arg. */
+#endif
instr = G_ARCH_INSTRUCTION(pygobject_get(self));
@@ -375,8 +389,12 @@ static PyObject *py_arch_instruction_get_operands(PyObject *self, void *unused)
opobj = pygobject_new(G_OBJECT(operand));
+#ifndef NDEBUG
ret = PyTuple_SetItem(result, i, Py_BuildValue("O", opobj));
assert(ret == 0);
+#else
+ PyTuple_SetItem(result, i, Py_BuildValue("O", opobj));
+#endif
g_object_unref(G_OBJECT(operand));
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
}