From 59a8da29ef83592d1b880eb6bd5ab365d706cf84 Mon Sep 17 00:00:00 2001 From: Jim Rees Date: Mon, 18 Jun 2001 16:00:51 +0000 Subject: PalmOS fixes --- lib/libsectok/atr.c | 19 ++++++++----------- lib/libsectok/todos_atr.c | 10 ++++++---- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/libsectok/atr.c b/lib/libsectok/atr.c index bff4f498cb9..39e64b52324 100644 --- a/lib/libsectok/atr.c +++ b/lib/libsectok/atr.c @@ -1,4 +1,4 @@ -/* $Id: atr.c,v 1.3 2001/06/08 15:04:02 rees Exp $ */ +/* $Id: atr.c,v 1.4 2001/06/18 16:00:50 rees Exp $ */ /* copyright 1997, 1999, 2000, 2001 @@ -41,20 +41,17 @@ such damages. #include #include #include -#include +#include +#include "field.h" +typedef long int32_t; #else #include -#endif #include +#include +#endif #include "sectok.h" -#ifdef __palmos__ -#undef printf -#undef sprintf -#define printf palmprintf -#endif - /* Global interface bytes */ #define TA1 (tpb[0][0]) #define TB1 (tpb[0][1]) @@ -110,7 +107,7 @@ static short Dtab[] = { -1, 1, 2, 4, 8, 16, 32, -1, 12, 20, -1, -1, -1, -1, -1, static struct bps { unsigned char Fi, Di; - long bps; + int32_t bps; } bps[] = { { 0x01, 0x08, 115464 }, { 0x09, 0x05, 111856 }, @@ -275,7 +272,7 @@ parse_atr(int ttyn, int flags, unsigned char *atr, int len, struct scparam *para for (i = 0; bps[i].bps; i++) { if (((TA1 >> 4) & 0xf) >= bps[i].Fi && (TA1 & 0xf) >= bps[i].Di) { if (flags & SCRV) - printf("speed %ld\n", bps[i].bps); + printf("speed %ld\n", (long) bps[i].bps); Fi = bps[i].Fi; Di = bps[i].Di; break; diff --git a/lib/libsectok/todos_atr.c b/lib/libsectok/todos_atr.c index 53a56fadf69..f71311ece4a 100644 --- a/lib/libsectok/todos_atr.c +++ b/lib/libsectok/todos_atr.c @@ -1,4 +1,4 @@ -/* $Id: todos_atr.c,v 1.4 2001/06/08 15:04:05 rees Exp $ */ +/* $Id: todos_atr.c,v 1.5 2001/06/18 16:00:50 rees Exp $ */ /* copyright 1997, 1999, 2000 @@ -44,9 +44,11 @@ such damages. #include #include #include "field.h" +typedef long int32_t; #else #include #include +#include #endif #include "sectok.h" @@ -120,7 +122,7 @@ static short Dtab[] = { -1, 1, 2, 4, 8, 16, 32, -1, 12, 20, -1, -1, -1, -1, -1, static struct bps { unsigned char Fi, Di; - long bps; + int32_t bps; } bps[] = { { 0x01, 0x08, 115464 }, { 0x09, 0x05, 111856 }, @@ -287,7 +289,7 @@ todos_get_atr(int ttyn, int flags, unsigned char *atr, struct scparam *param) pps[3] = 0; if (flags & SCRV) - printf("speed %ld\n", bps[i].bps); + printf("speed %ld\n", (long) bps[i].bps); #ifdef SCPPS /* Compute checksum */ @@ -304,7 +306,7 @@ todos_get_atr(int ttyn, int flags, unsigned char *atr, struct scparam *param) if (todos_scsetspeed(ttyn, bps[i].bps) < 0) { /* We already sent the pps, can't back out now, so fail. */ if (flags & SCRV) - printf("scsetspeed %ld failed\n", bps[i].bps); + printf("scsetspeed %ld failed\n", (long) bps[i].bps); param->t = -1; return len; } -- cgit v1.2.3