@@ -844,10 +844,10 @@ mowgli_dictionary_size(mowgli_dictionary_t *dict)
844
844
}
845
845
846
846
/* returns the sum of the depths of the subtree rooted in delem at depth depth */
847
- static int
848
- stats_recurse (mowgli_dictionary_elem_t * delem , int depth , int * pmaxdepth )
847
+ static unsigned int
848
+ stats_recurse (mowgli_dictionary_elem_t * delem , unsigned int depth , unsigned int * pmaxdepth )
849
849
{
850
- int result ;
850
+ unsigned int result ;
851
851
852
852
if (depth > * pmaxdepth )
853
853
* pmaxdepth = depth ;
@@ -883,15 +883,15 @@ void
883
883
mowgli_dictionary_stats (mowgli_dictionary_t * dict , void (* cb )(const char * line , void * privdata ), void * privdata )
884
884
{
885
885
char str [256 ];
886
- int sum , maxdepth ;
886
+ unsigned int sum , maxdepth ;
887
887
888
888
return_if_fail (dict != NULL );
889
889
890
890
if (dict -> id != NULL )
891
- snprintf (str , sizeof str , "Dictionary stats for %s (%d )" ,
891
+ snprintf (str , sizeof str , "Dictionary stats for %s (%u )" ,
892
892
dict -> id , dict -> count );
893
893
else
894
- snprintf (str , sizeof str , "Dictionary stats for <%p> (%d )" ,
894
+ snprintf (str , sizeof str , "Dictionary stats for <%p> (%u )" ,
895
895
(void * ) dict , dict -> count );
896
896
897
897
cb (str , privdata );
@@ -900,7 +900,7 @@ mowgli_dictionary_stats(mowgli_dictionary_t *dict, void (*cb)(const char *line,
900
900
if (dict -> root != NULL )
901
901
{
902
902
sum = stats_recurse (dict -> root , 0 , & maxdepth );
903
- snprintf (str , sizeof str , "Depth sum %d Avg depth %d Max depth %d " , sum , sum / dict -> count , maxdepth );
903
+ snprintf (str , sizeof str , "Depth sum %u Avg depth %u Max depth %u " , sum , sum / dict -> count , maxdepth );
904
904
}
905
905
else
906
906
{
0 commit comments