summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-01-14 16:19:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-01-14 16:19:09 (GMT)
commit725304423eccf57b8e829542670b5abe7b00eeb4 (patch)
tree4728c83703b66de8f9a71171cf63e3d6d386effe /src
parent2ad11520c0bfefd68a89689497752983792a96ba (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/arch/immediate.c32
1 files changed, 18 insertions, 14 deletions
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 <inttypes.h>
#include <malloc.h>
#include <stdarg.h>
#include <stdio.h>
@@ -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;