Commit 531187a0 authored by Mark Cave-Ayland's avatar Mark Cave-Ayland

Remove the few C++-style comments that have crept into the codebase, and add a...

Remove the few C++-style comments that have crept into the codebase, and add a note to the STYLE document stating that C-style comments should be used.


git-svn-id: http://svn.osgeo.org/postgis/trunk@3462 b70326c6-7e19-0410-871a-916f4a2858ee
parent 92badad0
......@@ -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:
......
......@@ -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))
......
......@@ -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];
......
......@@ -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);
......
......@@ -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 {
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment