diff --git a/assemble.c b/assemble.c index bb9cd42..5b28222 100644 --- a/assemble.c +++ b/assemble.c @@ -547,7 +547,7 @@ static int assemble( buffer_free(macbuf); } else { strncpy(macfile, label, sizeof(macfile)); - strncat(macfile, ".MAC", sizeof(macfile) - strlen(macfile)); + strncat(macfile, ".MAC", sizeof(macfile) - strlen(macfile) - 1); my_searchenv(macfile, "MCALL", hitfile, sizeof(hitfile)); if (hitfile[0]) macstr = new_file_stream(hitfile); diff --git a/dumpobj.c b/dumpobj.c index 221fbe4..8399d6e 100644 --- a/dumpobj.c +++ b/dumpobj.c @@ -598,7 +598,7 @@ void got_isd( char *cp, int len) { - printf("ISD len=%o\n"); + printf("ISD len=%o\n", len); } void got_endmod( diff --git a/listing.c b/listing.c index 0a88292..609494b 100644 --- a/listing.c +++ b/listing.c @@ -60,7 +60,7 @@ void list_source( if (!binline) binline = memcheck(malloc(sizeof(LSTFORMAT) + 16)); - sprintf(binline, "%*s%*d", SIZEOF_MEMBER(LSTFORMAT, flag), "", SIZEOF_MEMBER(LSTFORMAT, line_number), + sprintf(binline, "%*s%*d", (int)SIZEOF_MEMBER(LSTFORMAT, flag), "", (int)SIZEOF_MEMBER(LSTFORMAT, line_number), str->line); } } @@ -87,21 +87,18 @@ static void list_fit( STREAM *str, unsigned addr) { - int len = strlen(binline); size_t col1 = offsetof(LSTFORMAT, source); size_t col2 = offsetof(LSTFORMAT, pc); if (strlen(binline) >= col1) { - int offset = offsetof(LSTFORMAT, pc); - list_flush(); listline[0] = 0; binline[0] = 0; - sprintf(binline, "%*s %6.6o", offsetof(LSTFORMAT, pc), "", addr); + sprintf(binline, "%*s %6.6o", (int)offsetof(LSTFORMAT, pc), "", addr); padto(binline, offsetof(LSTFORMAT, words)); } else if (strlen(binline) <= col2) { - sprintf(binline, "%*s%*d %6.6o", SIZEOF_MEMBER(LSTFORMAT, flag), "", - SIZEOF_MEMBER(LSTFORMAT, line_number), str->line, addr); + sprintf(binline, "%*s%*d %6.6o", (int)SIZEOF_MEMBER(LSTFORMAT, flag), "", + (int)SIZEOF_MEMBER(LSTFORMAT, line_number), str->line, addr); padto(binline, offsetof(LSTFORMAT, words)); } } @@ -115,8 +112,8 @@ void list_value( if (dolist()) { /* Print the value and go */ binline[0] = 0; - sprintf(binline, "%*s%*d %6.6o", SIZEOF_MEMBER(LSTFORMAT, flag), "", - SIZEOF_MEMBER(LSTFORMAT, line_number), str->line, word & 0177777); + sprintf(binline, "%*s%*d %6.6o", (int)SIZEOF_MEMBER(LSTFORMAT, flag), "", + (int)SIZEOF_MEMBER(LSTFORMAT, line_number), str->line, word & 0177777); } } diff --git a/macro11.c b/macro11.c index dca93f6..9fa83ce 100644 --- a/macro11.c +++ b/macro11.c @@ -146,9 +146,7 @@ int main( char *fnames[32]; int nr_files = 0; FILE *obj = NULL; - static char line[1024]; TEXT_RLD tr; - char *macname = NULL; char *objname = NULL; char *lstname = NULL; int arg; diff --git a/macros.c b/macros.c index ee9779a..dd2af72 100644 --- a/macros.c +++ b/macros.c @@ -197,7 +197,8 @@ MACRO *defmacro( while (!EOL(*cp)) { arg = new_arg(); - if (arg->locsym = (*cp == '?')) /* special argument flag? */ + arg->locsym = *cp == '?'; + if (arg->locsym) /* special argument flag? */ cp++; arg->label = get_symbol(cp, &cp, NULL); if (arg->label == NULL) { @@ -335,8 +336,8 @@ BUFFER *subst_args( if (issym(*in)) { label = get_symbol(in, &next, NULL); if (label) { - if (arg = find_arg(args, label)) { - /* An apostrophy may appear before or after the symbol. */ + if ((arg = find_arg(args, label))) { + /* An apostrophe may appear before or after the symbol. */ /* In either case, remove it from the expansion. */ if (in > begin && in[-1] == '\'') diff --git a/parse.c b/parse.c index e990b10..c6c2f75 100644 --- a/parse.c +++ b/parse.c @@ -322,7 +322,7 @@ int parse_float( } } - flt[0] = (unsigned) (sign | (exp << 7) | (ufrac >> 48) & 0x7F); + flt[0] = (unsigned) (sign | (exp << 7) | ((ufrac >> 48) & 0x7F)); if (size > 1) { flt[1] = (unsigned) ((ufrac >> 32) & 0xffff); if (size > 2) { @@ -509,7 +509,7 @@ char *get_symbol( if (symcp[len - 1] == '$') { char *newsym = memcheck(malloc(32)); /* Overkill */ - sprintf(newsym, "%d$%d", strtol(symcp, NULL, 10), lsb); + sprintf(newsym, "%ld$%d", strtol(symcp, NULL, 10), lsb); free(symcp); symcp = newsym; if (islocal)