From owner-svn-src-head@freebsd.org Tue Sep 22 07:40:56 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9B2A06B01; Tue, 22 Sep 2015 07:40:56 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4949E1E83; Tue, 22 Sep 2015 07:40:56 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8M7euKv006174; Tue, 22 Sep 2015 07:40:56 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8M7euD9006173; Tue, 22 Sep 2015 07:40:56 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201509220740.t8M7euD9006173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 22 Sep 2015 07:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288098 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 07:40:56 -0000 Author: rodrigc Date: Tue Sep 22 07:40:55 2015 New Revision: 288098 URL: https://svnweb.freebsd.org/changeset/base/288098 Log: Use proper function prototype for readdir(). Eliminates -Wstrict-prototypes warning Submitted by: Joerg Sonnenberger Obtained from: DragonFlyBSD (commit 2a6aec8dab58c89961cabcfdb92e0d0ae256dea4) Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c ============================================================================== --- head/lib/libc/gen/glob.c Tue Sep 22 07:31:40 2015 (r288097) +++ head/lib/libc/gen/glob.c Tue Sep 22 07:40:55 2015 (r288098) @@ -650,13 +650,7 @@ glob3(Char *pathbuf, Char *pathend, Char int err; char buf[MAXPATHLEN]; - /* - * The readdirfunc declaration can't be prototyped, because it is - * assigned, below, to two functions which are prototyped in glob.h - * and dirent.h as taking pointers to differently typed opaque - * structures. - */ - struct dirent *(*readdirfunc)(); + struct dirent *(*readdirfunc)(DIR *); if (pathend > pathend_last) return (GLOB_ABORTED); @@ -677,12 +671,14 @@ glob3(Char *pathbuf, Char *pathend, Char err = 0; - /* Search directory for matching names. */ + /* pglob->gl_readdir takes a void *, fix this manually */ if (pglob->gl_flags & GLOB_ALTDIRFUNC) - readdirfunc = pglob->gl_readdir; + readdirfunc = (struct dirent *(*)(DIR *))pglob->gl_readdir; else readdirfunc = readdir; - while ((dp = (*readdirfunc)(dirp))) { + + /* Search directory for matching names. */ + while ((dp = (*readdirfunc)(dirp)) != NULL) { char *sc; Char *dc; wchar_t wc;