public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: zkabelac@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/lib/display display.c
Date: Thu, 07 Aug 2008 14:01:00 -0000	[thread overview]
Message-ID: <20080807140118.29068.qmail@sourceware.org> (raw)

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"},


             reply	other threads:[~2008-08-07 14:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07 14:01 zkabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-01-25 17:14 agk
2011-10-04 12:40 zkabelac
2011-10-03 18:31 zkabelac
2011-09-27 12:34 agk
2011-09-26 13:11 zkabelac
2010-06-28 20:32 wysochanski
2009-07-27 10:18 wysochanski
2008-04-10 19:16 agk
2007-11-05 17:13 agk
2007-11-05  2:10 agk
2007-05-31 20:26 wysochanski
2007-05-31 15:18 wysochanski
2004-03-30 14:35 agk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080807140118.29068.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).