From owner-p4-projects@FreeBSD.ORG Thu Jun 4 15:27:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E06221065674; Thu, 4 Jun 2009 15:27:53 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A05D11065672 for ; Thu, 4 Jun 2009 15:27:53 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8DF638FC0C for ; Thu, 4 Jun 2009 15:27:53 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n54FRr49093505 for ; Thu, 4 Jun 2009 15:27:53 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n54FRrps093503 for perforce@freebsd.org; Thu, 4 Jun 2009 15:27:53 GMT (envelope-from gabor@freebsd.org) Date: Thu, 4 Jun 2009 15:27:53 GMT Message-Id: <200906041527.n54FRrps093503@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 163495 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 15:27:54 -0000 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;