Date: Tue, 24 Jun 2008 16:20:16 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 144027 for review Message-ID: <200806241620.m5OGKGpj096461@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=144027 Change 144027 by gabor@gabor_server on 2008/06/24 16:20:03 - Drop some unnecessary function parameters Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/file.c#9 edit .. //depot/projects/soc2008/gabor_textproc/grep/grep.h#24 edit .. //depot/projects/soc2008/gabor_textproc/grep/util.c#38 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/file.c#9 (text+ko) ==== @@ -60,7 +60,7 @@ }; struct file * -grep_stdin_open(char *mode) +grep_stdin_open(void) { struct file *f; @@ -70,7 +70,7 @@ f->type = FILE_STDIO; f->noseek = isatty(FILE_STDIO); - if ((f->f = fdopen(FILE_STDIO, mode)) != NULL) + if ((f->f = fdopen(FILE_STDIO, "r")) != NULL) return (f); free(f); @@ -78,7 +78,7 @@ } struct file * -grep_open(char *path, char *mode) +grep_open(char *path) { struct file *f; @@ -90,12 +90,12 @@ /* XXX: pre-extract gzip and bzip2 files */ /* try mmap first; if it fails, try stdio */ - if ((f->mmf = mmopen(fname, mode)) != NULL) { + if ((f->mmf = mmopen(fname, "r")) != NULL) { f->type = FILE_MMAP; return (f); } f->type = FILE_STDIO; - if ((f->f = fopen(path, mode)) != NULL) + if ((f->f = fopen(path, "r")) != NULL) return (f); free(f); ==== //depot/projects/soc2008/gabor_textproc/grep/grep.h#24 (text+ko) ==== @@ -129,8 +129,8 @@ /* file.c */ struct file; -struct file *grep_stdin_open(char *mode); -struct file *grep_open(char *path, char *mode); +struct file *grep_stdin_open(void); +struct file *grep_open(char *path); int grep_bin_file(struct file *f); char *grep_fgetln(struct file *f, size_t *l); void grep_close(struct file *f); ==== //depot/projects/soc2008/gabor_textproc/grep/util.c#38 (text+ko) ==== @@ -135,9 +135,9 @@ fn = label; else fn = getstr(1); - f = grep_stdin_open("r"); + f = grep_stdin_open(); } else { - f = grep_open(fn, "r"); + f = grep_open(fn); } if (f == NULL) { if (!sflag)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806241620.m5OGKGpj096461>