From 6232f1c96cde1fee247e95cd97235c48cc7b168d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 21 Nov 2008 13:10:02 +0100 Subject: Make some static tables and strings constants. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By doing this we move them from the .data section to .rodata setion, or from .data.rel to .data.rel.ro. The .rodata section is mapped directly from the on-disk file, which is always a save, while .data.rel.ro is mapped directly when using prelink, which is a save in a lot of cases. Signed-off-by: Diego E. 'Flameeyes' Pettenò --- seq/aconnect/aconnect.c | 2 +- seq/aplaymidi/aplaymidi.c | 6 +++--- seq/aplaymidi/arecordmidi.c | 4 ++-- seq/aseqdump/aseqdump.c | 4 ++-- seq/aseqnet/aseqnet.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'seq') diff --git a/seq/aconnect/aconnect.c b/seq/aconnect/aconnect.c index bab501a..1a50666 100644 --- a/seq/aconnect/aconnect.c +++ b/seq/aconnect/aconnect.c @@ -255,7 +255,7 @@ enum { SUBSCRIBE, UNSUBSCRIBE, LIST, REMOVE_ALL }; -static struct option long_option[] = { +static const struct option long_option[] = { {"disconnect", 0, NULL, 'd'}, {"input", 0, NULL, 'i'}, {"output", 0, NULL, 'o'}, diff --git a/seq/aplaymidi/aplaymidi.c b/seq/aplaymidi/aplaymidi.c index b9377e5..5ed7bab 100644 --- a/seq/aplaymidi/aplaymidi.c +++ b/seq/aplaymidi/aplaymidi.c @@ -328,7 +328,7 @@ static int read_track(struct track *track, int track_end) switch (cmd >> 4) { /* maps SMF events to ALSA sequencer events */ - static unsigned char cmd_type[] = { + static const unsigned char cmd_type[] = { [0x8] = SND_SEQ_EVENT_NOTEOFF, [0x9] = SND_SEQ_EVENT_NOTEON, [0xa] = SND_SEQ_EVENT_KEYPRESS, @@ -857,8 +857,8 @@ static void version(void) int main(int argc, char *argv[]) { - static char short_options[] = "hVlp:d:"; - static struct option long_options[] = { + static const char short_options[] = "hVlp:d:"; + static const struct option long_options[] = { {"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {"list", 0, NULL, 'l'}, diff --git a/seq/aplaymidi/arecordmidi.c b/seq/aplaymidi/arecordmidi.c index 558fd6d..9628086 100644 --- a/seq/aplaymidi/arecordmidi.c +++ b/seq/aplaymidi/arecordmidi.c @@ -706,8 +706,8 @@ static void sighandler(int sig) int main(int argc, char *argv[]) { - static char short_options[] = "hVlp:b:f:t:sdm:i:"; - static struct option long_options[] = { + static const char short_options[] = "hVlp:b:f:t:sdm:i:"; + static const struct option long_options[] = { {"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {"list", 0, NULL, 'l'}, diff --git a/seq/aseqdump/aseqdump.c b/seq/aseqdump/aseqdump.c index 5122bbb..24c5d21 100644 --- a/seq/aseqdump/aseqdump.c +++ b/seq/aseqdump/aseqdump.c @@ -351,8 +351,8 @@ static void sighandler(int sig) int main(int argc, char *argv[]) { - static char short_options[] = "hVlp:"; - static struct option long_options[] = { + static const char short_options[] = "hVlp:"; + static const struct option long_options[] = { {"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {"list", 0, NULL, 'l'}, diff --git a/seq/aseqnet/aseqnet.c b/seq/aseqnet/aseqnet.c index ccf33e6..e071ad9 100644 --- a/seq/aseqnet/aseqnet.c +++ b/seq/aseqnet/aseqnet.c @@ -83,7 +83,7 @@ static int info = 0; * main routine */ -static struct option long_option[] = { +static const struct option long_option[] = { {"port", 1, NULL, 'p'}, {"source", 1, NULL, 's'}, {"dest", 1, NULL, 'd'}, -- cgit v1.2.1