Why preferring smallint to bool in some places?

Kang-Che Sung explorer09 at gmail.com
Thu Jan 26 05:25:33 UTC 2017


Dear busybox developers,

May I ask some little code questions? I have been reading some of the
changes in busybox and I don't understand the use of type "smallint" in
this code

9a64c3337cc0a5e84e9ad457eeb1d475c311e9fc "ls: convert DISP_DIRNAME to
a bool variable"

ls.c

    @@ -330,7 +326,7 @@ struct globals {
     # define G_show_color 0
     #endif
      smallint exit_code;
    - unsigned all_fmt;
    + smallint show_dirname;
     #if ENABLE_FEATURE_LS_WIDTH
      unsigned terminal_width;
     # define G_terminal_width (G.terminal_width)

Here it seems that this "show_dirname" variable is supposed to hold a
boolean value, but why not declare it with the type bool? What's the
rationale behind preferring smallint?

Thank you.
Kang-Che Sung


More information about the busybox mailing list