]> granicus.if.org Git - neomutt/commit
Declare many structures const (closes #3552)
authorDan Fandrich <dan@coneharvesters.com>
Sat, 3 Dec 2011 19:13:10 +0000 (11:13 -0800)
committerDan Fandrich <dan@coneharvesters.com>
Sat, 3 Dec 2011 19:13:10 +0000 (11:13 -0800)
commitb68199f8a07bb0cf5e897454ce98368bf2e50703
treea454f493b83516bdcf750e881ab9803dd9f112fa
parentee6a6d69b6ba5342b1d31d47591e7acbaef53210
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%.
43 files changed:
addrbook.c
browser.c
charset.c
color.c
compose.c
crypt-gpgme.c
curs_lib.c
curs_main.c
date.c
enter.c
functions.h
globals.h
handler.c
help.c
imap/auth.c
imap/command.c
imap/message.c
imap/utf7.c
imap/util.c
init.c
init.h
keymap.c
keymap.h
lib.c
mapping.h
mime.h
mutt_ssl.c
pager.c
parse.c
pattern.c
pgpkey.c
pgpmicalg.c
pop_auth.c
postpone.c
protos.h
query.c
recvattach.c
remailer.c
rfc2047.c
rfc822.c
rfc822.h
sendlib.c
url.c