4141#include < signal.h>
4242#include < violite.h>
4343
44+ #include < algorithm>
45+
46+ using std::min;
47+ using std::max;
48+
4449#if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H)
4550#include < locale.h>
4651#endif
@@ -3499,9 +3504,9 @@ print_table_data(MYSQL_RES *result)
34993504 {
35003505 uint length= column_names ? field->name_length : 0 ;
35013506 if (quick)
3502- length=max (length,field->length );
3507+ length= max< size_t > (length, field->length );
35033508 else
3504- length=max (length,field->max_length );
3509+ length= max< size_t > (length, field->max_length );
35053510 if (length < 4 && !IS_NOT_NULL (field->flags ))
35063511 length=4 ; // Room for "NULL"
35073512 field->max_length =length;
@@ -3521,8 +3526,8 @@ print_table_data(MYSQL_RES *result)
35213526 field->name ,
35223527 field->name + name_length);
35233528 uint display_length= field->max_length + name_length - numcells;
3524- tee_fprintf (PAGER, " %-*s |" ,( int ) min (display_length,
3525- MAX_COLUMN_LENGTH),
3529+ tee_fprintf (PAGER, " %-*s |" ,
3530+ min< int >(display_length, MAX_COLUMN_LENGTH),
35263531 field->name );
35273532 num_flag[off]= IS_NUM (field->type );
35283533 }
@@ -3611,9 +3616,9 @@ static int get_field_disp_length(MYSQL_FIELD *field)
36113616 uint length= column_names ? field->name_length : 0 ;
36123617
36133618 if (quick)
3614- length= max (length, field->length );
3619+ length= max<uint> (length, field->length );
36153620 else
3616- length= max (length, field->max_length );
3621+ length= max<uint> (length, field->max_length );
36173622
36183623 if (length < 4 && !IS_NOT_NULL (field->flags ))
36193624 length= 4 ; /* Room for "NULL" */
0 commit comments