Date: Thu, 4 Jun 2009 15:27:53 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 163495 for review Message-ID: <200906041527.n54FRrps093503@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=163495 Change 163495 by gabor@gabor_server on 2009/06/04 15:27:26 - C99-ify bool variable - style Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/file.c#45 edit .. //depot/projects/soc2008/gabor_textproc/grep/grep.h#51 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/file.c#45 (text+ko) ==== @@ -131,7 +131,7 @@ /* Only pre-read to the buffer if we need the binary check. */ if (binbehave != BINFILE_TEXT) { - if (f->stdin == 1) + if (f->stdin) st.st_size = MAXBUFSIZ; else if (stat(fname, &st) != 0) err(2, NULL); @@ -147,7 +147,7 @@ binbuf[i++] = ch; } - f->binary = memchr(binbuf, (filebehave != FILE_GZIP) ? '\0' : '\200', i - 1) != 0; + f->binary = memchr(binbuf, (filebehave != FILE_GZIP) ? '\0' : '\200', i - 1) != NULL; } binbufsiz = i; binbufptr = binbuf; @@ -190,7 +190,7 @@ f = grep_malloc(sizeof *f); if ((f->f = fdopen(STDIN_FILENO, "r")) != NULL) { - f->stdin = 1; + f->stdin = true; return (f); } @@ -210,7 +210,7 @@ f = grep_malloc(sizeof *f); - f->stdin = 0; + f->stdin = false; switch (filebehave) { case FILE_STDIO: if ((f->f = fopen(path, "r")) != NULL) ==== //depot/projects/soc2008/gabor_textproc/grep/grep.h#51 (text+ko) ==== @@ -78,8 +78,8 @@ #define MAX_LINE_MATCHES 32 struct file { - int binary; - int stdin; + bool binary; + bool stdin; FILE *f; struct mmfile *mmf; gzFile *gzf;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906041527.n54FRrps093503>