From 7272f9aec32e86a886da787db6faf1fbe7589ff0 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Wed, 17 Mar 2010 17:27:21 -0400 Subject: [PATCH] change types to match stdint have printf test print the sizes of these. --- lib/include/types.h | 8 ++++---- tests/printf.c | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/include/types.h b/lib/include/types.h index 93bb4d9d5..9c4eb33d5 100644 --- a/lib/include/types.h +++ b/lib/include/types.h @@ -5,9 +5,9 @@ typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; -typedef signed long int32_t; -typedef unsigned long uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int int64_t; +typedef unsigned long long int uint64_t; #endif diff --git a/tests/printf.c b/tests/printf.c index 7208bdb55..0d43f061f 100644 --- a/tests/printf.c +++ b/tests/printf.c @@ -6,6 +6,12 @@ #include "tests.h" #include "config.h" +#define print_size(x) do { \ + printf("sizeof("); \ + printf(#x); \ + printf("): %d\n", sizeof(x)); \ + } while(0) + int main(void) { char *ptr = "Hello world!"; @@ -17,6 +23,15 @@ int main(void) uart_init(INC, MOD, SAMP); + print_size(int8_t); + print_size(uint8_t); + print_size(int16_t); + print_size(uint16_t); + print_size(int32_t); + print_size(uint32_t); + print_size(int64_t); + print_size(uint64_t); + mi = (1 << (bs-1)) + 1; printf("%s\n", ptr); printf("printf test\n"); @@ -39,7 +54,7 @@ int main(void) // sprintf(buf, "-3: %-4d left justif.\n", -3); printf("%s", buf); // sprintf(buf, "-3: %4d right justif.\n", -3); printf("%s", buf); - return 0; + while(1) { continue; } } /*