summaryrefslogtreecommitdiffstats
path: root/curs_main.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2011-12-03 11:13:10 -0800
committerDan Fandrich <dan@coneharvesters.com>2011-12-03 11:13:10 -0800
commit05df9d0879317816dcee00282eea3a06b0310c3b (patch)
treea454f493b83516bdcf750e881ab9803dd9f112fa /curs_main.c
parent13e87955a6610317dd90b29b116edd5196cbcd56 (diff)
Declare many structures const (closes #3552)
Many structs used in mutt are actually constant but are defined without the 'const' keyword. This can slow initialization (slightly) in some environments due to extra copying and increases the amount of writable RAM required at run-time, which can be significant on non-MMU systems. Using const can also increase the opportunities for compiler optimization. The attached patch marks many such structures as const. On my test x86 build, this reduces the size of .data by over 50%.
Diffstat (limited to 'curs_main.c')
-rw-r--r--curs_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/curs_main.c b/curs_main.c
index dd2ac398..302082b4 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -401,7 +401,7 @@ static void resort_index (MUTTMENU *menu)
menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
}
-static struct mapping_t IndexHelp[] = {
+static const struct mapping_t IndexHelp[] = {
{ N_("Quit"), OP_QUIT },
{ N_("Del"), OP_DELETE },
{ N_("Undel"), OP_UNDELETE },