From 63b51ddeb1721c90e9698328efc6a054b922ca12 Mon Sep 17 00:00:00 2001 From: hadaq Date: Sat, 15 Jan 2011 10:37:34 +0000 Subject: [PATCH] minor updates --- libtrbnet/trbcmd.c | 10 +++++++--- libtrbnet/trbdhcp.c | 15 ++++++++++++++- libtrbnet/trbflash.c | 4 ++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/libtrbnet/trbcmd.c b/libtrbnet/trbcmd.c index 1c27cad..a1657a6 100644 --- a/libtrbnet/trbcmd.c +++ b/libtrbnet/trbcmd.c @@ -25,7 +25,7 @@ static int hexMode = HEXMODE; -static const char trbcmd_version[] = "$Revision: 2.63 $"; +static const char trbcmd_version[] = "$Revision: 2.64 $"; #define BACKLOG 10 static uint16_t tcp_port = 55555; @@ -752,7 +752,11 @@ int start(int argc, char **argv) if (trb_debug > 0) { fprintf(stderr, "Command: SET_ADDRESS: " +#ifndef X86_64 "uid: 0x%016llx, " +#else + "uid: 0x%016lx, " +#endif "endpoint: 0x%02x, " "trb_address: 0x%04x\n", uid, endpoint, trb_address); } @@ -1444,7 +1448,7 @@ int main(int argc, char **argv) fprintf(clientout, "\n----------------------------\n\n"); fflush(clientout); if (tcp_debug > 0) { - fprintf(stderr, "%d: received: %i\n", myPid, msgLen); + fprintf(stderr, "%d: received: %i\n", myPid, (int)msgLen); if (msgLen > 0) { fprintf(stderr, "%d: command: ", myPid); for (i = 1; i < (unsigned int)start_argc; i++) { @@ -1474,7 +1478,7 @@ int main(int argc, char **argv) } if (tcp_debug > 0) { - fprintf(stderr, "%d: received: %i\n", myPid, msgLen); + fprintf(stderr, "%d: received: %i\n", myPid, (int)msgLen); if (msgLen > 0) { fprintf(stderr, "%d: command: ", myPid); for (i = 1; i < (unsigned int)start_argc; i++) { diff --git a/libtrbnet/trbdhcp.c b/libtrbnet/trbdhcp.c index ecf092e..1febf6a 100644 --- a/libtrbnet/trbdhcp.c +++ b/libtrbnet/trbdhcp.c @@ -10,7 +10,7 @@ #include #include -static const char trbdhcp_version[] = "$Revision: 1.4 $"; +static const char trbdhcp_version[] = "$Revision: 1.5 $"; typedef struct { uint16_t address; @@ -70,9 +70,14 @@ static int readConfigFile(const char* fileName) *c = '\0'; } +#ifndef X86_64 if (sscanf(line, "%x %llx %x", &address, &uid, &endPoint) != 3) { +#else + if (sscanf(line, "%x %lx %x", &address, &uid, &endPoint) != 3) { +#endif continue; } + if (counter < NUM_ENDPOINTS) { endPointList[counter].address = address; endPointList[counter].uid = uid; @@ -95,7 +100,11 @@ static void dumpList() { unsigned int i; for (i = 0; i < listSize; i++) { +#ifndef X86_64 fprintf(stdout, "Entry #%d: 0x%04x 0x%08llx 0x%02x\n", i, +#else + fprintf(stdout, "Entry #%d: 0x%04x 0x%08lx 0x%02x\n", i, +#endif endPointList[i].address, endPointList[i].uid, endPointList[i].endPoint); @@ -199,7 +208,11 @@ int main(int argc, char ** argv) if (currentAddress != endPointList[j].address) { if (trb_debug > 0) { +#ifndef X86_64 fprintf(stderr, "set address: 0x%04x 0x%08llx 0x%02x\n", +#else + fprintf(stderr, "set address: 0x%04x 0x%08lx 0x%02x\n", +#endif currentAddress, uid, endPoint); } diff --git a/libtrbnet/trbflash.c b/libtrbnet/trbflash.c index a9d6876..9bd6c7e 100644 --- a/libtrbnet/trbflash.c +++ b/libtrbnet/trbflash.c @@ -97,7 +97,7 @@ static const char FlashTypeStr[16][32] = static FlashType flashType = FLASH_INVALID; static uint32_t manId = 0; -static const char trbflash_version[] = "$Revision: 2.25 $"; +static const char trbflash_version[] = "$Revision: 2.26 $"; static uint32_t mdcFlashSelect = 1; @@ -186,7 +186,7 @@ static int readCtrlRegister(uint16_t trb_address, } while (trb_term.status_channel != 0); if (status <= 0) { - fprintf(logFile, "Error > readCtrlRegister: invalid length returned\n"); + fprintf(logFile, "Error > readCtrlRegister: %s\n", trb_strerror()); return -1; } -- 2.43.0