From: johanknol Date: Tue, 6 Feb 2001 10:49:40 +0000 (+0000) Subject: updated examples for integer promotion in vararg funcs (printf) X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=66685e206ac19d0fa1cf1f6e6658cb88cf548487;p=fw%2Fsdcc updated examples for integer promotion in vararg funcs (printf) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@589 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/device/examples/ds390/i2c390/i2c390.c b/device/examples/ds390/i2c390/i2c390.c index 7bd00d37..ecdbf893 100644 --- a/device/examples/ds390/i2c390/i2c390.c +++ b/device/examples/ds390/i2c390/i2c390.c @@ -7,7 +7,7 @@ void main (void) { while(1) { - printf ("% 5.2f %03bu %03bu %03bu %03bu\n\r", + printf ("% 5.2f %03u %03u %03u %03u\n\r", ReadDS1621(2), ReadPCF8591(0,0), ReadPCF8591(0,1), diff --git a/device/examples/ds390/readmac/readmac.c b/device/examples/ds390/readmac/readmac.c index becf2294..be3b207c 100644 --- a/device/examples/ds390/readmac/readmac.c +++ b/device/examples/ds390/readmac/readmac.c @@ -40,7 +40,7 @@ void main(void) owSerialNum(serial, 1); #ifdef NOISY - printf("found 1-wire device: %02bx%02bx%02bx%02bx%02bx%02bx%02bx%02bx\n", + printf("found 1-wire device: %02x%02x%02x%02x%02x%02x%02x%02x\n", serial[0], serial[1], serial[2], serial[3], serial[4], serial[5], serial[6], serial[7]); #endif @@ -57,7 +57,7 @@ void main(void) if (!rc) { - printf("DS2502 located (ID %02bx%02bx%02bx%02bx%02bx%02bx%02bx%02bx).\n", + printf("DS2502 located (ID %02x%02x%02x%02x%02x%02x%02x%02x).\n", serial[0], serial[1], serial[2], serial[3], serial[4], serial[5], serial[6], serial[7]); /* Build command packet. */ @@ -74,7 +74,7 @@ void main(void) myCRC = docrc8(myCRC, serial[3]); if (myCRC != serial[4]) { - printf("read failed: bogus CRC: %bx != %bx\n", myCRC, serial[4]); + printf("read failed: bogus CRC: %x != %x\n", myCRC, serial[4]); rc = 1; } } @@ -91,7 +91,7 @@ void main(void) printf("DS2502 memory: "); for (i = 0; i < 32; i++) { - printf("%02bx ", serial[i]); + printf("%02x ", serial[i]); } printf("\n"); #endif @@ -105,7 +105,7 @@ void main(void) } } - printf("MAC address: %02bx%02bx%02bx%02bx%02bx%02bx\n", + printf("MAC address: %02x%02x%02x%02x%02x%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); owTouchReset(); diff --git a/device/examples/ds390/rtc390/rtc390.c b/device/examples/ds390/rtc390/rtc390.c index 11e6be36..da5b866f 100755 --- a/device/examples/ds390/rtc390/rtc390.c +++ b/device/examples/ds390/rtc390/rtc390.c @@ -58,7 +58,7 @@ char GetTime(struct RTCDate *rtcDate) { } void PrintTime(struct RTCDate *rtcDate) { - printf ("%04d-%02bd-%02bd %02bd:%02bd:%02bd.%02bd\n", + printf ("%04d-%02d-%02d %02d:%02d:%02d.%02d\n", rtcDate->year, rtcDate->month, rtcDate->day, rtcDate->hour, rtcDate->minute, rtcDate->second, rtcDate->hundredth); @@ -84,9 +84,9 @@ void main (void) { #endif #ifdef USE_LCD - LcdLPrintf (2,"%04d-%02bd-%02bd", + LcdLPrintf (2,"%04d-%02d-%02d", rtcDate.year, rtcDate.month, rtcDate.day); - LcdLPrintf (3, "%02bd:%02bd:%02bd.%02bd", + LcdLPrintf (3, "%02d:%02d:%02d.%02d", rtcDate.hour, rtcDate.minute, rtcDate.second, rtcDate.hundredth); #endif