summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Rees <rees@cvs.openbsd.org>2001-06-18 16:00:51 +0000
committerJim Rees <rees@cvs.openbsd.org>2001-06-18 16:00:51 +0000
commit59a8da29ef83592d1b880eb6bd5ab365d706cf84 (patch)
tree43ac82ed9354d9585166686dfbecfdcabc7b0f3a
parent64878b056410d1027d18edcb43ccd2822335d031 (diff)
PalmOS fixes
-rw-r--r--lib/libsectok/atr.c19
-rw-r--r--lib/libsectok/todos_atr.c10
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 <System/SysAll.h>
#include <System/MemoryMgr.h>
#include <System/Unix/unix_stdlib.h>
-#include <System/Unix/sys_socket.h>
+#include <UI/UIAll.h>
+#include "field.h"
+typedef long int32_t;
#else
#include <stdio.h>
-#endif
#include <string.h>
+#include <sys/types.h>
+#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 <System/Unix/unix_string.h>
#include <UI/UIAll.h>
#include "field.h"
+typedef long int32_t;
#else
#include <stdio.h>
#include <string.h>
+#include <sys/types.h>
#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;
}