summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-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;