@@ -1037,9 +1037,9 @@ mowgli_patricia_size(mowgli_patricia_t *dict)
1037
1037
/* returns the sum of the depths of the subtree rooted in delem at depth depth */
1038
1038
/* there is no need for this to be recursive, but it is easier... */
1039
1039
static int
1040
- stats_recurse (union patricia_elem * delem , int depth , int * pmaxdepth )
1040
+ stats_recurse (union patricia_elem * delem , unsigned int depth , unsigned int * pmaxdepth )
1041
1041
{
1042
- int result = 0 ;
1042
+ unsigned int result = 0 ;
1043
1043
int val ;
1044
1044
union patricia_elem * next ;
1045
1045
@@ -1103,15 +1103,15 @@ void
1103
1103
mowgli_patricia_stats (mowgli_patricia_t * dict , void (* cb )(const char * line , void * privdata ), void * privdata )
1104
1104
{
1105
1105
char str [256 ];
1106
- int sum , maxdepth ;
1106
+ unsigned int sum , maxdepth ;
1107
1107
1108
1108
return_if_fail (dict != NULL );
1109
1109
1110
1110
if (dict -> id != NULL )
1111
- snprintf (str , sizeof str , "Dictionary stats for %s (%d )" ,
1111
+ snprintf (str , sizeof str , "Dictionary stats for %s (%u )" ,
1112
1112
dict -> id , dict -> count );
1113
1113
else
1114
- snprintf (str , sizeof str , "Dictionary stats for <%p> (%d )" ,
1114
+ snprintf (str , sizeof str , "Dictionary stats for <%p> (%u )" ,
1115
1115
(void * ) dict , dict -> count );
1116
1116
1117
1117
cb (str , privdata );
@@ -1120,7 +1120,7 @@ mowgli_patricia_stats(mowgli_patricia_t *dict, void (*cb)(const char *line, void
1120
1120
if (dict -> count > 0 )
1121
1121
{
1122
1122
sum = stats_recurse (dict -> root , 0 , & maxdepth );
1123
- snprintf (str , sizeof str , "Depth sum %d Avg depth %d Max depth %d " , sum , sum / dict -> count , maxdepth );
1123
+ snprintf (str , sizeof str , "Depth sum %u Avg depth %u Max depth %u " , sum , sum / dict -> count , maxdepth );
1124
1124
}
1125
1125
else
1126
1126
{
0 commit comments