From 725304423eccf57b8e829542670b5abe7b00eeb4 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sat, 14 Jan 2012 16:19:09 +0000 Subject: Removed a lot of warnings when printing 64 values. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@226 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 5 +++++ src/arch/immediate.c | 32 ++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97f215f..0c2c5d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 12-01-14 Cyrille Bagard + * src/arch/immediate.c: + Remove a lot of warnings when printing 64 values. + +12-01-14 Cyrille Bagard + * po/fr.po: Update translations for the View menu. diff --git a/src/arch/immediate.c b/src/arch/immediate.c index 7f4fb47..72faf4c 100644 --- a/src/arch/immediate.c +++ b/src/arch/immediate.c @@ -24,6 +24,7 @@ #include "immediate.h" +#include #include #include #include @@ -429,6 +430,9 @@ static size_t g_imm_operand_to_string(const GImmOperand *operand, AsmSyntax synt { size_t result; /* Longueur à retourner */ + /* Pour gcc (Debian 4.4.5-8) 4.4.5 */ + result = 0; + switch (syntax) { case ASX_INTEL: @@ -464,9 +468,9 @@ static size_t g_imm_operand_to_string(const GImmOperand *operand, AsmSyntax synt case MDS_64_BITS_UNSIGNED: if (operand->zpad) - result = snprintf(value, VMPA_MAX_SIZE, "0x%016llx", operand->unsigned_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "0x%016" PRIx64, operand->unsigned_imm.val64); else - result = snprintf(value, VMPA_MAX_SIZE, "0x%llx", operand->unsigned_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "0x%" PRIx64, operand->unsigned_imm.val64); break; case MDS_4_BITS_SIGNED: @@ -531,16 +535,16 @@ static size_t g_imm_operand_to_string(const GImmOperand *operand, AsmSyntax synt if (operand->zpad) { if (g_imm_operand_is_negative(operand)) - result = snprintf(value, VMPA_MAX_SIZE, "0x%016llx", ~operand->signed_imm.val64 + 1); + result = snprintf(value, VMPA_MAX_SIZE, "0x%016" PRIx64, ~operand->signed_imm.val64 + 1); else - result = snprintf(value, VMPA_MAX_SIZE, "0x%016llx", operand->signed_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "0x%016" PRIx64, operand->signed_imm.val64); } else { if (g_imm_operand_is_negative(operand)) - result = snprintf(value, VMPA_MAX_SIZE, "0x%llx", ~operand->signed_imm.val64 + 1); + result = snprintf(value, VMPA_MAX_SIZE, "0x%" PRIx64, ~operand->signed_imm.val64 + 1); else - result = snprintf(value, VMPA_MAX_SIZE, "0x%llx", operand->signed_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "0x%" PRIx64, operand->signed_imm.val64); } break; } @@ -579,9 +583,9 @@ static size_t g_imm_operand_to_string(const GImmOperand *operand, AsmSyntax synt case MDS_64_BITS_UNSIGNED: if (operand->zpad) - result = snprintf(value, VMPA_MAX_SIZE, "$0x%016llx", operand->unsigned_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "$0x%016" PRIx64, operand->unsigned_imm.val64); else - result = snprintf(value, VMPA_MAX_SIZE, "$0x%llx", operand->unsigned_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "$0x%" PRIx64, operand->unsigned_imm.val64); break; case MDS_4_BITS_SIGNED: @@ -646,16 +650,16 @@ static size_t g_imm_operand_to_string(const GImmOperand *operand, AsmSyntax synt if (operand->zpad) { if (g_imm_operand_is_negative(operand)) - result = snprintf(value, VMPA_MAX_SIZE, "$0x%016llx", ~operand->signed_imm.val64 + 1); + result = snprintf(value, VMPA_MAX_SIZE, "$0x%016" PRIx64, ~operand->signed_imm.val64 + 1); else - result = snprintf(value, VMPA_MAX_SIZE, "$0x%016llx", operand->signed_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "$0x%016" PRIx64, operand->signed_imm.val64); } else { if (g_imm_operand_is_negative(operand)) - result = snprintf(value, VMPA_MAX_SIZE, "$0x%llx", ~operand->signed_imm.val64 + 1); + result = snprintf(value, VMPA_MAX_SIZE, "$0x%" PRIx64, ~operand->signed_imm.val64 + 1); else - result = snprintf(value, VMPA_MAX_SIZE, "$0x%llx", operand->signed_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "$0x%" PRIx64, operand->signed_imm.val64); } break; } @@ -684,7 +688,7 @@ static size_t g_imm_operand_to_string(const GImmOperand *operand, AsmSyntax synt break; case MDS_64_BITS_UNSIGNED: - result = snprintf(value, VMPA_MAX_SIZE, "%llu", operand->unsigned_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "%" PRIu64, operand->unsigned_imm.val64); break; case MDS_4_BITS_SIGNED: @@ -704,7 +708,7 @@ static size_t g_imm_operand_to_string(const GImmOperand *operand, AsmSyntax synt break; case MDS_64_BITS_SIGNED: - result = snprintf(value, VMPA_MAX_SIZE, "%lld", operand->signed_imm.val64); + result = snprintf(value, VMPA_MAX_SIZE, "%" PRId64, operand->signed_imm.val64); break; } break; -- cgit v0.11.2-87-g4458