Skip to content

Commit 59c6c03

Browse files
committed
mapdraw, ...: simplify pointObj initializers
With some compile-time options, pointObj has less than 4 fields, so this patch also fixes the build with those options.
1 parent 334ffee commit 59c6c03

7 files changed

+9
-9
lines changed

Diff for: mapdraw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ int polygonLayerDrawShape(mapObj *map, imageObj *image, layerObj *layer,
19561956
{
19571957

19581958
int c = shape->classindex;
1959-
pointObj annopnt = {0,0,0,0}; // initialize
1959+
pointObj annopnt = {0}; // initialize
19601960
int i;
19611961

19621962
if(MS_DRAW_FEATURES(drawmode)) {

Diff for: maplabel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ int msGetTextSymbolSize(mapObj *map, textSymbolObj *ts, rectObj *r) {
881881

882882
pointObj get_metrics(pointObj *p, int position, textPathObj *tp, int ox, int oy, double rotation, int buffer, label_bounds *bounds)
883883
{
884-
pointObj q = {0,0,0,0}; // initialize
884+
pointObj q = {0}; // initialize
885885
double x1=0, y1=0, x2=0, y2=0;
886886
double sin_a,cos_a;
887887
double w, h, x, y;

Diff for: mappostgis.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ arcSegmentSide(const pointObj *p1, const pointObj *p2, const pointObj *q)
752752
int
753753
arcCircleCenter(const pointObj *p1, const pointObj *p2, const pointObj *p3, pointObj *center, double *radius)
754754
{
755-
pointObj c = {0,0,0,0}; // initialize
755+
pointObj c = {0}; // initialize
756756
double dx21, dy21, dx31, dy31, h21, h31, d, r;
757757

758758
/* Circle is closed, so p2 must be opposite p1 & p3. */

Diff for: mapprimitive.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ void msTransformPixelToShape(shapeObj *shape, rectObj extent, double cellsize)
11331133
*/
11341134
static pointObj generateLineIntersection(pointObj a, pointObj b, pointObj c, pointObj d)
11351135
{
1136-
pointObj p = {0,0,0,0}; // initialize
1136+
pointObj p = {0}; // initialize
11371137
double r;
11381138
double denominator, numerator;
11391139

Diff for: mapproject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ static int msProjectShapeShouldDoLineCutting(reprojectionObj* reprojector)
12111211
return MS_FALSE;
12121212
}
12131213

1214-
pointObj p = {0,0,0,0}; // initialize
1214+
pointObj p = {0}; // initialize
12151215
double invgt0 = out->gt.need_geotransform ? out->gt.invgeotransform[0] : 0.0;
12161216
double invgt1 = out->gt.need_geotransform ? out->gt.invgeotransform[1] : 1.0;
12171217
double invgt3 = out->gt.need_geotransform ? out->gt.invgeotransform[3] : 0.0;

Diff for: mapsmoothing.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static int processShapePathDistance(shapeObj *shape, int force)
142142

143143
while ((res = nextLineWindow(&lw)) != MS_DONE) {
144144
double ratio = 0;
145-
pointObj point = {0,0,0,0}; // initialize
145+
pointObj point = {0}; // initialize
146146

147147
if (lw.lineIsRing && lw.pos==lw.line->numpoints-1) {
148148
point = newShape->line[i].point[0];
@@ -261,7 +261,7 @@ shapeObj* msSmoothShapeSIA(shapeObj *shape, int ss, int si, char *preprocessing)
261261

262262
while ((res = nextLineWindow(&lw)) != MS_DONE) {
263263
double sum_x=0, sum_y=0, sum = 0;
264-
pointObj point = {0,0,0,0}; // initialize
264+
pointObj point = {0}; // initialize
265265
int k = 0;
266266

267267
if (res == MS_FALSE) { /* invalid window */

Diff for: maptemplate.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1728,8 +1728,8 @@ static int processShplabelTag(layerObj *layer, char **line, shapeObj *origshape)
17281728
}
17291729

17301730
if(labelposvalid == MS_TRUE) {
1731-
pointObj p1 = {0,0,0,0}; // initialize
1732-
pointObj p2 = {0,0,0,0};
1731+
pointObj p1 = {0}; // initialize
1732+
pointObj p2 = {0};
17331733
int label_offset_x, label_offset_y;
17341734
labelObj *label=NULL;
17351735
label_bounds lbounds;

0 commit comments

Comments
 (0)