src/test_* : Fix printing of int64_t values.

This commit is contained in:
Erik de Castro Lopo 2008-09-29 18:00:22 +10:00
parent 548daca9b7
commit 0b0c66d5df
3 changed files with 9 additions and 10 deletions

View File

@ -3,6 +3,9 @@
* src/file_io.c
Use intptr_t instead of long for return value of _get_osfhandle.
* src/test_conversions.c src/test_endswap.tpl
Fix printing of int64_t values.
2008-09-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* examples/*

View File

@ -23,6 +23,7 @@
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <inttypes.h>
#include "common.h"
#include "test_main.h"
@ -87,7 +88,7 @@ conversion_test (char endian)
cmp_test (__LINE__, i16, t16, "\n\nLine %d : 16 bit int failed 0x%x -> 0x%x.\n\n") ;
cmp_test (__LINE__, i24, t24, "\n\nLine %d : 24 bit int failed 0x%x -> 0x%x.\n\n") ;
cmp_test (__LINE__, i32, t32, "\n\nLine %d : 32 bit int failed 0x%x -> 0x%x.\n\n") ;
cmp_test (__LINE__, i64, t64, "\n\nLine %d : 64 bit int failed 0x%llx -> 0x%llx.\n\n") ;
cmp_test (__LINE__, i64, t64, "\n\nLine %d : 64 bit int failed 0x%" PRIx64 "x -> 0x%" PRIx64 "x.\n\n") ;
remove (filename) ;
puts ("ok") ;

View File

@ -21,14 +21,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <inttypes.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <errno.h>
#include "common.h"
#include "sfendian.h"
@ -36,12 +36,7 @@
#define FMT_SHORT "0x%04x\n"
#define FMT_INT "0x%08x\n"
#if SIZEOF_INT64_T == SIZEOF_LONG
#define FMT_INT64 "0x%016lx\n"
#else
#define FMT_INT64 "0x%016llx\n"
#endif
#define FMT_INT64 "0x%016" PRIx64 "\n"
/*==============================================================================
** Test functions.