summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/comm-mac.ch
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2021-02-19 12:34:28 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2021-02-19 12:34:28 +0000
commit301b1d4268858508a0a144e685087f125aab5dc5 (patch)
tree82d3968b38d76fc1e97207ddf255ee199f5f7246 /Build/source/texk/web2c/cwebdir/comm-mac.ch
parent6a10f6706019d969e3de5568e6016a2c98f014d0 (diff)
[CWEB] Replace 'boolean' values upstream.
git-svn-id: svn://tug.org/texlive/trunk@57795 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/comm-mac.ch')
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-mac.ch25
1 files changed, 14 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/cwebdir/comm-mac.ch b/Build/source/texk/web2c/cwebdir/comm-mac.ch
index e7f36a74d9d..e3c601c47bf 100644
--- a/Build/source/texk/web2c/cwebdir/comm-mac.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-mac.ch
@@ -18,12 +18,12 @@ support |feof|, |getc|, and |ungetc| you may have to change things here.
static boolean input_ln(FILE *);@/
@ @c
-static boolean input_ln(@t\1\1@> /* copies a line into |buffer| or returns 0 */
+static boolean input_ln(@t\1\1@> /* copies a line into |buffer| or returns |false| */
FILE *fp@t\2\2@>) /* what file to read from */
{
register int c=EOF; /* character read; initialized so some compilers won't complain */
register char *k; /* where next character goes */
- if (feof(fp)) return(0); /* we have hit end-of-file */
+ if (feof(fp)) return(false); /* we have hit end-of-file */
limit = k = buffer; /* beginning of buffer */
while (k<=buffer_end && (c=getc(fp)) != EOF && c!='\n')
if ((*(k++) = c) != ' ') limit = k;
@@ -32,9 +32,9 @@ FILE *fp@t\2\2@>) /* what file to read from */
ungetc(c,fp); loc=buffer; err_print("! Input line too long");
@.Input line too long@>
}
- if (c==EOF && limit==buffer) return(0); /* there was nothing after
+ if (c==EOF && limit==buffer) return(false); /* there was nothing after
the last newline */
- return(1);
+ return(true);
}
@y
@ In the unlikely event that your standard I/O library does not
@@ -45,27 +45,30 @@ line endings, so that \.{CWEB} will works with ASCII files stored in
\UNIX/, {\mc DOS} or {\mc MAC} format.
@^system dependencies@>
-@c
-static boolean input_ln(@t\1\1@> /* copies a line into |buffer| or returns 0 */
+@<Predecl...@>=
+static boolean input_ln(FILE *);@/
+
+@ @c
+static boolean input_ln(@t\1\1@> /* copies a line into |buffer| or returns |false| */
FILE *fp@t\2\2@>) /* what file to read from */
{
register int c=EOF; /* character read; initialized so some compilers won't complain */
register char *k; /* where next character goes */
- if (feof(fp)) return(0); /* we have hit end-of-file */
+ if (feof(fp)) return(false); /* we have hit end-of-file */
limit = k = buffer; /* beginning of buffer */
- while (1) {
+ while (true) {
c = getc(fp);
- if (c==EOF) return (limit!=buffer); /* 0, if there was nothing after
+ if (c==EOF) return (limit!=buffer); /* |false|, if there was nothing after
the last newline */
else if (c=='\n' || c=='\r') { /* we have hit end-of-line */
int d = getc(fp);
if (c+d!='\n'+'\r') /* no combination |"\n\r"| or |"\r\n"| */
ungetc(d,fp);
- return (1);
+ return (true);
}
else if (k>buffer_end) {
ungetc(c,fp); loc=buffer; err_print("! Input line too long");
- return (1);
+ return (true);
@.Input line too long@>
}
else