[PATCH] Missing initializers for struct members

Petter Reinholdtsen pere at HUNGRY.COM
Mon Jan 24 18:36:54 EST 2005


Next class of issues pinpointed by more warning flags are the missing
initializers.  Only two of those, resulting in messages like this from
the compiler:

  warning: missing initializer

This patch fixes both of these, making sure all members of the given
struct have known content.  Please include it in a future version of
mapserver.

Index: mapserv.c
===================================================================
RCS file: /data2/cvsroot/mapserver/mapserv.c,v
retrieving revision 1.142
diff -u -3 -p -u -r1.142 mapserv.c
--- mapserv.c   9 Dec 2004 21:20:19 -0000       1.142
+++ mapserv.c   24 Jan 2005 23:29:08 -0000
@@ -958,7 +958,7 @@ void setExtentFromShapes() {
   double dx, dy, cellsize;

   rectObj tmpext={-1.0,-1.0,-1.0,-1.0};
-  pointObj tmppnt={-1.0,-1.0};
+  pointObj tmppnt={-1.0,-1.0, 0.0, 0.0};

   found = msGetQueryResultBounds(msObj->Map, &(tmpext));

Index: mapwms.c
===================================================================
RCS file: /data2/cvsroot/mapserver/mapwms.c,v
retrieving revision 1.159
diff -u -3 -p -u -r1.159 mapwms.c
--- mapwms.c    24 Jan 2005 15:46:20 -0000      1.159
+++ mapwms.c    24 Jan 2005 23:29:09 -0000
@@ -2218,7 +2218,7 @@ int msDumpResult(mapObj *map, int bForma
 int msWMSFeatureInfo(mapObj *map, int nVersion, char **names, char **values, int numentries)
 {
   int i, feature_count=1, numlayers_found=0;
-  pointObj point = {-1.0, -1.0};
+  pointObj point = {-1.0, -1.0, 0.0, 0.0};
   const char *info_format="MIME";
   double cellx, celly;
   errorObj *ms_error = msGetErrorObj();



More information about the mapserver-dev mailing list