From abec2acca0c300ab43e3fec73602e216c078b391 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Mon, 5 Jan 2015 21:21:59 +0000 Subject: Ensured the right macro is used (XSTR vs STR). git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@448 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 14 ++++++++++++++ src/analysis/binary.c | 2 +- src/analysis/db/cdb.c | 4 ++-- src/arch/vmpa.c | 10 +++++----- src/arch/vmpa.h | 2 +- src/common/xml.c | 2 +- src/dialogs/storage.c | 2 +- 7 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3949f9..e933803 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +15-01-05 Cyrille Bagard + + * src/analysis/binary.c: + * src/analysis/db/cdb.c: + Ensure the right macro is used (XSTR vs STR). + + * src/arch/vmpa.c: + Respect the given string format when printing physical offsets. + + * src/arch/vmpa.h: + * src/common/xml.c: + * src/dialogs/storage.c: + Ensure the right macro is used (XSTR vs STR). + 15-01-04 Cyrille Bagard * src/analysis/disass/area.c: diff --git a/src/analysis/binary.c b/src/analysis/binary.c index d7f89b1..0c7a71c 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -776,7 +776,7 @@ static bool g_loaded_binary_save_storage(const GLoadedBinary *binary, xmlDocPtr bool result; /* Bilan à faire remonter */ char *storage_path; /* Partie "Enregistrement" */ char *access; /* Chemin d'accès à un élément */ - char port_str[sizeof(STR(USHRT_MAX)) + 1]; /* Version chaînée */ + char port_str[sizeof(XSTR(USHRT_MAX)) + 1]; /* Version chaînée */ DBFeatures i; /* Boucle de parcours */ result = true; diff --git a/src/analysis/db/cdb.c b/src/analysis/db/cdb.c index 55d1b2d..24da20e 100644 --- a/src/analysis/db/cdb.c +++ b/src/analysis/db/cdb.c @@ -28,11 +28,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -599,7 +599,7 @@ int g_cdb_archive_compare_hash(const GCdbArchive *archive, const rle_string *has static bool g_cdb_archive_create_xml_desc(GCdbArchive *archive, const rle_string *user) { bool result; /* Bilan à retourner */ - char tmp[sizeof(STR(ULLONG_MAX))]; /* Stockage temporaire */ + char tmp[sizeof(XSTR(UINT32_MAX))]; /* Stockage temporaire */ result = create_new_xml_file(&archive->xdoc, &archive->context); if (!result) return false; diff --git a/src/arch/vmpa.c b/src/arch/vmpa.c index 7d57909..fcc1e2f 100644 --- a/src/arch/vmpa.c +++ b/src/arch/vmpa.c @@ -356,23 +356,23 @@ char *vmpa2_phys_to_string(const vmpa2t *addr, MemoryDataSize msize, char buffer switch (msize) { case MDS_8_BITS: - ret = snprintf(buffer, VMPA_MAX_LEN,"0x%02" PRIx64, addr->physical); + ret = snprintf(buffer, VMPA_MAX_LEN,"0x%02" PRIx64, (uint64_t)addr->physical); break; case MDS_16_BITS: - ret = snprintf(buffer, VMPA_MAX_LEN, "0x%04" PRIx64, addr->physical); + ret = snprintf(buffer, VMPA_MAX_LEN, "0x%04" PRIx64, (uint64_t)addr->physical); break; case MDS_32_BITS: - ret = snprintf(buffer, VMPA_MAX_LEN, "0x%08" PRIx64, addr->physical); + ret = snprintf(buffer, VMPA_MAX_LEN, "0x%08" PRIx64, (uint64_t)addr->physical); break; case MDS_64_BITS: - ret = snprintf(buffer, VMPA_MAX_LEN, "0x%016" PRIx64, addr->physical); + ret = snprintf(buffer, VMPA_MAX_LEN, "0x%016" PRIx64, (uint64_t)addr->physical); break; default: - ret = snprintf(buffer, VMPA_MAX_LEN, "0x%" PRIx64, addr->physical); + ret = snprintf(buffer, VMPA_MAX_LEN, "0x%" PRIx64, (uint64_t)addr->physical); break; } diff --git a/src/arch/vmpa.h b/src/arch/vmpa.h index 96e8a56..54dbda9 100644 --- a/src/arch/vmpa.h +++ b/src/arch/vmpa.h @@ -42,7 +42,7 @@ /* Taille de la plus longue chaîne de représentation */ -#define VMPA_MAX_LEN (sizeof(STR(ULLONG_MAX)) + 1) +#define VMPA_MAX_LEN (2 + sizeof(XSTR(UINT64_MAX)) + 1) /* Constitution guidée de tampons pour impression */ #define VMPA_BUFFER(name) char name[VMPA_MAX_LEN] diff --git a/src/common/xml.c b/src/common/xml.c index 36171b3..d01ae9b 100644 --- a/src/common/xml.c +++ b/src/common/xml.c @@ -898,7 +898,7 @@ bool add_content_to_node(xmlDocPtr xdoc, xmlXPathContextPtr context, const char bool add_uint_content_to_node(xmlDocPtr xdoc, xmlXPathContextPtr context, const char *path, unsigned int value) { xmlNodePtr node; /* Noeud à modifier */ - char content[sizeof(STR(UINT_MAX)) + 1];/* Valeur en chaîne */ + char content[sizeof(XSTR(UINT_MAX)) + 1];/* Valeur en chaîne */ if (content == NULL) return true; diff --git a/src/dialogs/storage.c b/src/dialogs/storage.c index cffc2e2..e334f2d 100644 --- a/src/dialogs/storage.c +++ b/src/dialogs/storage.c @@ -409,7 +409,7 @@ static void load_storage_remote_server(GLoadedBinary *binary, GObject *ref) { const char *host; /* Hôte à contacter */ unsigned short port; /* Port de connexion */ - char port_str[sizeof(STR(USHRT_MAX)) + 1]; /* Version chaînée */ + char port_str[sizeof(XSTR(USHRT_MAX)) + 1]; /* Version chaînée */ bool use_remote; /* Utilisation du serveur ? */ GtkEntry *entry; /* Zone de saisie de texte */ GtkToggleButton *checkbutton; /* Activation de la distance */ -- cgit v0.11.2-87-g4458