On Wednesday 16 July 2008 07:08:29 pm Robert P. J. Day wrote:
> some redundant or misleading preprocessor tests under libbb/.
> first, given this range restriction in Config.in:
>
> config MD5_SIZE_VS_SPEED
> int "MD5: Trade Bytes for Speed"
> default 2
> range 0 3
>
> duplicating that range test in md5.c is redundant:
>
> #if CONFIG_MD5_SIZE_VS_SPEED < 0 || CONFIG_MD5_SIZE_VS_SPEED > 3
> # define MD5_SIZE_VS_SPEED 2
> #else
> # define MD5_SIZE_VS_SPEED CONFIG_MD5_SIZE_VS_SPEED
> #endif
>
> similarly, given another range restriction:
>
> config FEATURE_EDITING_MAX_LEN
> int "Maximum length of input"
> range 128 8192
> default 1024
>
> this test in lineedit.c is pointless:
>
> enum {
> /* We use int16_t for positions, need to limit line len */
> MAX_LINELEN = CONFIG_FEATURE_EDITING_MAX_LEN < 0x7ff0
> ? CONFIG_FEATURE_EDITING_MAX_LEN
>
> : 0x7ff0
>
> };
>
> in fact, it's misleading since it implies that the max length can be
> up to almost 32K when Config.in clearly restricts the value to 8K.
>
> rday
These checks are there simply to make sure something didn't go bad...
They shouldn't add to the binary size because the compiler takes them out.
If someone messes up their config file, the devs don't want to be blamed for
it :D
poly-p man
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox