Skip to content

Commit

Permalink
fix -Wmissing-field-initializers warnings (#2753)
Browse files Browse the repository at this point in the history
and fix of -Wignored-qualifiers warnings in r.terraflow/types.h
  • Loading branch information
nilason committed Jan 17, 2023
1 parent 7780e94 commit 445a9d7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/gis/parser_dependencies.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct rule {
void **opts;
};

static struct vector rules = {sizeof(struct rule), 50};
static struct vector rules = {.elsize = sizeof(struct rule), .increment = 50};

/*! \brief Set generic option rule
Expand Down
4 changes: 3 additions & 1 deletion raster/r.in.png/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ typedef struct {
#define C_B 4
#define C_A 5

static channel channels[6] = {{""}, {""}, {".r"}, {".g"}, {".b"}, {".a"}};
static channel channels[6] = {{.suffix = ""}, {.suffix = ""},
{.suffix = ".r"}, {.suffix = ".g"},
{.suffix = ".b"}, {.suffix = ".a"}};

static int Header;
static int Float;
Expand Down
7 changes: 2 additions & 5 deletions raster/r.terraflow/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,8 @@ class labelFactory {
public:
static cclabel_type getNewLabel() { return ++label; }
static cclabel_type getCurrentLabel() { return label; }
static const cclabel_type getLabelInit()
{
return cclabel_type(LABEL_START);
}
static const cclabel_type getLabelCount() { return label + 1; }
static cclabel_type getLabelInit() { return cclabel_type(LABEL_START); }
static cclabel_type getLabelCount() { return label + 1; }
static void setLabelCount(int n) { label = n - 1; }
static void reset() { label = getLabelInit(); }
};
Expand Down
24 changes: 12 additions & 12 deletions raster/r.uslek/prct2tex.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,29 +111,29 @@ int prct2tex(double sand_input, double clay_input, double silt_input)
/*G_message("in prct2tex()"); */
/*setup the 3Dvectors and initialize them */
/* index 0 */
struct vector cls_clay[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_clay[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 1 */
struct vector cls_sandy_clay[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_sandy_clay[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 2 */
struct vector cls_silty_clay[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_silty_clay[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 3 */
struct vector cls_sandy_clay_loam[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_sandy_clay_loam[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 4 */
struct vector cls_clay_loam[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_clay_loam[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 5 */
struct vector cls_silty_clay_loam[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_silty_clay_loam[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 6 */
struct vector cls_sand[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_sand[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 7 */
struct vector cls_loamy_sand[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_loamy_sand[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 8 */
struct vector cls_sandy_loam[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_sandy_loam[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 9 */
struct vector cls_loam[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_loam[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 10 */
struct vector cls_silt_loam[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_silt_loam[POLYGON_DIMENSION] = {{.sand = 0.0}};
/* index 11 */
struct vector cls_silt[POLYGON_DIMENSION] = {{0.0}};
struct vector cls_silt[POLYGON_DIMENSION] = {{.sand = 0.0}};

if ((sand_input + clay_input + silt_input) <= 10.0) {
sand_input = sand_input * 100.0;
Expand Down

0 comments on commit 445a9d7

Please sign in to comment.