]> granicus.if.org Git - postgis/commitdiff
Remove the few C++-style comments that have crept into the codebase, and add a note...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 22 Dec 2008 12:15:12 +0000 (12:15 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 22 Dec 2008 12:15:12 +0000 (12:15 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3462 b70326c6-7e19-0410-871a-916f4a2858ee

STYLE
liblwgeom/lwcurve.c
liblwgeom/lwutil.c
liblwgeom/wktparse.lex
lwgeom/lwgeom_chip.c
lwgeom/test.c

diff --git a/STYLE b/STYLE
index e9f8429cb4705503bf3f5eb454f24fc5379c43b2..294cf2693b8f76549e5c222a717298ed9182ac45 100644 (file)
--- a/STYLE
+++ b/STYLE
@@ -37,6 +37,8 @@ logic, so the logic commits are easier to read.
 Macros should be ALL_UPPERCASE. 
 Enumerations should be ALL_UPPERCASE.
 
+Comments should be written in C style (/* .... */) and not C++ style (//)
+
 
 :Naming:
 
index ef7830619cd8656befe3d419105567233dacc647..38f9f7b8b70c60fd7620d6494917f124104d4ce9 100644 (file)
@@ -258,9 +258,9 @@ lwcircle_compute_box3d(POINT4D *p1, POINT4D *p2, POINT4D *p3)
 {
         double x1, x2, y1, y2, z1, z2;
         double angle, radius, sweep;
-       // angles from center
+       /* angles from center */
         double a1, a2, a3;
-       // angles from center once a1 is rotated to zero
+       /* angles from center once a1 is rotated to zero */
        double r2, r3;
         double xe = 0.0, ye = 0.0;
         POINT4D *center;
@@ -289,7 +289,7 @@ lwcircle_compute_box3d(POINT4D *p1, POINT4D *p2, POINT4D *p3)
         a2 = atan2(p2->y - center->y, p2->x - center->x);
         a3 = atan2(p3->y - center->y, p3->x - center->x);
 
-       // Rotate a2 and a3 such that a1 = 0
+       /* Rotate a2 and a3 such that a1 = 0 */
        r2 = a2 - a1;
        r3 = a3 - a1;
 
@@ -308,32 +308,32 @@ lwcircle_compute_box3d(POINT4D *p1, POINT4D *p2, POINT4D *p3)
          * calculate the sweep using a3 as the middle point.
          */
 
-        // clockwise 1
+        /* clockwise 1 */
         if(FP_LT(r2, 0) && (FP_GT(r3, 0) || FP_LT(r3, r2)))
         {
             sweep = (FP_GT(r3, 0)) ? (r3 - 2 * M_PI) : r3;
         }
-        // clockwise 2
+        /* clockwise 2 */
         else if(FP_GT(r2, 0) && FP_GT(r3, 0) && FP_LT(r3, r2))
         {
             sweep = (FP_GT(r3, 0)) ? (r3 - 2 * M_PI) : r3;
         }
-        // counter-clockwise 4
+        /* counter-clockwise 4 */
         else if(FP_GT(r2, 0) && (FP_LT(r3, 0) || FP_GT(r3, r2)))
         {
             sweep = (FP_LT(r3, 0)) ? (r3 + 2 * M_PI) : r3;
         }
-        // counter-clockwisk 5
+        /* counter-clockwise 5 */
         else if(FP_LT(r2, 0) && FP_LT(r3, 0) && FP_GT(r3, r2))
         {
             sweep = (FP_LT(r3, 0)) ? (r3 + 2 * M_PI) : r3;
         }
-        // clockwise invalid 3
+        /* clockwise invalid 3 */
         else if(FP_GT(r2, 0) && (FP_GT(r3, r2) || FP_LT(r3, 0)))
         {
             sweep = (FP_GT(r2, 0)) ? (r2 - 2 * M_PI) : r2;
         }
-        // clockwise invalid 6
+        /* clockwise invalid 6 */
         else
         {
             sweep = (FP_LT(r2, 0)) ? (r2 + 2 * M_PI) : r2;
@@ -345,44 +345,44 @@ lwcircle_compute_box3d(POINT4D *p1, POINT4D *p2, POINT4D *p3)
         for(i=0; i < 6; i++)
         {
                 switch(i) {
-               // right extent
+               /* right extent */
                 case 0:
                         angle = 0.0;
                         xe = center->x + radius;
                         ye = center->y;
                         break;
-               // top extent
+               /* top extent */
                 case 1:
                         angle = M_PI_2;
                         xe = center->x;
                         ye = center->y + radius;
                         break;
-               // left extent
+               /* left extent */
                 case 2:
                         angle = M_PI;
                         xe = center->x - radius;
                         ye = center->y;
                         break;
-               // bottom extent
+               /* bottom extent */
                 case 3:
                         angle = -1 * M_PI_2;
                         xe = center->x;
                         ye = center->y - radius;
                         break;
-               // first point
+               /* first point */
                 case 4:
                         angle = a1;
                         xe = p1->x;
                         ye = p1->y;
                         break;
-               // last point
+               /* last point */
                 case 5:
                         angle = a3;
                         xe = p3->x;
                         ye = p3->y;
                         break;
                 }
-               // determine if the extents are outside the arc
+               /* determine if the extents are outside the arc */
                 if(i < 4) 
                 {
                    if(FP_GT(sweep, 0.0))
index d0c01570536e7ac133bbb8a5942ccad0bccaf47e..15923f84767b2d6cc211a5d9fb98183918647ab5 100644 (file)
@@ -209,9 +209,9 @@ void lwgeom_install_default_allocators(void)
 const char *
 lwgeom_typename(int type)
 {
-       // something went wrong somewhere
+       /* something went wrong somewhere */
        if ( type < 0 || type > 15 ) {
-               // assert(0);
+               /* assert(0); */
                return "Invalid type";
        }
        return lwgeomTypeName[type];
index 6db61442a81a3d8aebe8445e291044a382b54442..1123e1609e1c1c0b0640521fa9def7e7685b657d 100644 (file)
@@ -10,7 +10,7 @@
 %{
 #include "wktparse.tab.h"
 #include <unistd.h>
-#include <stdlib.h> // need stdlib for atof() definition 
+#include <stdlib.h> /* need stdlib for atof() definition */
 
 void init_parser(const char *src);
 void close_parser(void);
index 22c29c6dad4bf3520347cb7b3b39e6b77f880610..86dab228a0686c03e30655b307be543ce3b3afe5 100644 (file)
@@ -884,7 +884,7 @@ pgchip_construct(BOX3D *bvol, int SRID, int width, int height,
        chip->datatype=datatype;
        chip->height=height;
        chip->width=width;
-       chip->compression=0; // no compression
+       chip->compression=0; /* no compression */
        if ( ! initvalue ) {
                memset(&(chip->data), '\0', datasize);
        } else {
index 5bd8b905cdd1deff66246312b8376a4563b4bfad..12f800645c4ab9ccae9088c5e7a9d681c61cc4dd 100644 (file)
@@ -5,10 +5,10 @@ int main()
 {
        LWGEOM point;
 
-       // Construct a point2d
+       /* Construct a point2d */
        point = make_lwpoint2d(-1, 10, 20);
 
-       // Print WKT end HEXWKB
+       /* Print WKT end HEXWKB */
        printf("EWKT: %s\n", lwgeom_to_ewkt(point));
        printf("HEXWKB: %s\n", lwgeom_to_hexwkb(point,-1));