Skip to content

Commit

Permalink
Replace fprint() with fprintf().
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Dec 8, 2024
1 parent 6a4b65d commit 1eca3e3
Show file tree
Hide file tree
Showing 87 changed files with 323 additions and 352 deletions.
6 changes: 3 additions & 3 deletions doc/ceg/ceg.tr
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ struct t_operand *op;
case BX : R233( 0x0, reg, 0x7);
break;

default : fprint( stderr, "Wrong index register %d\en",
default : fprintf( stderr, "Wrong index register %d\en",
op->reg);
}
else {
Expand All @@ -1208,7 +1208,7 @@ struct t_operand *op;
case BX : R233( 0x1, reg, 0x7);
break;

default : fprint( stderr, "Wrong index register %d\en",
default : fprintf( stderr, "Wrong index register %d\en",
op->reg);
}
@text1( %$(op->expr));
Expand All @@ -1226,7 +1226,7 @@ struct t_operand *op;
case BX : R233( 0x2, reg, 0x7);
break;

default : fprint( stderr, "Wrong index register %d\en",
default : fprintf( stderr, "Wrong index register %d\en",
op->reg);
}
@text2( %$(op->expr));
Expand Down
16 changes: 8 additions & 8 deletions lang/basic/src/basic.g
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,20 @@ filelist { int intv; }
]* ;

datastmt: DATASYM { datastmt(); in_data = 1;}
datalist { fprint(datfile,"\n"); in_data = 0; }
datalist { fprintf(datfile,"\n"); in_data = 0; }
;

dataelm : INTVALUE { fprint(datfile,"%d",ival); }
| '-' [ INTVALUE { fprint(datfile,"%d",-ival); }
| FLTVALUE { fprint(datfile,"-%s",dval); }
dataelm : INTVALUE { fprintf(datfile,"%d",ival); }
| '-' [ INTVALUE { fprintf(datfile,"%d",-ival); }
| FLTVALUE { fprintf(datfile,"-%s",dval); }
]
| FLTVALUE { fprint(datfile,dval); }
| STRVALUE { fprint(datfile,"\"%s\"",sval); }
| IDENTIFIER { fprint(datfile,"\"%s\"",sval); }
| FLTVALUE { fprintf(datfile,dval); }
| STRVALUE { fprintf(datfile,"\"%s\"",sval); }
| IDENTIFIER { fprintf(datfile,"\"%s\"",sval); }
;

datalist: dataelm
[ ',' { fprint(datfile,","); }
[ ',' { fprintf(datfile,","); }
dataelm ]*
;

Expand Down
2 changes: 1 addition & 1 deletion lang/basic/src/basic.lex
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int getinputline(void)
error("source line too long");
inputline[MAXLINELENGTH-1]=0;
if ( listing)
fprint(stderr, inputline);
fprintf(stderr, inputline);
cptr= inputline;
return(TRUE);
}
Expand Down
2 changes: 1 addition & 1 deletion lang/basic/src/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void linewarnings(void)
{
if ( !srchline(l->linenr))
{
fprint(stderr, "ERROR: line %d not defined\n",l->linenr);
fprintf(stderr, "ERROR: line %d not defined\n",l->linenr);
errorcnt++;
}
l=l->nextlist;
Expand Down
8 changes: 4 additions & 4 deletions lang/basic/src/llmess.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void error_char(char *format,char ch)
extern int listing,errorcnt;
extern int basicline;

if ( !listing ) fprint(stderr, "LINE %d:",basicline);
fprint(stderr, format,ch);
if ( !listing ) fprintf(stderr, "LINE %d:",basicline);
fprintf(stderr, format,ch);
errorcnt++;
}

Expand All @@ -30,8 +30,8 @@ void error_string(char* format,char* str)
extern int listing,errorcnt;
extern int basicline;

if ( !listing ) fprint(stderr, "LINE %d:",basicline);
fprint(stderr, format,str);
if ( !listing ) fprintf(stderr, "LINE %d:",basicline);
fprintf(stderr, format,str);
errorcnt++;
}

Expand Down
4 changes: 2 additions & 2 deletions lang/basic/src/parsepar.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void parseparams(int argc,char **argv)

if(argc< 4)
{
fprint(stderr,"usage %s <flags> <file> <file> <source>\n",
fprintf(stderr,"usage %s <flags> <file> <file> <source>\n",
argv[0]);
exit(1);
}
Expand All @@ -46,7 +46,7 @@ void parseparams(int argc,char **argv)
case 't': traceflag++;
break; /* line tracing */
case 'h': /* split EM file */
fprint(stderr,
fprintf(stderr,
"h option not implemented\n");
break;
case 'd': debug++;
Expand Down
4 changes: 2 additions & 2 deletions lang/basic/src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ static void Xerror(char *type, char *str)
extern int listing;
extern int basicline;

if( !listing) fprint(stderr, "LINE %d:",basicline);
fprint(stderr, "%s:%s\n",type, str);
if( !listing) fprintf(stderr, "LINE %d:",basicline);
fprintf(stderr, "%s:%s\n",type, str);
}


Expand Down
6 changes: 3 additions & 3 deletions lang/cem/cemcom.ansi/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ static void _error(int class, char *fn, unsigned int ln, char* fmt, va_list ap)
#endif /* LINT */

if (fn)
fprint(ERROUT, "\"%s\", line %u: ", fn, ln);
fprintf(ERROUT, "\"%s\", line %u: ", fn, ln);
if (remark)
fprint(ERROUT, "%s ", remark);
fprintf(ERROUT, "%s ", remark);
doprnt(ERROUT, fmt, ap); /* contents of error */
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
}
6 changes: 3 additions & 3 deletions lang/cem/cemcom/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ _error(class, fn, ln, fmt, ap)
#endif /* LINT */

if (fn)
fprint(ERROUT, "\"%s\", line %u: ", fn, ln);
fprintf(ERROUT, "\"%s\", line %u: ", fn, ln);
if (remark)
fprint(ERROUT, "%s ", remark);
fprintf(ERROUT, "%s ", remark);
doprnt(ERROUT, fmt, ap); /* contents of error */
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
}
4 changes: 2 additions & 2 deletions lang/cem/cemcom/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ char *s, *source;
return;
}
if (options['m'] && source) {
fprint(dep_fd, "%s: %s\n", source, s);
fprintf(dep_fd, "%s: %s\n", source, s);
}
else fprint(dep_fd, "%s\n", s);
else fprintf(dep_fd, "%s\n", s);
}

#endif /* NOPP */
Expand Down
24 changes: 12 additions & 12 deletions lang/cem/cpp.ansi/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ int err_occurred;
static void err_hdr(char *s)
{
if (FileName) {
fprint(ERROUT, "\"%s\", line %d: %s", FileName, (int)LineNumber, s);
fprintf(ERROUT, "\"%s\", line %d: %s", FileName, (int)LineNumber, s);
}
else fprint(ERROUT, s);
else fprintf(ERROUT, s);
}

#if __STDC__
Expand All @@ -42,7 +42,7 @@ void error(char *fmt, ...)
err_hdr("");
va_start(ap, fmt);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
}

Expand All @@ -54,7 +54,7 @@ void warning(char *fmt, ...)
err_hdr("(warning) ");
va_start(ap, fmt);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
}

Expand All @@ -66,7 +66,7 @@ void strict(char *fmt, ...)
err_hdr("(strict) ");
va_start(ap, fmt);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
}

Expand All @@ -78,7 +78,7 @@ NORETURN void crash(char *fmt, ...)
err_hdr("CRASH\007 ");
va_start(ap, fmt);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
abort();
}
Expand All @@ -91,7 +91,7 @@ NORETURN void fatal(char *fmt, ...)
err_hdr("fatal error -- ");
va_start(ap, fmt);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
exit(1);
}
Expand All @@ -108,7 +108,7 @@ void error(va_alist)
va_start(ap);
fmt = va_arg(ap, char *);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
}

Expand All @@ -123,7 +123,7 @@ void warning(va_alist)
va_start(ap);
fmt = va_arg(ap, char *);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
}

Expand All @@ -138,7 +138,7 @@ void strict(va_alist)
va_start(ap);
fmt = va_arg(ap, char *);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
}

Expand All @@ -153,7 +153,7 @@ void crash(va_alist)
va_start(ap);
fmt = va_arg(ap, char *);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
abort();
}
Expand All @@ -169,7 +169,7 @@ void fatal(va_alist)
va_start(ap);
fmt = va_arg(ap, char *);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
va_end(ap);
exit(1);
}
Expand Down
4 changes: 2 additions & 2 deletions lang/cem/cpp.ansi/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void dependency(char *s, char *source)
return;
}
if (options['m'] && source) {
fprint(dep_fd, "%s: %s\n", source, s);
fprintf(dep_fd, "%s: %s\n", source, s);
}
else fprint(dep_fd, "%s\n", s);
else fprintf(dep_fd, "%s\n", s);
}
2 changes: 1 addition & 1 deletion lang/cem/lint/lpass2/l_print3ack.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
printf(format) char *format; { ; }

/* FORMAT1 */
fprint(filep, format) FILE* filep; char *format; { ; }
fprintf(filep, format) FILE* filep; char *format; { ; }
/* FORMAT1 */
sprintf(s, format) char *s; char *format; { ; }
/* FORMAT1 */
Expand Down
24 changes: 12 additions & 12 deletions lang/cem/lint/lpass2/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ report(va_alist)
/* otherwise, we have used up the argument,
so print it here
*/
fprint(MSGOUT, "\"%s\", line %d",
fprintf(MSGOUT, "\"%s\", line %d",
fn, id->id_line);
}
while ((fc = *f++)) {
Expand All @@ -84,11 +84,11 @@ report(va_alist)
break;
case 's': /* a string item */
s = va_arg(ap, char *);
fprint(MSGOUT, "%s", s);
fprintf(MSGOUT, "%s", s);
break;
case 'd': /* an int item */
i = va_arg(ap, int);
fprint(MSGOUT, "%d", i);
fprintf(MSGOUT, "%d", i);
break;
default:
panic("internal error: bad format %s",
Expand All @@ -97,10 +97,10 @@ report(va_alist)
}
}
else {
fprint(MSGOUT, "%c", fc);
fprintf(MSGOUT, "%c", fc);
}
}
fprint(MSGOUT, "\n");
fprintf(MSGOUT, "\n");
}
va_end(ap);
}
Expand All @@ -111,14 +111,14 @@ rep_loc(id)
{
/* a definition can come from a number of places */
if (!id) {
fprint(MSGOUT, "format");
fprintf(MSGOUT, "format");
}
else
if (is_class(id, CL_LIB)) {
fprint(MSGOUT, "library");
fprintf(MSGOUT, "library");
}
else {
fprint(MSGOUT, "\"%s\", line %d",
fprintf(MSGOUT, "\"%s\", line %d",
id->id_file, id->id_line);
}
}
Expand All @@ -131,9 +131,9 @@ panic(char *fmt, ...) /* fmt, args */

va_start(ap, fmt);
{
fprint(ERROUT, "PANIC, lint, pass2: line %d: ", LineNr);
fprintf(ERROUT, "PANIC, lint, pass2: line %d: ", LineNr);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
}
va_end(ap);

Expand All @@ -150,9 +150,9 @@ panic(va_alist) /* fmt, args */
{
char *fmt = va_arg(ap, char *);

fprint(ERROUT, "PANIC, lint, pass2: line %d: ", LineNr);
fprintf(ERROUT, "PANIC, lint, pass2: line %d: ", LineNr);
doprnt(ERROUT, fmt, ap);
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
}
va_end(ap);

Expand Down
6 changes: 3 additions & 3 deletions lang/m2/comp/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ static void _error(int class, struct node *node, char *fmt, va_list ap, int warn
break;
}

if (FileName) fprint(ERROUT, "\"%s\", line %u: ", FileName, ln);
if (FileName) fprintf(ERROUT, "\"%s\", line %u: ", FileName, ln);

if (remark) fprint(ERROUT, "%s ", remark);
if (remark) fprintf(ERROUT, "%s ", remark);

doprnt(ERROUT, fmt, ap); /* contents of error */
fprint(ERROUT, "\n");
fprintf(ERROUT, "\n");
}
4 changes: 2 additions & 2 deletions lang/m2/comp/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main(int argc, char **argv)
}
Nargv[Nargc] = 0; /* terminate the arg vector */
if (Nargc < 2) {
fprint(stderr, "%s: Use a file argument\n", ProgName);
fprintf(stderr, "%s: Use a file argument\n", ProgName);
exit(1);
}
exit(Compile(Nargv[1], Nargv[2]) ? 0 : 1);
Expand All @@ -96,7 +96,7 @@ int Compile(char *src, char *dst)
extern struct tokenname tkidf[];

if (! InsertFile(src, (char **) 0, &src)) {
fprint(stderr,"%s: cannot open %s\n", ProgName, src);
fprintf(stderr,"%s: cannot open %s\n", ProgName, src);
return 0;
}
LineNumber = 1;
Expand Down
Loading

0 comments on commit 1eca3e3

Please sign in to comment.