From owner-svn-src-all@FreeBSD.ORG Thu Dec 29 22:15:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D2CF106566C; Thu, 29 Dec 2011 22:15:19 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E575F8FC13; Thu, 29 Dec 2011 22:15:18 +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 pBTMFIQn075501; Thu, 29 Dec 2011 22:15:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBTMFIxD075499; Thu, 29 Dec 2011 22:15:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201112292215.pBTMFIxD075499@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 29 Dec 2011 22:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228972 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2011 22:15:19 -0000 Author: jilles Date: Thu Dec 29 22:15:18 2011 New Revision: 228972 URL: http://svn.freebsd.org/changeset/base/228972 Log: libc: Eliminate some relative relocations in file flags table. Modified: head/lib/libc/gen/strtofflags.c Modified: head/lib/libc/gen/strtofflags.c ============================================================================== --- head/lib/libc/gen/strtofflags.c Thu Dec 29 21:17:35 2011 (r228971) +++ head/lib/libc/gen/strtofflags.c Thu Dec 29 22:15:18 2011 (r228972) @@ -41,35 +41,35 @@ __FBSDID("$FreeBSD$"); #include #include +#define longestflaglen 12 static struct { - char *name; + char name[longestflaglen + 1]; + char invert; u_long flag; - int invert; -} mapping[] = { +} const mapping[] = { /* shorter names per flag first, all prefixed by "no" */ - { "nosappnd", SF_APPEND, 0 }, - { "nosappend", SF_APPEND, 0 }, - { "noarch", SF_ARCHIVED, 0 }, - { "noarchived", SF_ARCHIVED, 0 }, - { "noschg", SF_IMMUTABLE, 0 }, - { "noschange", SF_IMMUTABLE, 0 }, - { "nosimmutable", SF_IMMUTABLE, 0 }, - { "nosunlnk", SF_NOUNLINK, 0 }, - { "nosunlink", SF_NOUNLINK, 0 }, + { "nosappnd", 0, SF_APPEND }, + { "nosappend", 0, SF_APPEND }, + { "noarch", 0, SF_ARCHIVED }, + { "noarchived", 0, SF_ARCHIVED }, + { "noschg", 0, SF_IMMUTABLE }, + { "noschange", 0, SF_IMMUTABLE }, + { "nosimmutable", 0, SF_IMMUTABLE }, + { "nosunlnk", 0, SF_NOUNLINK }, + { "nosunlink", 0, SF_NOUNLINK }, #ifdef SF_SNAPSHOT - { "nosnapshot", SF_SNAPSHOT, 0 }, + { "nosnapshot", 0, SF_SNAPSHOT }, #endif - { "nouappnd", UF_APPEND, 0 }, - { "nouappend", UF_APPEND, 0 }, - { "nouchg", UF_IMMUTABLE, 0 }, - { "nouchange", UF_IMMUTABLE, 0 }, - { "nouimmutable", UF_IMMUTABLE, 0 }, - { "nodump", UF_NODUMP, 1 }, - { "noopaque", UF_OPAQUE, 0 }, - { "nouunlnk", UF_NOUNLINK, 0 }, - { "nouunlink", UF_NOUNLINK, 0 } + { "nouappnd", 0, UF_APPEND }, + { "nouappend", 0, UF_APPEND }, + { "nouchg", 0, UF_IMMUTABLE }, + { "nouchange", 0, UF_IMMUTABLE }, + { "nouimmutable", 0, UF_IMMUTABLE }, + { "nodump", 1, UF_NODUMP }, + { "noopaque", 0, UF_OPAQUE }, + { "nouunlnk", 0, UF_NOUNLINK }, + { "nouunlink", 0, UF_NOUNLINK } }; -#define longestflaglen 12 #define nmappings (sizeof(mapping) / sizeof(mapping[0])) /*