cvs commit: src/usr.sbin/ppp route.c

Giorgos Keramidas keramida at freebsd.org
Mon Jan 10 04:22:28 PST 2005


On 2005-01-10 11:12, Brian Somers <brian at freebsd.org> wrote:
>
> Cast unsigned variables to int
>
> Revision  Changes    Path
> 1.94      +1 -1      src/usr.sbin/ppp/route.c

%  static void
%  p_flags(struct prompt *prompt, u_int32_t f, unsigned max)
%  {
%    char name[33], *flags;
%    register struct bits *p = bits;
%
%    if (max > sizeof name - 1)
%      max = sizeof name - 1;
%
%    for (flags = name; p->b_mask && flags - name < (int)max; p++)
%      if (p->b_mask & f)
%        *flags++ = p->b_val;
%    *flags = '\0';
% -  prompt_Printf(prompt, "%-*.*s", max, max, name);
% +  prompt_Printf(prompt, "%-*.*s", (int)max, (int)max, name);
%  }

Hi Brian,

Since p_flags is used only once in route.c can't we just fix the type
of `max' in the argument list of p_flags() to avoid the need for casts
altogether?



More information about the cvs-all mailing list