7
7
* PURPOSE: Prints terse list of category values found in a raster
8
8
* map layer.
9
9
*
10
- * COPYRIGHT: (C) 2006 by the GRASS Development Team
10
+ * COPYRIGHT: (C) 2006-2025 by the GRASS Development Team
11
11
*
12
12
* This program is free software under the GNU General Public
13
13
* License (>=v2). Read the file COPYING that comes with GRASS
@@ -29,7 +29,8 @@ static void output_pretty_json(JSON_Value *);
29
29
static int show (CELL , CELL , int * , DCELL , DCELL , RASTER_MAP_TYPE , int ,
30
30
enum OutputFormat , JSON_Array * );
31
31
32
- void initialize_json_object (JSON_Value * * root_value , JSON_Object * * root_object )
32
+ static void initialize_json_object (JSON_Value * * root_value ,
33
+ JSON_Object * * root_object )
33
34
{
34
35
* root_value = json_value_init_object ();
35
36
if (* root_value == NULL ) {
@@ -38,7 +39,8 @@ void initialize_json_object(JSON_Value **root_value, JSON_Object **root_object)
38
39
* root_object = json_object (* root_value );
39
40
}
40
41
41
- void initialize_json_array (JSON_Value * * root_value , JSON_Array * * root_array )
42
+ static void initialize_json_array (JSON_Value * * root_value ,
43
+ JSON_Array * * root_array )
42
44
{
43
45
* root_value = json_value_init_array ();
44
46
if (* root_value == NULL ) {
@@ -47,7 +49,7 @@ void initialize_json_array(JSON_Value **root_value, JSON_Array **root_array)
47
49
* root_array = json_array (* root_value );
48
50
}
49
51
50
- void append_category_ranges (JSON_Array * range_array , long min , long max )
52
+ static void append_category_ranges (JSON_Array * range_array , long min , long max )
51
53
{
52
54
JSON_Object * cat_object ;
53
55
JSON_Value * cat_value ;
@@ -59,7 +61,7 @@ void append_category_ranges(JSON_Array *range_array, long min, long max)
59
61
json_array_append_value (range_array , cat_value );
60
62
}
61
63
62
- void output_pretty_json (JSON_Value * root_value )
64
+ static void output_pretty_json (JSON_Value * root_value )
63
65
{
64
66
char * serialized_string = json_serialize_to_string_pretty (root_value );
65
67
if (!serialized_string ) {
@@ -162,7 +164,7 @@ int compact_list(struct Cell_stats *statf, DCELL dmin, DCELL dmax,
162
164
long count ; /* not used, but required by cell stats call */
163
165
JSON_Value * root_value , * range_value ;
164
166
JSON_Object * root_object ;
165
- JSON_Array * range_array ;
167
+ JSON_Array * range_array = NULL ;
166
168
167
169
if (format == JSON ) {
168
170
initialize_json_object (& root_value , & root_object );
@@ -221,7 +223,7 @@ static int show(CELL low, CELL high, int *len, DCELL dmin, DCELL dmax,
221
223
RASTER_MAP_TYPE map_type , int nsteps , enum OutputFormat format ,
222
224
JSON_Array * root_array )
223
225
{
224
- char text [100 ];
226
+ char text [100 ] = { 0 } ;
225
227
char xlen ;
226
228
JSON_Object * cat_object ;
227
229
JSON_Value * cat_value ;
0 commit comments