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
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to