Use type-specific inline function imax() instead of deprecated macro MAX().

Prodded by:	bde
This commit is contained in:
Jung-uk Kim 2010-07-12 15:32:45 +00:00
parent 72ccfc240b
commit 4a82f10889
2 changed files with 2 additions and 3 deletions

View File

@ -151,7 +151,6 @@ ksprintn(char *nbuf, uintmax_t num, int base, int *lenp, int upper)
static int static int
kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap) kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap)
{ {
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define PCHAR(c) {int cc=(c); if (func) (*func)(cc); else *d++ = cc; retval++; } #define PCHAR(c) {int cc=(c); if (func) (*func)(cc); else *d++ = cc; retval++; }
char nbuf[MAXNBUF]; char nbuf[MAXNBUF];
char *d; char *d;
@ -422,7 +421,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
if (!ladjust && padc == '0') if (!ladjust && padc == '0')
dwidth = width - tmp; dwidth = width - tmp;
width -= tmp + MAX(dwidth, n); width -= tmp + imax(dwidth, n);
dwidth -= n; dwidth -= n;
if (!ladjust) if (!ladjust)
while (width-- > 0) while (width-- > 0)

View File

@ -813,7 +813,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
if (!ladjust && padc == '0') if (!ladjust && padc == '0')
dwidth = width - tmp; dwidth = width - tmp;
width -= tmp + MAX(dwidth, n); width -= tmp + imax(dwidth, n);
dwidth -= n; dwidth -= n;
if (!ladjust) if (!ladjust)
while (width-- > 0) while (width-- > 0)