Squid 2.4-200104262300 code cleanup request

From: John Gilbert <jgilbert@dont-contact.us>
Date: Fri, 27 Apr 2001 12:08:47 -0700

Hello all,
I just had three suggestions for some code cleanup, so that squid
compiles a bit nicer.

    The first is to remove seven unused variables, as they take up stack
space and slow things down.
const char *sdummy, line 3917, file GNUregex.c
const char *sdummy, line 3918, file GNUregex,c
acl_access *a, line 1077, file cache_cf.c
static struct timeval zero_tv, line 66, file comm_select.c
int n; line 345, file ipcache.c
int x; line 100, file unlinkd.c
int opt_put = 0, line 92, file client.c

  The second is to replace "while(1)" with "for (;;)" so that some
compilers don't complain
about compares with constants and it generates slightly faster code.
This is only seen four places.
line 517, file store_dir_diskd.c
line 1511, file store_dir_diskd.c
line 1324, file store_dir_ufs.c
line 377, file HttpHeaderTools.c

  The third thing might be the source of a bug, and is diffentaly a
logic error.
on line 133 of file store_swapmeta.c...

        if (type < STORE_META_VOID || type > STORE_META_END) {

type is an unsigned int, and STORE_META_VOID is defined as zero. This
will never be true.

Thanks.
John Gilbert
jgilbert@sgi.com
Received on Fri Apr 27 2001 - 15:58:50 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:50 MST