]> granicus.if.org Git - neomutt/commit
Bring consistency among sizes
authorJustin Vasel <justin.vasel@gmail.com>
Wed, 29 Nov 2017 18:00:44 +0000 (13:00 -0500)
committerRichard Russon <rich@flatcap.org>
Wed, 13 Dec 2017 15:21:30 +0000 (15:21 +0000)
commitb310689426c102b8864af25c7f6899886db4d7f1
tree2256cd5fd2ccd4c5221936ea0550ae4ab661a998
parent399676c3a03bbe608f824478d1bb0be0497be25f
Bring consistency among sizes

There are instances in the code that refer to lengths or sizes of strings and
buffers and the like, but they are not typed in a consistent manner. The purpose
of this commit is to provide some consistency to these scenarios by changing
their type from unsigned int, int, unsigned long, etc. to size_t.

In general, these situations were identified by globally searching the code
for patterns along the lines of:
(unsigned|unsigned int|int|long) (len|blen|olen|length|l|size)
and changing the type to size_t on a case-by-case basis.

The following situations were explicitly ignored:

- autosetup/jimsh0.c, because it appears to be third-party code

- inputs to function calls relating to ssl and sasl, because they don't take
size_t as inputs and recasting in the function call didn't seem worth the
increased messiness

- for loop indices, because in some cases unsigned indices can breed bugs

This commit takes care of most obvious cases. There may certainly be subtler
ones that were missed in this pass.

Resolves: #928
33 files changed:
address.c
attach.c
browser.c
browser.h
conn/ssl.c
copy.c
curs_lib.c
curs_main.c
handler.c
hdrline.c
imap/auth_cram.c
imap/imap_private.h
imap/message.c
init.c
keymap.c
mutt_charset.c
mutt_curses.h
muttlib.c
ncrypt/crypt.c
ncrypt/crypt_gpgme.c
ncrypt/pgp.c
ncrypt/smime.c
newsrc.c
nntp.c
pager.c
parse.c
pgppubring.c
pop.c
protos.h
sendlib.c
sidebar.c
url.c
version.c