@@ -55,9 +55,9 @@ static int list_tables(MYSQL *mysql,const char *db,const char *table);
55
55
static int list_table_status (MYSQL * mysql ,const char * db ,const char * table );
56
56
static int list_fields (MYSQL * mysql ,const char * db ,const char * table ,
57
57
const char * field );
58
- static void print_header (const char * header ,uint head_length ,...);
59
- static void print_row (const char * header ,uint head_length ,...);
60
- static void print_trailer (uint length ,...);
58
+ static void print_header (const char * header ,size_t head_length ,...);
59
+ static void print_row (const char * header ,size_t head_length ,...);
60
+ static void print_trailer (size_t length ,...);
61
61
static void print_res_header (MYSQL_RES * result );
62
62
static void print_res_top (MYSQL_RES * result );
63
63
static void print_res_row (MYSQL_RES * result ,MYSQL_ROW cur );
@@ -411,7 +411,8 @@ static int
411
411
list_dbs (MYSQL * mysql ,const char * wild )
412
412
{
413
413
const char * header ;
414
- uint length , counter = 0 ;
414
+ size_t length = 0 ;
415
+ uint counter = 0 ;
415
416
ulong rowcount = 0L ;
416
417
char tables [NAME_LEN + 1 ], rows [NAME_LEN + 1 ];
417
418
char query [NAME_LEN + 100 ];
@@ -449,7 +450,7 @@ list_dbs(MYSQL *mysql,const char *wild)
449
450
printf ("Wildcard: %s\n" ,wild );
450
451
451
452
header = "Databases" ;
452
- length = ( uint ) strlen (header );
453
+ length = strlen (header );
453
454
field = mysql_fetch_field (result );
454
455
if (length < field -> max_length )
455
456
length = field -> max_length ;
@@ -537,7 +538,8 @@ static int
537
538
list_tables (MYSQL * mysql ,const char * db ,const char * table )
538
539
{
539
540
const char * header ;
540
- uint head_length , counter = 0 ;
541
+ size_t head_length ;
542
+ uint counter = 0 ;
541
543
char query [NAME_LEN + 100 ], rows [NAME_LEN ], fields [16 ];
542
544
MYSQL_FIELD * field ;
543
545
MYSQL_RES * result ;
@@ -575,7 +577,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
575
577
putchar ('\n' );
576
578
577
579
header = "Tables" ;
578
- head_length = ( uint ) strlen (header );
580
+ head_length = strlen (header );
579
581
field = mysql_fetch_field (result );
580
582
if (head_length < field -> max_length )
581
583
head_length = field -> max_length ;
@@ -805,10 +807,10 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
805
807
*****************************************************************************/
806
808
807
809
static void
808
- print_header (const char * header ,uint head_length ,...)
810
+ print_header (const char * header ,size_t head_length ,...)
809
811
{
810
812
va_list args ;
811
- uint length ,i ,str_length ,pre_space ;
813
+ size_t length ,i ,str_length ,pre_space ;
812
814
const char * field ;
813
815
814
816
va_start (args ,head_length );
@@ -831,10 +833,10 @@ print_header(const char *header,uint head_length,...)
831
833
putchar ('|' );
832
834
for (;;)
833
835
{
834
- str_length = ( uint ) strlen (field );
836
+ str_length = strlen (field );
835
837
if (str_length > length )
836
838
str_length = length + 1 ;
837
- pre_space = ( uint ) ((( int ) length - ( int ) str_length )/2 )+ 1 ;
839
+ pre_space = ((length - str_length )/2 )+ 1 ;
838
840
for (i = 0 ; i < pre_space ; i ++ )
839
841
putchar (' ' );
840
842
for (i = 0 ; i < str_length ; i ++ )
@@ -868,11 +870,11 @@ print_header(const char *header,uint head_length,...)
868
870
869
871
870
872
static void
871
- print_row (const char * header ,uint head_length ,...)
873
+ print_row (const char * header ,size_t head_length ,...)
872
874
{
873
875
va_list args ;
874
876
const char * field ;
875
- uint i ,length ,field_length ;
877
+ size_t i ,length ,field_length ;
876
878
877
879
va_start (args ,head_length );
878
880
field = header ; length = head_length ;
@@ -881,7 +883,7 @@ print_row(const char *header,uint head_length,...)
881
883
putchar ('|' );
882
884
putchar (' ' );
883
885
fputs (field ,stdout );
884
- field_length = ( uint ) strlen (field );
886
+ field_length = strlen (field );
885
887
for (i = field_length ; i <= length ; i ++ )
886
888
putchar (' ' );
887
889
if (!(field = va_arg (args ,char * )))
@@ -895,10 +897,10 @@ print_row(const char *header,uint head_length,...)
895
897
896
898
897
899
static void
898
- print_trailer (uint head_length ,...)
900
+ print_trailer (size_t head_length ,...)
899
901
{
900
902
va_list args ;
901
- uint length ,i ;
903
+ size_t length ,i ;
902
904
903
905
va_start (args ,head_length );
904
906
length = head_length ;
@@ -941,7 +943,7 @@ static void print_res_top(MYSQL_RES *result)
941
943
mysql_field_seek (result ,0 );
942
944
while ((field = mysql_fetch_field (result )))
943
945
{
944
- if ((length = ( uint ) strlen (field -> name )) > field -> max_length )
946
+ if ((length = strlen (field -> name )) > field -> max_length )
945
947
field -> max_length = length ;
946
948
else
947
949
length = field -> max_length ;
0 commit comments