From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29084 invoked by alias); 7 Aug 2008 14:01:19 -0000 Received: (qmail 29070 invoked by uid 9737); 7 Aug 2008 14:01:18 -0000 Date: Thu, 07 Aug 2008 14:01:00 -0000 Message-ID: <20080807140118.29068.qmail@sourceware.org> From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/display display.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00009.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-08-07 14:01:18 Modified files: lib/display : display.c Log message: added const modifiers switched const char* to const char[] elements to save few relocation entries Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.90&r2=1.91 --- LVM2/lib/display/display.c 2008/04/10 19:16:35 1.90 +++ LVM2/lib/display/display.c 2008/08/07 14:01:17 1.91 @@ -24,9 +24,9 @@ typedef enum { SIZE_LONG = 0, SIZE_SHORT = 1, SIZE_UNIT = 2 } size_len_t; -static struct { +static const struct { alloc_policy_t alloc; - const char *str; + const char str[12]; /* must be changed when size extends 11 chars */ } _policies[] = { { ALLOC_CONTIGUOUS, "contiguous"}, { @@ -36,7 +36,7 @@ ALLOC_INHERIT, "inherit"} }; -static int _num_policies = sizeof(_policies) / sizeof(*_policies); +static const int _num_policies = sizeof(_policies) / sizeof(*_policies); uint64_t units_to_bytes(const char *units, char *unit_type) { @@ -155,7 +155,7 @@ uint64_t byte = UINT64_C(0); uint64_t units = UINT64_C(1024); char *size_buf = NULL; - const char *size_str[][3] = { + const char * const size_str[][3] = { {" Exabyte", " EB", "E"}, {" Petabyte", " PB", "P"}, {" Terabyte", " TB", "T"},