Skip to content

Commit

Permalink
d.histogram: Initialize range_dmin and range_dmax to fix uninitialize…
Browse files Browse the repository at this point in the history
… value warnings in bar.c (OSGeo#3923)

The change satisfies the warning and does not change the behavior. The initial values (garbage or 0) are actually not used. `is_fp` conditions are used to set the values and drive their use (so that the initial values are not used).
  • Loading branch information
ShubhamDesai authored Jun 28, 2024
1 parent cb0e431 commit 695e550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion display/d.histogram/bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int bar(struct stat_list *dist_stats, /* list of distribution statistics */
int draw = YES;
long int bar_height; /* height, in pixels, of a histogram bar */
CELL bar_color; /* color/category number of a histogram bar */
DCELL dmax, range_dmin, range_dmax, dmin, dval;
DCELL dmax, range_dmin = 0, range_dmax = 0, dmin, dval;
long int max_tics; /* maximum tics allowed on an axis */
long int xoffset; /* offset for x-axis */
long int yoffset; /* offset for y-axis */
Expand Down

0 comments on commit 695e550

Please sign in to comment.