Is the MapServer code supposed to be ANSI C?

Petter Reinholdtsen pere at HUNGRY.COM
Tue Feb 1 17:26:58 EST 2005


[Petter Reinholdtsen]
> Yes, that would be nice, and I agree completely.  But there are some
> fixes left before the code will compile using those flags. :)

Here is a start, getting rid of '//' comments in the header files, and
also adding info about which #ifdef an #endif matches.  There are
several issues left before the code will compile with -ansi and
-pedantic, and I'm not sure if using both is possible to reach with
the mapserver code.  But if we succeed, the code will most likely
compile and work with any ANSI C89 compiler.

Index: cgiutil.h
===================================================================
RCS file: /data2/cvsroot/mapserver/cgiutil.h,v
retrieving revision 1.15
diff -u -3 -p -u -r1.15 cgiutil.h
--- cgiutil.h   21 Oct 2004 04:30:54 -0000      1.15
+++ cgiutil.h   1 Feb 2005 22:16:06 -0000
@@ -49,7 +49,7 @@

 enum MS_REQUEST_TYPE {MS_GET_REQUEST, MS_POST_REQUEST};

-//structure to hold request information
+/* structure to hold request information */
 typedef struct
 {
 #ifndef SWIG
Index: map.h
===================================================================
RCS file: /data2/cvsroot/mapserver/map.h,v
retrieving revision 1.391
diff -u -3 -p -u -r1.391 map.h
--- map.h       28 Jan 2005 06:16:53 -0000      1.391
+++ map.h       1 Feb 2005 22:16:09 -0000
@@ -185,7 +192,7 @@ static char *cvsid_aw(void) { return( cv
 #include "mapprimitive.h"
 #include "mapshape.h"
 #include "mapsymbol.h"
-#include "maptree.h" // quadtree spatial index
+#include "maptree.h" /* quadtree spatial index */
 #include "maphash.h"
 #include "mapio.h"

@@ -230,7 +237,7 @@ static char *cvsid_aw(void) { return( cv
 extern "C" {
 #endif

-// General defines, wrapable
+/* General defines, wrapable */

 #define MS_VERSION "4.5"

@@ -247,11 +254,11 @@ extern "C" {
 #define MS_SINGLE 0 /* modes for searching (spatial/database) */
 #define MS_MULTIPLE 1

-// For layer transparency, allows alpha transparent pixmaps to be used
-// with RGB map images
+/* For layer transparency, allows alpha transparent pixmaps to be used
+   with RGB map images */
 #define MS_GD_ALPHA 1000

-// General defines, not wrapable
+/* General defines, not wrapable */
 #ifndef SWIG
 #define MS_DEFAULT_MAPFILE_PATTERN "\\.map$"
 #define MS_TEMPLATE_EXPR "\\.(jsp|asp|cfm|xml|wml|html|htm|shtml|phtml|php|svg)$"
@@ -282,10 +289,10 @@ extern "C" {
 #define MS_ITEMNAMELEN 32
 #define MS_NAMELEN 20

-#define MS_MINSYMBOLSIZE 1   // in pixels
+#define MS_MINSYMBOLSIZE 1   /* in pixels */
 #define MS_MAXSYMBOLSIZE 500

-#define MS_MINSYMBOLWIDTH 1   // in pixels
+#define MS_MINSYMBOLWIDTH 1   /* in pixels */
 #define MS_MAXSYMBOLWIDTH 32

 #define MS_URL 0 /* template types */
@@ -309,7 +316,7 @@ extern "C" {
 #define MS_NUMBER 2003
 #define MS_COMMENT 2004

-// General macro definitions
+/* General macro definitions */
 #define MS_MIN(a,b)     (((a)<(b))?(a):(b))
 #define MS_MAX(a,b) (((a)>(b))?(a):(b))
 #define MS_ABS(a) (((a)<0) ? -(a) : (a))
@@ -319,7 +326,7 @@ extern "C" {
 #define MS_PEN_TRANSPARENT -1
 #define MS_PEN_UNSET     -4

-//#define MS_VALID_EXTENT(minx, miny, maxx, maxy)  (((minx<maxx) && (miny<maxy))?MS_TRUE:MS_FALSE)
+/* #define MS_VALID_EXTENT(minx, miny, maxx, maxy)  (((minx<maxx) && (miny<maxy))?MS_TRUE:MS_FALSE) */
 #define MS_VALID_EXTENT(rect)  (((rect.minx < rect.maxx && rect.miny < rect.maxy))?MS_TRUE:MS_FALSE)

 #define MS_INIT_COLOR(color,r,g,b) { (color).red = r; (color).green = g; (color).blue = b; (color).pen = MS_PEN_UNSET; }
@@ -348,17 +355,17 @@ extern "C" {
 #define MS_RENDERER_PDF(format) ((format)->renderer == MS_RENDER_WITH_PDF)
 #define MS_RENDERER_IMAGEMAP(format) ((format)->renderer == MS_RENDER_WITH_IMAGEMAP)

-// ok, we'll switch to an UL cell model to make this work with WMS
+/* ok, we'll switch to an UL cell model to make this work with WMS */
 #define MS_CELLSIZE(min,max,d)    ((max - min)/d)
 #define MS_MAP2IMAGE_X(x,minx,cx) (MS_NINT((x - minx)/cx))
 #define MS_MAP2IMAGE_Y(y,maxy,cy) (MS_NINT((maxy - y)/cy))
 #define MS_IMAGE2MAP_X(x,minx,cx) (minx + cx*x)
 #define MS_IMAGE2MAP_Y(y,maxy,cy) (maxy - cy*y)

-// For maplabel and mappdf
+/* For maplabel and mappdf */
 #define LINE_VERT_THRESHOLD .17 // max absolute value of cos of line angle, the closer to zero the more vertical the line must be

-// For CARTO symbols
+/* For CARTO symbols */
 #define MS_PI    3.14159265358979323846
 #define MS_PI2   1.57079632679489661923  // (MS_PI / 2)
 #define MS_3PI2  4.71238898038468985769  // (3 * MS_PI2)
@@ -366,13 +373,13 @@ extern "C" {

 #endif

-// General enumerated types - needed by scripts
+/* General enumerated types - needed by scripts */
 enum MS_FILE_TYPE {MS_FILE_MAP, MS_FILE_SYMBOL};
 enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS};
 enum MS_SHAPE_TYPE {MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULL};
 enum MS_LAYER_TYPE {MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON, MS_LAYER_RASTER, MS_LAYER_ANNOTATION, MS_LAYER_QUERY, MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX};
 enum MS_FONT_TYPE {MS_TRUETYPE, MS_BITMAP};
-enum MS_LABEL_POSITIONS {MS_UL, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC, MS_CC, MS_AUTO, MS_XY}; // arrangement matters for auto placement, don't change it
+enum MS_LABEL_POSITIONS {MS_UL, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC, MS_CC, MS_AUTO, MS_XY}; /* arrangement matters for auto placement, don't change it */
 enum MS_BITMAP_FONT_SIZES {MS_TINY , MS_SMALL, MS_MEDIUM, MS_LARGE, MS_GIANT};
 enum MS_QUERYMAP_STYLES {MS_NORMAL, MS_HILITE, MS_SELECTED};
 enum MS_CONNECTION_TYPE {MS_INLINE, MS_SHAPEFILE, MS_TILED_SHAPEFILE, MS_SDE, MS_OGR, MS_UNUSED_1, MS_POSTGIS, MS_WMS, MS_ORACLESPATIAL, MS_WFS, MS_GRATICULE, MS_MYGIS, MS_RASTER };
@@ -389,7 +396,7 @@ enum MS_IMAGEMODE { MS_IMAGEMODE_PC256,
 #define MS_FILE_DEFAULT MS_FILE_MAP


-// FONTSET OBJECT - used to hold aliases for TRUETYPE fonts
+/* FONTSET OBJECT - used to hold aliases for TRUETYPE fonts */
 typedef struct {
 #ifdef SWIG
 %immutable;
@@ -405,19 +412,19 @@ typedef struct {
 #endif
 } fontSetObj;

-// FEATURE LIST OBJECT - for inline features, shape caches and queries
+/* FEATURE LIST OBJECT - for inline features, shape caches and queries */
 #ifndef SWIG
 typedef struct listNode {
   shapeObj shape;
   struct listNode *next;
-  struct listNode *tailifhead; // this is the tail node in the list, if this is the head element, otherwise NULL
+  struct listNode *tailifhead; /* this is the tail node in the list, if this is the head element, otherwise NULL */
 } featureListNodeObj;

 typedef featureListNodeObj * featureListNodeObjPtr;
 #endif

 #ifndef SWIG
-// PALETTE OBJECT - used to hold colors while a map file is read
+/* PALETTE OBJECT - used to hold colors while a map file is read */
 typedef struct {
   colorObj colors[MS_MAXCOLORS-1];
   int      colorvalue[MS_MAXCOLORS-1];
@@ -425,34 +432,34 @@ typedef struct {
 } paletteObj;
 #endif

-// EXPRESSION OBJECT
+/* EXPRESSION OBJECT */
 #ifndef SWIG
 typedef struct {
   char *string;
   int type;

-  // logical expression options
+  /* logical expression options */
   char **items;
   int *indexes;
   int numitems;

-  // regular expression options
-  regex_t regex; // compiled regular expression to be matched
+  /* regular expression options */
+  regex_t regex; /* compiled regular expression to be matched */
   int compiled;
 } expressionObj;
 #endif

 #ifndef SWIG
-// JOIN OBJECT - simple way to access other XBase files, one-to-one or one-to-many supported
+/* JOIN OBJECT - simple way to access other XBase files, one-to-one or one-to-many supported */
 typedef struct {
   char *name;
-  char **items, **values; // items/values (process 1 record at a time)
+  char **items, **values; /* items/values (process 1 record at a time) */
   int numitems;

   char *table;
-  char *from, *to; // item names
+  char *from, *to; /* item names */

-  void *joininfo; // vendor specific (i.e. XBase, MySQL, etc.) stuff to allow for persistant access
+  void *joininfo; /* vendor specific (i.e. XBase, MySQL, etc.) stuff to allow for persistant access */

   char *header, *footer;
 #ifndef __cplusplus
@@ -467,27 +474,27 @@ typedef struct {
 } joinObj;
 #endif

-// OUTPUT FORMAT OBJECT - see mapoutput.c for most related code.
+/* OUTPUT FORMAT OBJECT - see mapoutput.c for most related code. */
 typedef struct {
   char *name;
   char *mimetype;
   char *driver;
   char *extension;
-  int  renderer;  // MS_RENDER_WITH_*
-  int  imagemode; // MS_IMAGEMODE_* value.
+  int  renderer;  /* MS_RENDER_WITH_* */
+  int  imagemode; /* MS_IMAGEMODE_* value. */
   int  transparent;
   int  bands;
   int  numformatoptions;
   char **formatoptions;
   int  refcount;
-  int inmapfile; //boolean value for writing
+  int inmapfile; /* boolean value for writing */
 } outputFormatObj;

-// The following is used for "don't care" values in transparent, interlace and
-// imagequality values.
+/* The following is used for "don't care" values in transparent, interlace and
+   imagequality values. */
 #define MS_NOOVERRIDE  -1111

-// QUERY MAP OBJECT - used to visualize query results
+/* QUERY MAP OBJECT - used to visualize query results */
 typedef struct {
   int height, width;
   int status;
@@ -495,7 +502,7 @@ typedef struct {
   colorObj color;
 } queryMapObj;

-// LABEL OBJECT - parameters needed to annotate a layer, legend or scalebar
+/* LABEL OBJECT - parameters needed to annotate a layer, legend or scalebar */
 typedef struct {
   char *font;
   enum MS_FONT_TYPE type;
@@ -517,7 +524,7 @@ typedef struct {
   int offsetx, offsety;

   double angle;
-  int autoangle; // true or false
+  int autoangle; /* true or false */

   int buffer; /* space to reserve around a label */

@@ -526,17 +533,17 @@ typedef struct {
   char wrap;

   int minfeaturesize; /* minimum feature size (in pixels) to label */
-  int autominfeaturesize; // true or false
+  int autominfeaturesize; /* true or false */

   int mindistance;
   int partials; /* can labels run of an image */

-  int force; // labels *must* be drawn
+  int force; /* labels *must* be drawn */

   char *encoding;
 } labelObj;

-// WEB OBJECT - holds parameters for a mapserver/mapscript interface
+/* WEB OBJECT - holds parameters for a mapserver/mapscript interface */
 typedef struct {
   char *log;
   char *imagepath, *imageurl;
@@ -555,13 +562,13 @@ typedef struct {
   double minscale, maxscale;
   char *mintemplate, *maxtemplate;

-  char *queryformat; // what format is the query to be returned, given as a MIME type
+  char *queryformat; /* what format is the query to be returned, given as a MIME type */

   hashTableObj metadata;

 } webObj;

-// STYLE OBJECT - holds parameters for symbolization, multiple styles may be applied within a classObj
+/* STYLE OBJECT - holds parameters for symbolization, multiple styles may be applied within a classObj */
 typedef struct {
   colorObj color;
   colorObj backgroundcolor;
@@ -576,17 +583,18 @@ typedef struct {
   int width;
   int minwidth, maxwidth;

-  int offsetx, offsety; // for shadows, hollow symbols, etc...
+  int offsetx, offsety; /* for shadows, hollow symbols, etc... */

-  double angle; // for future use
+  double angle; /* for future use */

   int antialias;

 #ifndef SWIG
-  // Whether the style is within a class MS_TRUE or MS_FALSE.
-  // If true, then memory deallocation is handled by the class
-  // if false, then memory deallocation must be handled by the
-  // application.
+  /* Whether the style is within a class MS_TRUE or MS_FALSE.
+   * If true, then memory deallocation is handled by the class
+   * if false, then memory deallocation must be handled by the
+   * application.
+   */
   int isachild;
 #endif

@@ -596,10 +604,10 @@ typedef struct {
 #endif
 } styleObj;

-// CLASS OBJECT - basic symbolization and classification information
+/* CLASS OBJECT - basic symbolization and classification information */
 typedef struct class_obj{
 #ifndef SWIG
-  expressionObj expression; // the expression to be matched
+  expressionObj expression; /* the expression to be matched */
 #endif

   int status;
@@ -612,18 +620,18 @@ typedef struct class_obj{

   labelObj label;

-  char *name; // should be unique within a layer
-  char *title; // used for legend labeling
+  char *name; /* should be unique within a layer */
+  char *title; /* used for legend labeling */

 #ifndef SWIG
   expressionObj text;
-#endif
+#endif /* not SWIG */

 #ifndef __cplusplus
   char *template;
-#else
+#else /* __cplusplus */
   char *_template;
-#endif
+#endif /* __cplusplus */

   int type;

@@ -636,34 +644,34 @@ typedef struct class_obj{
   char *keyimage;
 } classObj;

-// LABELCACHE OBJECTS - structures to implement label caching and collision avoidance etc
-// Note: These are scriptable, but are read only.
+/* LABELCACHE OBJECTS - structures to implement label caching and collision avoidance etc
+   Note: These are scriptable, but are read only. */
 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */
 typedef struct {
   char *text;
   double featuresize;

-  styleObj *styles; // copied from the classObj, only present if there is a marker to be drawn
+  styleObj *styles; /* copied from the classObj, only present if there is a marker to be drawn */
   int numstyles;

-  labelObj label; // copied from the classObj
+  labelObj label; /* copied from the classObj */

-  int layerindex; // indexes
+  int layerindex; /* indexes */
   int classindex;
   int tileindex;
   int shapeindex;

-  pointObj point; // label point
-  shapeObj *poly; // label bounding box
+  pointObj point; /* label point */
+  shapeObj *poly; /* label bounding box */

-  int status; // has this label been drawn or not
+  int status; /* has this label been drawn or not */
 } labelCacheMemberObj;

 typedef struct {
-  int id; // corresponding label
-  shapeObj *poly; // marker bounding box (POINT layers only)
+  int id; /* corresponding label */
+  shapeObj *poly; /* marker bounding box (POINT layers only) */
 } markerCacheMemberObj;

 typedef struct {
@@ -682,7 +690,7 @@ typedef struct {
 } resultCacheMemberObj;
 #ifdef SWIG
 %mutable;
-#endif
+#endif /* SWIG */


 typedef struct {
@@ -690,40 +698,40 @@ typedef struct {
 #ifndef SWIG
   resultCacheMemberObj *results;
   int cachesize;
-#endif
+#endif /* not SWIG */

 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */
   int numresults;
   rectObj bounds;
 #ifdef SWIG
 %mutable;
-#endif
+#endif /* SWIG */

 } resultCacheObj;


-// SYMBOLSET OBJECT
+/* SYMBOLSET OBJECT */
 typedef struct {
   char *filename;
   int imagecachesize;
 #ifdef SWIG
   %immutable;
-#endif // SWIG
+#endif /* SWIG */
   int numsymbols;
 #ifdef SWIG
   %mutable;
-#endif // SWIG
+#endif /* SWIG */
   symbolObj symbol[MS_MAXSYMBOLS];
 #ifndef SWIG
   struct map_obj *map;
-  fontSetObj *fontset; // a pointer to the main mapObj version
+  fontSetObj *fontset; /* a pointer to the main mapObj version */
   struct imageCacheObj *imagecache;
-#endif // SWIG
+#endif /* not SWIG */
 } symbolSetObj;

-// REFERENCE MAP OBJECT
+  /* REFERENCE MAP OBJECT */
 typedef struct {
   rectObj extent;
   int height, width;
@@ -739,7 +747,7 @@ typedef struct {
   struct map_obj *map;
 } referenceMapObj;

-// SCALEBAR OBJECT
+/* SCALEBAR OBJECT */
 typedef struct {
   colorObj imagecolor;
   int height, width;
@@ -750,35 +758,35 @@ typedef struct {
   colorObj backgroundcolor;
   colorObj outlinecolor;
   int units;
-  int status; // ON, OFF or EMBED
-  int position; // for embeded scalebars
+  int status; /* ON, OFF or EMBED */
+  int position; /* for embeded scalebars */
 #ifndef SWIG
   int transparent;
   int interlace;
-#endif
+#endif /* not SWIG */
   int postlabelcache;
 } scalebarObj;

-// LEGEND OBJECT
+/* LEGEND OBJECT */
 typedef struct {
   colorObj imagecolor;
   labelObj label;
   int keysizex, keysizey;
   int keyspacingx, keyspacingy;
-  colorObj outlinecolor; // Color of outline of box, -1 for no outline
-  int status; // ON, OFF or EMBED
+  colorObj outlinecolor; /* Color of outline of box, -1 for no outline */
+  int status; /* ON, OFF or EMBED */
   int height, width;
-  int position; // for embeded legends
+  int position; /* for embeded legends */
 #ifndef SWIG
   int transparent;
   int interlace;
-#endif
+#endif /* not SWIG */
   int postlabelcache;
 #ifndef __cplusplus
    char *template;
-#else
+#else /* __cplusplus */
    char *_template;
-#endif
+#endif /* __cplusplus */
   struct map_obj *map;
 } legendObj;

@@ -808,146 +816,146 @@ typedef struct
   char    *labelformat;
 } graticuleObj;

-// LAYER OBJECT - basic unit of a map
+/* LAYER OBJECT - basic unit of a map */
 typedef struct layer_obj {

-  char *classitem; // .DBF item to be used for symbol lookup
+  char *classitem; /* .DBF item to be used for symbol lookup */

 #ifndef SWIG
   int classitemindex;
-  resultCacheObj *resultcache; // holds the results of a query against this layer
-  int annotate; // boolean flag for annotation
-  double scalefactor; // computed, not set
+  resultCacheObj *resultcache; /* holds the results of a query against this layer */
+  int annotate; /* boolean flag for annotation */
+  double scalefactor; /* computed, not set */
 #ifndef __cplusplus
-  classObj *class; // always at least 1 class
-#else
+  classObj *class; /* always at least 1 class */
+#else /* __cplusplus */
   classObj *_class;
-#endif
-#endif
+#endif /* __cplusplus */
+#endif /* not SWIG */

 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */
   int numclasses;
   int index;
   struct map_obj *map;
 #ifdef SWIG
 %mutable;
-#endif
+#endif /* SWIG */

-  char *header, *footer; // only used with multi result queries
+  char *header, *footer; /* only used with multi result queries */

 #ifndef __cplusplus
-  char *template; // global template, used across all classes
-#else
+  char *template; /* global template, used across all classes */
+#else /* __cplusplus */
   char *_template;
-#endif
+#endif /* __cplusplus */

-  char *name; // should be unique
-  char *group; // shouldn't be unique it's supposed to be a group right?
+  char *name; /* should be unique */
+  char *group; /* shouldn't be unique it's supposed to be a group right? */

-  int status; // on or off
-  char *data; // filename, can be relative or full path
+  int status; /* on or off */
+  char *data; /* filename, can be relative or full path */

   enum MS_LAYER_TYPE type;

-  double tolerance; // search buffer for point and line queries (in toleranceunits)
+  double tolerance; /* search buffer for point and line queries (in toleranceunits) */
   int toleranceunits;

-  double symbolscale; // scale at which symbols are default size
+  double symbolscale; /* scale at which symbols are default size */
   double minscale, maxscale;
   double labelminscale, labelmaxscale;
-  int sizeunits; // applies to all classes
+  int sizeunits; /* applies to all classes */

   int maxfeatures;

-  colorObj offsite; // transparent pixel value for raster images
+  colorObj offsite; /* transparent pixel value for raster images */

-  int transform; // does this layer have to be transformed to file coordinates
+  int transform; /* does this layer have to be transformed to file coordinates */

-  int labelcache, postlabelcache; // on or off
+  int labelcache, postlabelcache; /* on or off */

   char *labelitem, *labelsizeitem, *labelangleitem;
   int labelitemindex, labelsizeitemindex, labelangleitemindex;

   char *tileitem;
-  char *tileindex; // layer index file for tiling support
+  char *tileindex; /* layer index file for tiling support */

 #ifndef SWIG
   int tileitemindex;
-  projectionObj projection; // projection information for the layer
-  int project; // boolean variable, do we need to project this layer or not
-#endif
+  projectionObj projection; /* projection information for the layer */
+  int project; /* boolean variable, do we need to project this layer or not */
+#endif /* not SWIG */

-  int units; // units of the projection
+  int units; /* units of the projection */

 #ifndef SWIG
-  featureListNodeObjPtr features; // linked list so we don't need a counter
-  featureListNodeObjPtr currentfeature; // pointer to the current feature
-#endif
+  featureListNodeObjPtr features; /* linked list so we don't need a counter */
+  featureListNodeObjPtr currentfeature; /* pointer to the current feature */
+#endif /* SWIG */

   char *connection;
   enum MS_CONNECTION_TYPE connectiontype;

 #ifndef SWIG
   struct layer_obj *sameconnection;
-  // SDL has converted OracleSpatial, SDE, Graticules, MyGIS
-  void *layerinfo; // all connection types should use this generic pointer to a vendor specific structure
-  void *ogrlayerinfo; // For OGR layers, will contain a msOGRLayerInfo struct
-  void *wfslayerinfo; // For WFS layers, will contain a msWFSLayerInfo struct
-#endif
+  /* SDL has converted OracleSpatial, SDE, Graticules, MyGIS */
+  void *layerinfo; /* all connection types should use this generic pointer to a vendor specific structure */
+  void *ogrlayerinfo; /* For OGR layers, will contain a msOGRLayerInfo struct */
+  void *wfslayerinfo; /* For WFS layers, will contain a msWFSLayerInfo struct */
+#endif /* not SWIG */

-  // attribute/classification handling components
+  /* attribute/classification handling components */
 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */
   int numitems;
 #ifdef SWIG
 %mutable;
-#endif
+#endif /* SWIG */

 #ifndef SWIG
   char **items;
-  void *iteminfo; // connection specific information necessary to retrieve values
-  expressionObj filter; // connection specific attribute filter
+  void *iteminfo; /* connection specific information necessary to retrieve values */
+  expressionObj filter; /* connection specific attribute filter */
   int bandsitemindex;
   int filteritemindex;
   int styleitemindex;
-#endif
+#endif /* not SWIG */

-  char *bandsitem; // which item in a tile contains bands to use (tiled raster data only)
+  char *bandsitem; /* which item in a tile contains bands to use (tiled raster data only) */
   char *filteritem;
-  char *styleitem; // item to be used for style lookup - can also be 'AUTO'
+  char *styleitem; /* item to be used for style lookup - can also be 'AUTO' */

-  char *requires; // context expressions, simple enough to not use expressionObj
+  char *requires; /* context expressions, simple enough to not use expressionObj */
   char *labelrequires;

   hashTableObj metadata;

-  int transparency; // transparency value 0-100
+  int transparency; /* transparency value 0-100 */

   int dump;
   int debug;
 #ifndef SWIG
   char **processing;
   joinObj *joins;
-#endif
+#endif /* not SWIG */
 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */

 #ifndef SWIGJAVA
   rectObj extent;
-#endif
+#endif /* not SWIGJAVA */

   int numprocessing;
   int numjoins;
 #ifdef SWIG
 %mutable;
-#endif
+#endif /* SWIG */
 } layerObj;

-// MAP OBJECT - encompasses everything used in an Internet mapping application
+/* MAP OBJECT - encompasses everything used in an Internet mapping application */
 typedef struct map_obj{ /* structure for a map */
   char *name; /* small identifier for naming etc. */
   int status; /* is map creation on or off */
@@ -956,24 +964,24 @@ typedef struct map_obj{ /* structure for

 #ifndef SWIG
   layerObj *layers;
-#endif
+#endif /* SWIG */

 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */
   int numlayers; /* number of layers in mapfile */
 #ifdef SWIG
 %mutable;
-#endif
+#endif /* SWIG */

   symbolSetObj symbolset;
   fontSetObj fontset;

   labelCacheObj labelcache; /* we need this here so multiple feature processors can access it */

-  int transparent; // TODO - Deprecated
-  int interlace; // TODO - Deprecated
-  int imagequality; // TODO - Deprecated
+  int transparent; /* TODO - Deprecated */
+  int interlace; /* TODO - Deprecated */
+  int imagequality; /* TODO - Deprecated */

   rectObj extent; /* map extent array */
   double cellsize; /* in map units */
@@ -994,7 +1002,7 @@ typedef struct map_obj{ /* structure for

 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */
   int numoutputformats;
   outputFormatObj **outputformatlist;
   outputFormatObj *outputformat;
@@ -1002,12 +1010,12 @@ typedef struct map_obj{ /* structure for
   char *imagetype; /* name of current outputformat */
 #ifdef SWIG
   %mutable;
-#endif // SWIG
+#endif /* SWIG */

 #ifndef SWIG
   projectionObj projection; /* projection information for output map */
   projectionObj latlon; /* geographic projection definition */
-#endif
+#endif /* not SWIG */

   referenceMapObj reference;
   scalebarObj scalebar;
@@ -1026,7 +1034,7 @@ typedef struct map_obj{ /* structure for
   hashTableObj configoptions;
 } mapObj;

-//SWF Object structure
+/* SWF Object structure */
 #ifdef USE_MING_FLASH
 typedef struct  {
   mapObj *map;
@@ -1036,31 +1044,31 @@ typedef struct  {
   int nCurrentMovie;
   int nCurrentLayerIdx;
   int nCurrentShapeIdx;
-  void    *imagetmp;  //used when the output format is SINGLE
-                      //(one movie for the whole map)
-  int *panLayerIndex; // keeps the layer index for every movie created.
+  void    *imagetmp;  /* used when the output format is SINGLE  */
+                      /* (one movie for the whole map) */
+  int *panLayerIndex; /* keeps the layer index for every movie created. */
 } SWFObj;
-#endif
+#endif /* USE_MING_FLASH */

-//PDF Object structure
+/* PDF Object structure */
 #ifdef USE_PDF
 typedef struct {
   mapObj *map;
   PDF *pdf;
-  void    *imagetmp;  //used when the FORMATOPTION "OUTPUT_TYPE=RASTER"
+  void    *imagetmp;  /* used when the FORMATOPTION "OUTPUT_TYPE=RASTER" */
 } PDFObj;
-#endif
+#endif /* USE_PDF */

-// IMAGE OBJECT - a wrapper for GD images
+/* IMAGE OBJECT - a wrapper for GD images */
 typedef struct {
 #ifdef SWIG
 %immutable;
-#endif
+#endif /* SWIG */
   int width, height;
   char *imagepath, *imageurl;
 #ifdef SWIG
 %mutable;
-#endif
+#endif /* SWIG */

   outputFormatObj *format;
   int renderer;
@@ -1071,25 +1079,25 @@ typedef struct {
     gdImagePtr gd;
 #ifdef USE_MING_FLASH
     SWFObj *swf;
-#endif
+#endif /* USE_MING_FLASH */
 #ifdef USE_PDF
     PDFObj *pdf;
-#endif
+#endif /* USE_PDF */
     char *imagemap;
     short *raw_16bit;
     float *raw_float;
     unsigned char *raw_byte;
   } img;
-#endif
+#endif /* not SWIG */
 } imageObj;


-// Function prototypes, wrapable
+/* Function prototypes, wrapable */
 MS_DLL_EXPORT int msSaveImage(mapObj *map, imageObj *img, char *filename);
 MS_DLL_EXPORT void msFreeImage(imageObj *img);
 MS_DLL_EXPORT void msCleanup(void);

-// Function prototypes, not wrapable
+/* Function prototypes, not wrapable */

 #ifndef SWIG
 int msDrawSDELayer(mapObj *map, layerObj *layer, gdImagePtr img); /* in mapsde.c */
@@ -1123,9 +1131,9 @@ MS_DLL_EXPORT void freeFeatureList(featu

 MS_DLL_EXPORT int msLoadProjectionString(projectionObj *p, char *value);

-// To be used *only* within the mapfile loading phase
+/* To be used *only* within the mapfile loading phase */
 MS_DLL_EXPORT int loadExpressionString(expressionObj *exp, char *value);
-// Use this next, thread safe wrapper, function everywhere else
+/* Use this next, thread safe wrapper, function everywhere else */
 MS_DLL_EXPORT int msLoadExpressionString(expressionObj *exp, char *value);
 MS_DLL_EXPORT void freeExpression(expressionObj *exp);

@@ -1133,7 +1141,7 @@ MS_DLL_EXPORT int getClassIndex(layerObj



-// For maplabel and mappdf
+/* For maplabel and mappdf */
 int labelInImage(int width, int height, shapeObj *lpoly, int buffer);
 int intersectLabelPolygons(shapeObj *p1, shapeObj *p2);
 pointObj get_metrics(pointObj *p, int position, rectObj rect, int ox, int oy, double angle, int buffer, shapeObj *poly);
@@ -1145,7 +1153,7 @@ double dist(pointObj a, pointObj b);
 ** Main API Functions
 */

-// mapobject.c
+/* mapobject.c */

 MS_DLL_EXPORT void msFreeMap(mapObj *map);
 MS_DLL_EXPORT mapObj *msNewMapObj(void);
@@ -1169,9 +1177,9 @@ MS_DLL_EXPORT int msMapRestoreRealExtent
 MS_DLL_EXPORT int msMapLoadOWSParameters( mapObj *map, cgiRequestObj *request,
                                           const char *wmtver_string );

-// mapfile.c
+/* mapfile.c */

-MS_DLL_EXPORT int msGetLayerIndex(mapObj *map, char *name); // in mapfile.c
+MS_DLL_EXPORT int msGetLayerIndex(mapObj *map, char *name); /* in mapfile.c */
 MS_DLL_EXPORT int msGetSymbolIndex(symbolSetObj *set, char *name, int try_addimage_if_notfound);
 MS_DLL_EXPORT mapObj  *msLoadMap(char *filename, char *new_mappath);
 MS_DLL_EXPORT int msSaveMap(mapObj *map, char *filename);
@@ -1182,25 +1190,25 @@ MS_DLL_EXPORT void msFree(void *p);
 MS_DLL_EXPORT char **msTokenizeMap(char *filename, int *numtokens);
 MS_DLL_EXPORT int msInitLabelCache(labelCacheObj *cache);
 MS_DLL_EXPORT int msFreeLabelCache(labelCacheObj *cache);
-MS_DLL_EXPORT int msCheckConnection(layerObj * layer); // connection pooling functions (mapfile.c)
+MS_DLL_EXPORT int msCheckConnection(layerObj * layer); /* connection pooling functions (mapfile.c) */
 MS_DLL_EXPORT void msCloseConnections(mapObj *map);

 #if defined USE_PDF
-MS_DLL_EXPORT PDF *msDrawMapPDF(mapObj *map, PDF *pdf, hashTableObj fontHash); // mappdf.c
-#endif
+MS_DLL_EXPORT PDF *msDrawMapPDF(mapObj *map, PDF *pdf, hashTableObj fontHash); /* mappdf.c */
+#endif /* USE_PDF */

 MS_DLL_EXPORT void msOGRCleanup(void);
 MS_DLL_EXPORT void msGDALCleanup(void);
 MS_DLL_EXPORT void msGDALInitialize(void);


-MS_DLL_EXPORT imageObj *msDrawScalebar(mapObj *map); // in mapscale.c
+MS_DLL_EXPORT imageObj *msDrawScalebar(mapObj *map); /* in mapscale.c */
 MS_DLL_EXPORT int msCalculateScale(rectObj extent, int units, int width, int height, double resolution, double *scale);
 MS_DLL_EXPORT double msInchesPerUnit(int units, double center_lat);
 MS_DLL_EXPORT int msEmbedScalebar(mapObj *map, gdImagePtr img);


-MS_DLL_EXPORT int msPointInRect(pointObj *p, rectObj *rect); // in mapsearch.c
+MS_DLL_EXPORT int msPointInRect(pointObj *p, rectObj *rect); /* in mapsearch.c */
 MS_DLL_EXPORT int msRectOverlap(rectObj *a, rectObj *b);
 MS_DLL_EXPORT int msRectContained(rectObj *a, rectObj *b);

@@ -1223,7 +1231,7 @@ MS_DLL_EXPORT int msIntersectPolylinePol
 MS_DLL_EXPORT int msIntersectPolygons(shapeObj *p1, shapeObj *p2);
 MS_DLL_EXPORT int msIntersectPolylines(shapeObj *line1, shapeObj *line2);

-MS_DLL_EXPORT int msSaveQuery(mapObj *map, char *filename); // in mapquery.c
+MS_DLL_EXPORT int msSaveQuery(mapObj *map, char *filename); /* in mapquery.c */
 MS_DLL_EXPORT int msLoadQuery(mapObj *map, char *filename);
 MS_DLL_EXPORT int msQueryByIndex(mapObj *map, int qlayer, int tileindex, int shapeindex);
 MS_DLL_EXPORT int msQueryByIndexAdd(mapObj *map, int qlayer, int tileindex, int shapeindex);
@@ -1241,7 +1249,7 @@ MS_DLL_EXPORT int msRasterQueryByPoint(m
                          pointObj p, double buffer );


-MS_DLL_EXPORT void trimBlanks(char *string); // in mapstring.c
+MS_DLL_EXPORT void trimBlanks(char *string); /* in mapstring.c */
 MS_DLL_EXPORT char *trimLeft(char *string);
 MS_DLL_EXPORT char *chop(char *string);
 MS_DLL_EXPORT void trimEOL(char *string);
@@ -1266,24 +1274,24 @@ MS_DLL_EXPORT char *msHashString(const c

 #ifdef NEED_STRDUP
 MS_DLL_EXPORT char *strdup(char *s);
-#endif
+#endif /* NEED_STRDUP */

 #ifdef NEED_STRNCASECMP
 MS_DLL_EXPORT int strncasecmp(const char *s1, const char *s2, int len);
-#endif
+#endif /* NEED_STRNCASECMP */

 #ifdef NEED_STRCASECMP
 MS_DLL_EXPORT int strcasecmp(const char *s1, const char *s2);
-#endif
+#endif /* NEED_STRCASECMP */

 #ifdef NEED_STRLCAT
 MS_DLL_EXPORT size_t strlcat(char *dst, const char *src, size_t siz);
-#endif
+#endif /* NEED_STRLCAT */

-// in mapsymbol.c
-// Use this function *only* with mapfile loading phase
+/* in mapsymbol.c */
+/* Use this function *only* with mapfile loading phase */
 MS_DLL_EXPORT int loadSymbolSet(symbolSetObj *symbolset, mapObj *map);
-// Use this threadsafe wrapper everywhere else
+/* Use this threadsafe wrapper everywhere else */
 MS_DLL_EXPORT int msLoadSymbolSet(symbolSetObj *symbolset, mapObj *map);
 MS_DLL_EXPORT int msCopySymbol(symbolObj *dst, symbolObj *src, mapObj *map);
 MS_DLL_EXPORT int msCopySymbolSet(symbolSetObj *dst, symbolSetObj *src, mapObj *map);
@@ -1304,12 +1312,12 @@ MS_DLL_EXPORT int msGetCharacterSize(cha
 MS_DLL_EXPORT double msSymbolGetDefaultSize(symbolObj *s);
 MS_DLL_EXPORT void freeImageCache(struct imageCacheObj *ic);

-MS_DLL_EXPORT imageObj *msDrawLegend(mapObj *map, int scale_independent); // in maplegend.c
+MS_DLL_EXPORT imageObj *msDrawLegend(mapObj *map, int scale_independent); /* in maplegend.c */
 MS_DLL_EXPORT int msEmbedLegend(mapObj *map, gdImagePtr img);
 MS_DLL_EXPORT int msDrawLegendIcon(mapObj* map, layerObj* lp, classObj* myClass, int width, int height, gdImagePtr img, int dstX, int dstY);
 MS_DLL_EXPORT imageObj *msCreateLegendIcon(mapObj* map, layerObj* lp, classObj* myClass, int width, int height);

-MS_DLL_EXPORT int msLoadFontSet(fontSetObj *fontSet, mapObj *map); // in maplabel.c
+MS_DLL_EXPORT int msLoadFontSet(fontSetObj *fontSet, mapObj *map); /* in maplabel.c */
 MS_DLL_EXPORT int msInitFontSet(fontSetObj *fontset);
 MS_DLL_EXPORT int msFreeFontSet(fontSetObj *fontset);

@@ -1320,7 +1328,7 @@ MS_DLL_EXPORT gdFontPtr msGetBitmapFont(
 MS_DLL_EXPORT int msImageTruetypePolyline(symbolSetObj *symbolset, gdImagePtr img, shapeObj *p, styleObj *style, double scalefactor);
 MS_DLL_EXPORT int msImageTruetypeArrow(symbolSetObj *symbolset, gdImagePtr img, shapeObj *p, styleObj *style, double scalefactor);

-MS_DLL_EXPORT void msFreeShape(shapeObj *shape); // in mapprimative.c
+MS_DLL_EXPORT void msFreeShape(shapeObj *shape); /* in mapprimative.c */
 MS_DLL_EXPORT void msInitShape(shapeObj *shape);
 MS_DLL_EXPORT int msCopyShape(shapeObj *from, shapeObj *to);
 MS_DLL_EXPORT int *msGetOuterList(shapeObj *shape);
@@ -1337,16 +1345,16 @@ MS_DLL_EXPORT int msPolylineLabelPoint(s
 MS_DLL_EXPORT int msPolygonLabelPoint(shapeObj *p, pointObj *lp, int min_dimension);
 MS_DLL_EXPORT int msAddLine(shapeObj *p, lineObj *new_line);

-MS_DLL_EXPORT int msDrawRasterLayer(mapObj *map, layerObj *layer, imageObj *image); // in mapraster.c
+MS_DLL_EXPORT int msDrawRasterLayer(mapObj *map, layerObj *layer, imageObj *image); /* in mapraster.c */
 MS_DLL_EXPORT imageObj *msDrawReferenceMap(mapObj *map);

-MS_DLL_EXPORT size_t msGetBitArraySize(int numbits); // in mapbits.c
+MS_DLL_EXPORT size_t msGetBitArraySize(int numbits); /* in mapbits.c */
 MS_DLL_EXPORT char *msAllocBitArray(int numbits);
 MS_DLL_EXPORT int msGetBit(char *array, int index);
 MS_DLL_EXPORT void msSetBit(char *array, int index, int value);
 MS_DLL_EXPORT void msFlipBit(char *array, int index);

-MS_DLL_EXPORT int msLayerOpen(layerObj *layer); // in maplayer.c
+MS_DLL_EXPORT int msLayerOpen(layerObj *layer); /* in maplayer.c */
 MS_DLL_EXPORT int msLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT void msLayerClose(layerObj *layer);
 MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect);
@@ -1369,11 +1377,11 @@ MS_DLL_EXPORT char* msLayerGetFilterStri
 MS_DLL_EXPORT int msLayerSetTimeFilter(layerObj *lp, const char *timestring,
                                        const char *timefield);

-// maplayer.c
+/* maplayer.c */
 MS_DLL_EXPORT int msINLINELayerGetShape(layerObj *layer, shapeObj *shape, int shapeindex);
 MS_DLL_EXPORT int msLayerGetNumFeatures(layerObj *layer);

-MS_DLL_EXPORT int msTiledSHPOpenFile(layerObj *layer); // in mapshape.c
+MS_DLL_EXPORT int msTiledSHPOpenFile(layerObj *layer); /* in mapshape.c */
 MS_DLL_EXPORT int msTiledSHPWhichShapes(layerObj *layer, rectObj rect);
 MS_DLL_EXPORT int msTiledSHPNextShape(layerObj *layer, shapeObj *shape);
 MS_DLL_EXPORT int msTiledSHPGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
@@ -1382,7 +1390,7 @@ MS_DLL_EXPORT int msTiledSHPLayerGetItem
 MS_DLL_EXPORT int msTiledSHPLayerInitItemInfo(layerObj *layer);
 MS_DLL_EXPORT int msTiledSHPLayerGetExtent(layerObj *layer, rectObj *extent);

-MS_DLL_EXPORT int msOGRLayerOpen(layerObj *layer, const char *pszOverrideConnection); // in mapogr.cpp
+MS_DLL_EXPORT int msOGRLayerOpen(layerObj *layer, const char *pszOverrideConnection); /* in mapogr.cpp */
 MS_DLL_EXPORT int msOGRLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT int msOGRLayerClose(layerObj *layer);
 MS_DLL_EXPORT int msOGRLayerWhichShapes(layerObj *layer, rectObj rect);
@@ -1396,9 +1404,9 @@ MS_DLL_EXPORT int msOGRLayerGetAutoStyle
 #ifdef USE_OGR
 MS_DLL_EXPORT int msOGRGeometryToShape(OGRGeometryH hGeometry, shapeObj *shape,
                          OGRwkbGeometryType type);
-#endif
+#endif /* USE_OGR */

-MS_DLL_EXPORT int msPOSTGISLayerOpen(layerObj *layer); // in mappostgis.c
+MS_DLL_EXPORT int msPOSTGISLayerOpen(layerObj *layer); /* in mappostgis.c */
 MS_DLL_EXPORT int msPOSTGISLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT void msPOSTGISLayerFreeItemInfo(layerObj *layer);
 MS_DLL_EXPORT int msPOSTGISLayerInitItemInfo(layerObj *layer);
@@ -1411,7 +1419,7 @@ MS_DLL_EXPORT int msPOSTGISLayerGetShape
 MS_DLL_EXPORT int msPOSTGISLayerGetItems(layerObj *layer);
 MS_DLL_EXPORT int msPOSTGISLayerResultClose(layerObj *layer);

-MS_DLL_EXPORT int msMYGISLayerOpen(layerObj *layer); // in mapmygis.c
+MS_DLL_EXPORT int msMYGISLayerOpen(layerObj *layer); /* in mapmygis.c */
 MS_DLL_EXPORT int msMYGISLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT void msMYGISLayerFreeItemInfo(layerObj *layer);
 MS_DLL_EXPORT int msMYGISLayerInitItemInfo(layerObj *layer);
@@ -1423,7 +1431,7 @@ MS_DLL_EXPORT int msMYGISLayerGetExtent(
 MS_DLL_EXPORT int msMYGISLayerGetShapeRandom(layerObj *layer, shapeObj *shape, long *record);
 MS_DLL_EXPORT int msMYGISLayerGetItems(layerObj *layer);

-MS_DLL_EXPORT int msSDELayerOpen(layerObj *layer); // in mapsde.c
+MS_DLL_EXPORT int msSDELayerOpen(layerObj *layer); /* in mapsde.c */
 MS_DLL_EXPORT int msSDELayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT void msSDELayerClose(layerObj *layer);
 MS_DLL_EXPORT int msSDELayerWhichShapes(layerObj *layer, rectObj rect);
@@ -1449,7 +1457,7 @@ MS_DLL_EXPORT int msOracleSpatialLayerIn
 MS_DLL_EXPORT void msOracleSpatialLayerFreeItemInfo(layerObj *layer);
 MS_DLL_EXPORT int msOracleSpatialLayerGetAutoStyle(mapObj *map, layerObj *layer, classObj *c, int tile, long record);

-MS_DLL_EXPORT int msGraticuleLayerOpen(layerObj *layer);   // in mapGraticule.cpp
+MS_DLL_EXPORT int msGraticuleLayerOpen(layerObj *layer);   /* in mapGraticule.cpp */
 MS_DLL_EXPORT int msGraticuleLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT int msGraticuleLayerClose(layerObj *layer);
 MS_DLL_EXPORT int msGraticuleLayerWhichShapes(layerObj *layer, rectObj rect);
@@ -1461,7 +1469,7 @@ MS_DLL_EXPORT int msGraticuleLayerGetSha
 MS_DLL_EXPORT int msGraticuleLayerGetExtent(layerObj *layer, rectObj *extent);
 MS_DLL_EXPORT int msGraticuleLayerGetAutoStyle(mapObj *map, layerObj *layer, classObj *c, int tile, long record);

-MS_DLL_EXPORT int msRASTERLayerOpen(layerObj *layer); // in maprasterquery.c
+MS_DLL_EXPORT int msRASTERLayerOpen(layerObj *layer); /* in maprasterquery.c */
 MS_DLL_EXPORT int msRASTERLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT void msRASTERLayerFreeItemInfo(layerObj *layer);
 MS_DLL_EXPORT int msRASTERLayerInitItemInfo(layerObj *layer);
@@ -1569,22 +1577,22 @@ MS_DLL_EXPORT int msDrawLabelCacheGD(gdI

 MS_DLL_EXPORT void msImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct);

-// Modify the character encoding.
+/* Modify the character encoding. */
 char *msGetEncodedString(const char *string, const char *encoding);

-// various JOIN functions (in mapjoin.c)
+/* various JOIN functions (in mapjoin.c) */
 MS_DLL_EXPORT int msJoinConnect(layerObj *layer, joinObj *join);
 MS_DLL_EXPORT int msJoinPrepare(joinObj *join, shapeObj *shape);
 MS_DLL_EXPORT int msJoinNext(joinObj *join);
 MS_DLL_EXPORT int msJoinClose(joinObj *join);

-//in mapraster.c
+/*in mapraster.c */
 MS_DLL_EXPORT int msDrawRasterLayerLow(mapObj *map, layerObj *layer, imageObj *image);
 MS_DLL_EXPORT int msAddColorGD(mapObj *map, gdImagePtr img, int cmt, int r, int g, int b);
 MS_DLL_EXPORT int msGetClass(layerObj *layer, colorObj *color);
 MS_DLL_EXPORT int msGetClass_Float(layerObj *layer, float fValue);

-//in mapdrawgdal.c
+/* in mapdrawgdal.c */
 MS_DLL_EXPORT int msDrawRasterLayerGDAL(mapObj *map, layerObj *layer, imageObj *image, void *hDSVoid );
 MS_DLL_EXPORT int msGetGDALGeoTransform(void *hDS, mapObj *map, layerObj *layer, double *padfGeoTransform );
 MS_DLL_EXPORT int *msGetGDALBandList( layerObj *layer, void *hDS, int max_bands, int *band_count );
@@ -1597,8 +1605,8 @@ MS_DLL_EXPORT double msGetGDALNoDataValu
 /* ==================================================================== */
 /*      Prototypes for functions in maputil.c                           */
 /* ==================================================================== */
-// For mappdf
-MS_DLL_EXPORT int getRgbColor(mapObj *map,int i,int *r,int *g,int *b); // maputil.c
+/* For mappdf */
+MS_DLL_EXPORT int getRgbColor(mapObj *map,int i,int *r,int *g,int *b); /* maputil.c */
 MS_DLL_EXPORT int msValidateContexts(mapObj *map);
 MS_DLL_EXPORT int msEvalContext(mapObj *map, layerObj *layer, char *context);
 MS_DLL_EXPORT int msEvalExpression(expressionObj *expression, int itemindex, char **items, int numitems);
@@ -1609,21 +1617,21 @@ MS_DLL_EXPORT double msAdjustExtent(rect
 MS_DLL_EXPORT int msConstrainExtent(rectObj *bounds, rectObj *rect, double overlay);
 MS_DLL_EXPORT int *msGetLayersIndexByGroup(mapObj *map, char *groupname, int *nCount);

-//Functions to chnage the drawing order of the layers.
-//Defined in mapobject.c
+/* Functions to chnage the drawing order of the layers. */
+/* Defined in mapobject.c */
 MS_DLL_EXPORT int msMoveLayerUp(mapObj *map, int nLayerIndex);
 MS_DLL_EXPORT int msMoveLayerDown(mapObj *map, int nLayerIndex);
 MS_DLL_EXPORT int msSetLayersdrawingOrder(mapObj *self, int *panIndexes);
 MS_DLL_EXPORT int msInsertLayer(mapObj *map, layerObj *layer, int nIndex);
 MS_DLL_EXPORT layerObj *msRemoveLayer(mapObj *map, int nIndex);

-//Defined in layerobject.c
+/* Defined in layerobject.c */
 MS_DLL_EXPORT int msInsertClass(layerObj *layer,classObj *classobj,int nIndex);
 MS_DLL_EXPORT classObj *msRemoveClass(layerObj *layer, int nIndex);
 MS_DLL_EXPORT int msMoveClassUp(layerObj *layer, int nClassIndex);
 MS_DLL_EXPORT int msMoveClassDown(layerObj *layer, int nClassIndex);

-// classobject.c
+/* classobject.c */
 MS_DLL_EXPORT int msMoveStyleUp(classObj *classo, int nStyleIndex);
 MS_DLL_EXPORT int msMoveStyleDown(classObj *classo, int nStyleIndex);
 MS_DLL_EXPORT int msDeleteStyle(classObj *classo, int iStyleIndex);
@@ -1631,7 +1639,7 @@ MS_DLL_EXPORT int msInsertStyle(classObj
                                 int nStyleIndex);
 MS_DLL_EXPORT styleObj *msRemoveStyle(classObj *classo, int index);

-// Measured shape utility functions.
+/* Measured shape utility functions. */
 MS_DLL_EXPORT pointObj *msGetPointUsingMeasure(shapeObj *shape, double m);
 MS_DLL_EXPORT pointObj *msGetMeasureUsingPoint(shapeObj *shape, pointObj *point);

@@ -1660,13 +1668,13 @@ MS_DLL_EXPORT void msDrawShadeSymbolSWF(
 MS_DLL_EXPORT void msDrawMarkerSymbolSWF(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
 MS_DLL_EXPORT int msDrawRasterLayerSWF(mapObj *map, layerObj *layer, imageObj *image);
 MS_DLL_EXPORT int msDrawVectorLayerAsRasterSWF(mapObj *map, layerObj *layer, imageObj*image);
-// int msDrawWMSLayerSWF(int nLayerId, httpRequestObj *pasReqInfo, int numRequests, mapObj *map, layerObj *layer, imageObj *image);
+/* int msDrawWMSLayerSWF(int nLayerId, httpRequestObj *pasReqInfo, int numRequests, mapObj *map, layerObj *layer, imageObj *image); */
 MS_DLL_EXPORT void msTransformShapeSWF(shapeObj *shape, rectObj extent, double cellsize);
 MS_DLL_EXPORT int msSaveImageSWF(imageObj *image, char *filename);
 MS_DLL_EXPORT void msFreeImageSWF(imageObj *image);
 MS_DLL_EXPORT int draw_textSWF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
 MS_DLL_EXPORT void msDrawStartShapeSWF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
-#endif
+#endif /* USE_MING_FLASH */

 /* ==================================================================== */
 /*      End of prototypes for functions in mapswf.c                     */
@@ -1693,7 +1701,7 @@ MS_DLL_EXPORT int msSaveImagePDF(imageOb
 MS_DLL_EXPORT void msFreeImagePDF(imageObj *image);
 MS_DLL_EXPORT int msDrawTextPDF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
 MS_DLL_EXPORT void msDrawStartShapePDF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
-#endif
+#endif /* USE_PDF */

 /* ==================================================================== */
 /*      End of prototypes for functions in mappdf.c                     */
@@ -1722,7 +1730,7 @@ MS_DLL_EXPORT int msOutputFormatValidate

 #ifndef gdImageTrueColor
 #  define gdImageTrueColor(x) (0)
-#endif
+#endif /* not gdImageTrueColor */

 /* ==================================================================== */
 /*      prototypes for functions in mapgdal.c                           */
Index: mapows.h
===================================================================
RCS file: /data2/cvsroot/mapserver/mapows.h,v
retrieving revision 1.48
diff -u -3 -p -u -r1.48 mapows.h
--- mapows.h    29 Dec 2004 22:49:57 -0000      1.48
+++ mapows.h    1 Feb 2005 22:16:10 -0000
@@ -169,8 +169,8 @@ typedef  struct
   char *pszTypeName;
   char *pszFilter;
   int nMaxFeatures;
-  char *pszBbox; //only used with a Get Request
-  char *pszOutputFormat; //only used with DescibeFeatureType
+  char *pszBbox; /* only used with a Get Request */
+  char *pszOutputFormat; /* only used with DescibeFeatureType */

 } wfsParamsObj;

@@ -210,7 +210,7 @@ MS_DLL_EXPORT char *msOWSTerminateOnline
 MS_DLL_EXPORT char *msOWSGetOnlineResource(mapObj *map, const char *namespaces, const char *metadata_name, cgiRequestObj *req);
 MS_DLL_EXPORT const char *msOWSGetSchemasLocation(mapObj *map);

-// Constants for OWS Service version numbers
+/* Constants for OWS Service version numbers */
 #define OWS_0_1_2   0x000102
 #define OWS_0_1_4   0x000104
 #define OWS_0_1_6   0x000106
@@ -221,18 +221,18 @@ MS_DLL_EXPORT const char *msOWSGetSchema
 #define OWS_1_0_8   0x010008
 #define OWS_1_1_0   0x010100
 #define OWS_1_1_1   0x010101
-#define OWS_VERSION_MAXLEN   20  // Buffer size for msOWSGetVersionString()
+#define OWS_VERSION_MAXLEN   20  /* Buffer size for msOWSGetVersionString() */

 MS_DLL_EXPORT int msOWSParseVersionString(const char *pszVersion);
 MS_DLL_EXPORT const char *msOWSGetVersionString(int nVersion, char *pszBuffer);


-// OWS_NOERR and OWS_WARN passed as action_if_not_found to printMetadata()
+/* OWS_NOERR and OWS_WARN passed as action_if_not_found to printMetadata() */
 #define OWS_NOERR   0
 #define OWS_WARN    1

-// OWS_WMS and OWS_WFS used for functions that differ in behavior between
-// WMS and WFS services (e.g. msOWSPrintLatLonBoundingBox())
+/* OWS_WMS and OWS_WFS used for functions that differ in behavior between */
+/* WMS and WFS services (e.g. msOWSPrintLatLonBoundingBox()) */
 #define OWS_WMS     1
 #define OWS_WFS     2

@@ -306,11 +306,11 @@ const char *msOWSGetEPSGProj(projectionO
 /*====================================================================
  *   mapgml.c
  *====================================================================*/
-#define OWS_GML2 0 // Supported GML formats
+#define OWS_GML2 0 /* Supported GML formats */
 #define OWS_GML3 1

 #ifdef USE_WMS_SVR
-// export to fix bug 851
+/* export to fix bug 851 */
 MS_DLL_EXPORT int msGMLWriteQuery(mapObj *map, char *filename, const char *namespaces);
 #endif

@@ -389,7 +389,7 @@ MS_DLL_EXPORT int msLoadMapContextURL(ma
  *   mapwcs.c
  *====================================================================*/

-int msWCSDispatch(mapObj *map, cgiRequestObj *requestobj); // only 1 public function
+int msWCSDispatch(mapObj *map, cgiRequestObj *requestobj); /* only 1 public function */

 #endif /* MAPOWS_H */

Index: mapprimitive.h
===================================================================
RCS file: /data2/cvsroot/mapserver/mapprimitive.h,v
retrieving revision 1.14
diff -u -3 -p -u -r1.14 mapprimitive.h
--- mapprimitive.h      29 Nov 2004 15:09:34 -0000      1.14
+++ mapprimitive.h      1 Feb 2005 22:16:10 -0000
@@ -79,7 +79,7 @@ typedef struct {
 #endif

   rectObj bounds;
-  int type; // MS_SHAPE_TYPE
+  int type; /* MS_SHAPE_TYPE */
   long index;
   int tileindex;
   int classindex;
@@ -108,8 +108,8 @@ typedef struct {
 typedef struct {
   int  need_geotransform;
   double rotation_angle;
-  double geotransform[6];    // Pixel/line to georef.
-  double invgeotransform[6]; // georef to pixel/line
+  double geotransform[6];    /* Pixel/line to georef. */
+  double invgeotransform[6]; /* georef to pixel/line */
 } geotransformObj;
 #endif

Index: mapproject.h
===================================================================
RCS file: /data2/cvsroot/mapserver/mapproject.h,v
retrieving revision 1.24
diff -u -3 -p -u -r1.24 mapproject.h
--- mapproject.h        16 Nov 2004 21:56:18 -0000      1.24
+++ mapproject.h        1 Feb 2005 22:16:10 -0000
@@ -70,7 +70,7 @@ typedef struct {
 #else
   void *proj;
 #endif
-  geotransformObj gt; // extra transformation to apply
+  geotransformObj gt; /* extra transformation to apply */
 #endif
 } projectionObj;

Index: mapshape.h
===================================================================
RCS file: /data2/cvsroot/mapserver/mapshape.h,v
retrieving revision 1.32
diff -u -3 -p -u -r1.32 mapshape.h
--- mapshape.h  21 Oct 2004 04:30:54 -0000      1.32
+++ mapshape.h  1 Feb 2005 22:16:10 -0000
@@ -45,7 +45,7 @@ extern "C" {
 #ifndef SWIG
 #define MS_PATH_LENGTH 1024

-// Shapefile types
+/* Shapefile types */
 #define SHP_POINT 1
 #define SHP_ARC 3
 #define SHP_POLYGON 5
@@ -97,7 +97,7 @@ typedef       struct {

     int                bUpdated;

-    int                nBufSize; // these used static vars in shape readers, moved to be thread-safe
+    int                nBufSize; /* these used static vars in shape readers, moved to be thread-safe */
     uchar   *pabyRec;
     int                nPartMax;
     int                *panParts;
@@ -142,29 +142,29 @@ typedef DBFInfo * DBFHandle;

 typedef enum {FTString, FTInteger, FTDouble, FTInvalid} DBFFieldType;

-// Shapefile object, no write access via scripts
+/* Shapefile object, no write access via scripts */
 typedef struct {
 #ifdef SWIG
 %immutable;
 #endif
-  char source[MS_PATH_LENGTH]; // full path to this file data
+  char source[MS_PATH_LENGTH]; /* full path to this file data */

 #ifndef SWIG
-  SHPHandle hSHP; // SHP/SHX file pointer
+  SHPHandle hSHP; /* SHP/SHX file pointer */
 #endif

-  int type; // shapefile type
-  int numshapes; // number of shapes
-  rectObj bounds; // shape extent
+  int type; /* shapefile type */
+  int numshapes; /* number of shapes */
+  rectObj bounds; /* shape extent */

 #ifndef SWIG
-  DBFHandle hDBF; // DBF file pointer
+  DBFHandle hDBF; /* DBF file pointer */
 #endif

   int lastshape;

   char *status;
-  rectObj statusbounds; // holds extent associated with the status vector
+  rectObj statusbounds; /* holds extent associated with the status vector */

   int isopen;
 #ifdef SWIG
@@ -172,7 +172,7 @@ typedef struct {
 #endif
 } shapefileObj;

-// layerInfo structure for tiled shapefiles
+/* layerInfo structure for tiled shapefiles */
 typedef struct {
   shapefileObj *shpfile;
   shapefileObj *tileshpfile;
@@ -181,13 +181,13 @@ typedef struct {

 #ifndef SWIG

-// shapefileObj function prototypes
+/* shapefileObj function prototypes  */
 MS_DLL_EXPORT int msSHPOpenFile(shapefileObj *shpfile, char *mode, char *filename);
 MS_DLL_EXPORT int msSHPCreateFile(shapefileObj *shpfile, char *filename, int type);
 MS_DLL_EXPORT void msSHPCloseFile(shapefileObj *shpfile);
 MS_DLL_EXPORT int msSHPWhichShapes(shapefileObj *shpfile, rectObj rect, int debug);

-// SHP/SHX function prototypes
+/* SHP/SHX function prototypes */
 MS_DLL_EXPORT SHPHandle msSHPOpen( const char * pszShapeFile, const char * pszAccess );
 MS_DLL_EXPORT SHPHandle msSHPCreate( const char * pszShapeFile, int nShapeType );
 MS_DLL_EXPORT void msSHPClose( SHPHandle hSHP );
@@ -198,9 +198,9 @@ MS_DLL_EXPORT int msSHPReadPoint(SHPHand
 MS_DLL_EXPORT int msSHPWriteShape( SHPHandle psSHP, shapeObj *shape );
 MS_DLL_EXPORT int msSHPWritePoint(SHPHandle psSHP, pointObj *point );

-// tiledShapefileObj function prototypes are in map.h
+/* tiledShapefileObj function prototypes are in map.h */

-// XBase function prototypes
+/* XBase function prototypes */
 MS_DLL_EXPORT DBFHandle msDBFOpen( const char * pszDBFFile, const char * pszAccess );
 MS_DLL_EXPORT void msDBFClose( DBFHandle hDBF );
 MS_DLL_EXPORT DBFHandle msDBFCreate( const char * pszDBFFile );
Index: mapsymbol.h
===================================================================
RCS file: /data2/cvsroot/mapserver/mapsymbol.h,v
retrieving revision 1.17
diff -u -3 -p -u -r1.17 mapsymbol.h
--- mapsymbol.h 21 Oct 2004 04:30:55 -0000      1.17
+++ mapsymbol.h 1 Feb 2005 22:16:10 -0000
@@ -40,13 +40,13 @@

 enum MS_SYMBOL_TYPE {MS_SYMBOL_SIMPLE, MS_SYMBOL_VECTOR, MS_SYMBOL_ELLIPSE, MS_SYMBOL_PIXMAP, MS_SYMBOL_TRUETYPE, MS_SYMBOL_CARTOLINE, MS_SYMBOL_HATCH};

-#define MS_MAXSYMBOLS 64            // maximum number of symbols in a symbol file
-#define MS_MAXVECTORPOINTS 100      // shade, marker and line symbol parameters
+#define MS_MAXSYMBOLS 64            /* maximum number of symbols in a symbol file */
+#define MS_MAXVECTORPOINTS 100      /* shade, marker and line symbol parameters */
 #define MS_MAXSTYLELENGTH 10

 #define MS_IMAGECACHESIZE 6

-// COLOR OBJECT
+/* COLOR OBJECT */
 typedef struct {
   int pen;
   int red;
@@ -67,20 +67,20 @@ struct imageCacheObj {
   gdImagePtr img;
   struct imageCacheObj *next;
 };
-#endif // SWIG
+#endif /* SWIG */


 typedef struct {
   char *name;
   int type;
 #ifndef SWIG
-  int inmapfile; //boolean value for writing
+  int inmapfile; /* boolean value for writing */

   /*
   ** Pointer to his map
   */
   struct map_obj *map;
-#endif // SWIG
+#endif /* SWIG */
   /*
   ** MS_SYMBOL_VECTOR and MS_SYMBOL_ELLIPSE options
   */
@@ -92,14 +92,14 @@ typedef struct {

 #ifdef SWIG
   %immutable;
-#endif // SWIG
+#endif /* SWIG */
   int numpoints;
 #ifdef SWIG
   %mutable;
-#endif // SWIG
+#endif /* SWIG */
   int filled;

-  int stylelength;                      // Number of intervals (eg. dashes) in the style
+  int stylelength;                      /* Number of intervals (eg. dashes) in the style */
   int style[MS_MAXSTYLELENGTH];

   /*
@@ -107,7 +107,7 @@ typedef struct {
   */
 #ifndef SWIG
   gdImagePtr img;
-#endif // SWIG
+#endif /* SWIG */
   char *imagepath;
   int transparent;
   int transparentcolor;
Index: maptemplate.h
===================================================================
RCS file: /data2/cvsroot/mapserver/maptemplate.h,v
retrieving revision 1.12
diff -u -3 -p -u -r1.12 maptemplate.h
--- maptemplate.h       21 Oct 2004 04:30:55 -0000      1.12
+++ maptemplate.h       1 Feb 2005 22:16:10 -0000
@@ -64,7 +64,7 @@ enum modes {BROWSE, ZOOMIN, ZOOMOUT, MAP
 */
 typedef struct
 {
-   /// should the query and/or map be saved
+   /* should the query and/or map be saved */
    int SaveMap, SaveQuery;

   cgiRequestObj *request;
@@ -73,12 +73,12 @@ typedef struct

    char *Layers[MS_MAXLAYERS];

-   /// number of layers specfied by a use
+   /* number of layers specfied by a use */
    int NumLayers;

    layerObj *ResultLayer;

-   int UseShapes; // are results of a query to be used in calculating an extent of some sort
+   int UseShapes; /* are results of a query to be used in calculating an extent of some sort */


    shapeObj SelectShape, ResultShape;
@@ -87,16 +87,16 @@ typedef struct

    pointObj MapPnt;

-   /// default for browsing
+   /* default for browsing */
    double fZoom, Zoom;

-   /// whether zooming in or out, default is pan or 0
+   /* whether zooming in or out, default is pan or 0 */
    int ZoomDirection;

-   /// can be BROWSE, QUERY, etc.
+   /* can be BROWSE, QUERY, etc. */
    int Mode;

-   /// big enough for time + pid
+   /* big enough for time + pid */
    char Id[IDSIZE];

    int CoordSource;
@@ -116,11 +116,11 @@ typedef struct
    /*
     ** variables for multiple query results processing
     */
-   int RN; /// overall result number
-   int LRN; /// result number within a layer
-   int NL; /// total number of layers with results
-   int NR; /// total number or results
-   int NLR; /// number of results in a layer
+   int RN; /* overall result number */
+   int LRN; /* result number within a layer */
+   int NL; /* total number of layers with results */
+   int NR; /* total number or results */
+   int NLR; /* number of results in a layer */
 } mapservObj;


@@ -136,7 +136,7 @@ MS_DLL_EXPORT mapservObj* msAllocMapServ
 */
 MS_DLL_EXPORT void msFreeMapServObj(mapservObj* msObj);

-// For Mapserv.c
+/* For Mapserv.c */
 MS_DLL_EXPORT int isOn(mapservObj* msObj, char *name, char *group);
 MS_DLL_EXPORT int checkWebScale(mapservObj *msObj);
 MS_DLL_EXPORT int setExtent(mapservObj *msObj);
Index: maptime.h
===================================================================
RCS file: /data2/cvsroot/mapserver/maptime.h,v
retrieving revision 1.9
diff -u -3 -p -u -r1.9 maptime.h
--- maptime.h   28 Jan 2005 06:16:54 -0000      1.9
+++ maptime.h   1 Feb 2005 22:16:10 -0000
@@ -71,7 +71,7 @@ typedef enum
     TIME_RESOLUTION_YEAR =7
 }MS_TIME_RESOLUTION;

-// function prototypes
+/* function prototypes */
 void msTimeInit(struct tm *time);
 int msDateCompare(struct tm *time1, struct tm *time2);
 int msTimeCompare(struct tm *time1, struct tm *time2);
Index: maptree.h
===================================================================
RCS file: /data2/cvsroot/mapserver/maptree.h,v
retrieving revision 1.7
diff -u -3 -p -u -r1.7 maptree.h
--- maptree.h   21 Oct 2004 04:30:56 -0000      1.7
+++ maptree.h   1 Feb 2005 22:16:10 -0000
@@ -44,10 +44,10 @@ extern "C" {
 #define MAX_SUBNODES 4

 typedef struct shape_tree_node {
-  // area covered by this node
+  /* area covered by this node */
   rectObj rect;

-  // list of shapes stored at this node.
+  /* list of shapes stored at this node. */
   int numshapes;
   int *ids;



More information about the mapserver-dev mailing list