From: Graeme Hinchliffe Date: Sun, 1 Jan 2012 18:22:47 +0000 (+0000) Subject: Updated printf commands that were complaining about long-words as necessary. X-Git-Tag: 1.3.0~41 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=2b2451777ddcb27f2b1c21c6551085a7a35e6701 Updated printf commands that were complaining about long-words as necessary. Updated date in copyright from 2011 to 2011-2012 --- diff --git a/debug.c b/debug.c index 7552048..fc30293 100644 --- a/debug.c +++ b/debug.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System // DEBUG.C - Debugging Messages -// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2012 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source Utilised with the Kind Permission of Landon Dyer // @@ -44,10 +44,10 @@ TOKEN * printexpr(TOKEN * tp) ++tp; break; case CONST: - printf("$%lx ", *tp++); + printf("$%ux ", *tp++); break; case ACONST: - printf("ACONST=($%lx,$%lx) ", *tp, tp[1]); + printf("ACONST=($%ux,$%ux) ", *tp, tp[1]); tp += 2; break; default: @@ -69,7 +69,7 @@ int chdump(CHUNK * ch, int format) { while (ch != NULL) { - printf("chloc=$%08lx, chsize=$%lx\n", ch->chloc, ch->ch_size); + printf("chloc=$%08ux, chsize=$%ux\n", ch->chloc, ch->ch_size); mdump(ch->chptr, ch->ch_size, format, ch->chloc); ch = ch->chnext; } @@ -101,7 +101,7 @@ int fudump(CHUNK * ch) file = *p.wp++; line = *p.wp++; - printf("$%04x $%08lx %d.%d: ", (int)attr, loc, (int)file, (int)line); + printf("$%04x $%08ux %d.%d: ", (int)attr, loc, (int)file, (int)line); if (attr & FU_EXPR) { @@ -139,11 +139,11 @@ int mudump(void) for(mch=firstmch; mch!=NULL; mch=mch->mcnext) { - printf("mch=$%08lx mcptr=$%08lx mcalloc=$%lx mcused=$%x\n", - (unsigned long int)mch, - (unsigned long int)(mch->mcptr.lw), + printf("mch=$%08ux mcptr=$%08ux mcalloc=$%ux mcused=$%x\n", + (uint32_t)mch, + (mch->mcptr.lw), mch->mcalloc, - (unsigned int)(mch->mcused)); + (mch->mcused)); p = mch->mcptr; @@ -163,7 +163,7 @@ int mudump(void) if (w & MSYMBOL) symbol = *p.sy++; - printf("m=$%04x to=%d loc=$%lx from=%d siz=%s", + printf("m=$%04x to=%d loc=$%ux from=%d siz=%s", w, w & 0x00ff, loc, from, (w & MLONG) ? "long" : "word"); if (symbol != NULL) @@ -201,7 +201,7 @@ int mdump(char *start, LONG count, int flg, LONG base) { } j = i; if(base != -1) - printf("%08lx ", base); + printf("%08ux ", base); } switch(flg & 3) { @@ -256,14 +256,14 @@ int dumptok(TOKEN * tk) if (*tk >= 128) { - printf("REG=%ld", *tk++ - 128); + printf("REG=%ud", *tk++ - 128); continue; } switch ((int)*tk++) { case CONST: // CONST - printf("CONST=%ld", *tk++); + printf("CONST=%ud", *tk++); break; case STRING: // STRING
printf("STRING='%s'", (char *)*tk++); @@ -318,7 +318,7 @@ int dump_everything(void) { for(i = 1; i < NSECTS; ++i) if(sect[i].scattr & SUSED) { - printf("Section %d sloc=$%lx\n", i, sect[i].sloc); + printf("Section %d sloc=$%ux\n", i, sect[i].sloc); printf("Code:\n"); chdump(sect[i].sfcode, 1); @@ -330,7 +330,7 @@ int dump_everything(void) { printf("\nMarks:\n"); mudump(); // Dump marks - printf("Total memory allocated=$%lx\n", amemtot); + printf("Total memory allocated=$%ux\n", amemtot); return(0); } diff --git a/listing.c b/listing.c index b3f40dd..265f47c 100644 --- a/listing.c +++ b/listing.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System // LISTING.C - Listing Output -// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2012 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source Utilised with the Kind Permission of Landon Dyer // ------------------------------------------------------------------------------------------------- @@ -256,10 +256,10 @@ void listeol(void) { LONG count; int fixcount; - DEBUG printf("~list: lsloc=$%lx sloc=$%lx\n", lsloc, sloc); + DEBUG printf("~list: lsloc=$%ux sloc=$%ux\n", lsloc, sloc); if(lsloc != sloc) { - sprintf(buf, "%08lx", lsloc); + sprintf(buf, "%08ux", lsloc); scopy(lnimage+LOC_COL, buf, 8); } @@ -296,7 +296,7 @@ void listeol(void) { uc_ln(lnimage); ship_ln(lnimage); lnfill(lnimage, SRC_COL, SPACE); // Fill with spaces - sprintf(buf, "%08lx", lsloc); + sprintf(buf, "%08ux", lsloc); scopy(lnimage+LOC_COL, buf, 8); } @@ -360,7 +360,7 @@ void lstout(char tag) { // int listvalue(VALUE v) { - sprintf(buf, "=%08lx", v); + sprintf(buf, "=%08ux", v); scopy(lnimage+DATA_COL-1, buf, 9); return(0); } diff --git a/mark.c b/mark.c index 407cded..96468bc 100644 --- a/mark.c +++ b/mark.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System // MARK.C - A record of things that are defined relative to any of the sections -// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2012 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source Utilised with the Kind Permission of Landon Dyer // @@ -202,7 +202,7 @@ LONG bsdmarkimg(char *mp, LONG siz, LONG tsize, int reqseg) { diff |= ((LONG)(*dp++ & 0xff)) << 16; diff |= ((LONG)(*dp++ & 0xff)) << 8; diff |= (LONG)(*dp & 0xff); - DEBUG printf("diff=%lx ==> ", diff); + DEBUG printf("diff=%ux ==> ", diff); if(rflag & 0x01) diff = ((diff >> 16) & 0x0000FFFF) | ((diff << 16) & 0xFFFF0000); diff += sect[TEXT].sloc; @@ -215,7 +215,7 @@ LONG bsdmarkimg(char *mp, LONG siz, LONG tsize, int reqseg) { *dp++ = (char)(diff >> 16); *dp++ = (char)(diff >> 8); *dp = (char)diff; - DEBUG printf("%lx\n", diff); + DEBUG printf("%ux\n", diff); } } } diff --git a/symbol.c b/symbol.c index b82582a..747c5a7 100644 --- a/symbol.c +++ b/symbol.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System // SYMBOL.C - Symbol Handling -// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2012 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source Utilised with the Kind Permission of Landon Dyer // @@ -364,7 +364,7 @@ int symtable(void) { c1 = tdb_text[w & TDB]; if(c == 'x') strcpy(ln2, "external"); else { - sprintf(ln2, "%08lx", q->svalue); + sprintf(ln2, "%08ux", q->svalue); uc_string(ln2); } diff --git a/token.c b/token.c index 225a257..6b0a3e6 100644 --- a/token.c +++ b/token.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System // TOKEN.C - Token Handling -// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2012 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source Utilised with the Kind Permission of Landon Dyer // @@ -263,7 +263,7 @@ int mexpand(char * src, char * dest, int destsiz) } goto copy_d; case '~': // ==> unique label string Mnnnn... - sprintf(numbuf, "M%ld", curuniq); + sprintf(numbuf, "M%ud", curuniq); copystr: @@ -365,7 +365,7 @@ int mexpand(char * src, char * dest, int destsiz) continue; break; case CONST: - sprintf(numbuf, "$%lx", (LONG)*tk++); + sprintf(numbuf, "$%ux", (LONG)*tk++); d = numbuf; break; case DEQUALS: