From owner-svn-src-user@FreeBSD.ORG Mon Aug 29 22:55:38 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 294D0106566B; Mon, 29 Aug 2011 22:55:38 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00C838FC12; Mon, 29 Aug 2011 22:55:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7TMtbA9018011; Mon, 29 Aug 2011 22:55:37 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7TMtbES018006; Mon, 29 Aug 2011 22:55:37 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201108292255.p7TMtbES018006@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 29 Aug 2011 22:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225252 - in user/gabor/grep/trunk: . regex X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2011 22:55:38 -0000 Author: gabor Date: Mon Aug 29 22:55:37 2011 New Revision: 225252 URL: http://svn.freebsd.org/changeset/base/225252 Log: - Fix some warnings - Unfortunately, the code is only WARNS=2 clean at the moment because of the backported regex code Modified: user/gabor/grep/trunk/Makefile user/gabor/grep/trunk/file.c user/gabor/grep/trunk/regex/fastmatch.c user/gabor/grep/trunk/regex/glue.h Modified: user/gabor/grep/trunk/Makefile ============================================================================== --- user/gabor/grep/trunk/Makefile Mon Aug 29 20:36:21 2011 (r225251) +++ user/gabor/grep/trunk/Makefile Mon Aug 29 22:55:37 2011 (r225252) @@ -15,6 +15,8 @@ bsdgrep.1: grep.1 .endif SRCS= file.c grep.c queue.c util.c +WARNS=2 + # Extra files ported backported form some regex improvements .PATH: ${.CURDIR}/regex SRCS+= fastmatch.c hashtable.c tre-fastmatch.c xmalloc.c Modified: user/gabor/grep/trunk/file.c ============================================================================== --- user/gabor/grep/trunk/file.c Mon Aug 29 20:36:21 2011 (r225251) +++ user/gabor/grep/trunk/file.c Mon Aug 29 22:55:37 2011 (r225252) @@ -119,13 +119,14 @@ grep_refill(struct file *f) lstrm.next_out = buffer; lstrm.avail_out = MAXBUFSIZ; lstrm.next_in = in_buf; - lstrm.avail_in = read(f->fd, in_buf, MAXBUFSIZ); + nr = read(f->fd, in_buf, MAXBUFSIZ); - if (lstrm.avail_in < 0) + if (nr < 0) return (-1); - else if (lstrm.avail_in == 0) + else if (nr == 0) action = LZMA_FINISH; + lstrm.avail_in = nr; ret = lzma_code(&lstrm, action); if (ret != LZMA_OK && ret != LZMA_STREAM_END) Modified: user/gabor/grep/trunk/regex/fastmatch.c ============================================================================== --- user/gabor/grep/trunk/regex/fastmatch.c Mon Aug 29 20:36:21 2011 (r225251) +++ user/gabor/grep/trunk/regex/fastmatch.c Mon Aug 29 22:55:37 2011 (r225252) @@ -170,7 +170,7 @@ tre_fastfree(fastmatch_t *preg) size_t offset = pmatch[0].rm_so; \ int ret; \ \ - if ((len != (unsigned)-1) && (pmatch[0].rm_eo > len)) \ + if ((len != (unsigned)-1) && (pmatch[0].rm_eo > (off_t)len)) \ return REG_NOMATCH; \ if ((long long)pmatch[0].rm_eo - pmatch[0].rm_so < 0) \ return REG_NOMATCH; \ Modified: user/gabor/grep/trunk/regex/glue.h ============================================================================== --- user/gabor/grep/trunk/regex/glue.h Mon Aug 29 20:36:21 2011 (r225251) +++ user/gabor/grep/trunk/regex/glue.h Mon Aug 29 22:55:37 2011 (r225252) @@ -3,6 +3,8 @@ #ifndef GLUE_H #define GLUE_H +#include +#undef RE_DUP_MAX #include #define TRE_WCHAR 1