diff -u old/coldet/src/box.h new/coldet/src/box.h
--- old/coldet/src/box.h 2001-02-23 18:08:22.000000000
+0000
+++ new/coldet/src/box.h 2002-10-31 00:22:08.000000000
+0000
@@ -147,8 +147,8 @@
{
public:
BoxTreeInnerNode(const Vector3D& pos, const
Vector3D& size, int logdepth)
- : BoxTreeNode(pos,size), m_First(NULL),
m_Second(NULL),
- m_logdepth(logdepth), m_OwnFirst(true),
m_OwnSecond(true) {}
+ : BoxTreeNode(pos,size), m_First(NULL),
m_OwnFirst(true),
+ m_Second(NULL), m_OwnSecond(true),
m_logdepth(logdepth) {}
~BoxTreeInnerNode()
{
if (m_OwnFirst) delete m_First;
@@ -198,7 +198,7 @@
BoxedTriangle(const Vector3D& _1, const Vector3D&
_2, const Vector3D& _3);
virtual bool isLeaf() const { return true; }
int getSonsNumber() { return 0; }
- BoxTreeNode* getSon(int which) { return NULL; }
+ BoxTreeNode* getSon(int) { return NULL; }
int getTrianglesNumber() { return 1; }
BoxedTriangle* getTriangle(int which)
{
diff -u old/coldet/src/box_bld.cpp
new/coldet/src/box_bld.cpp
--- old/coldet/src/box_bld.cpp 2001-02-23
18:08:22.000000000 +0000
+++ new/coldet/src/box_bld.cpp 2002-10-31
00:31:34.000000000 +0000
@@ -131,7 +131,7 @@
#ifdef _DEBUG
int fnum=0;
#endif
- for(unsigned i=0;i<bnum;i++)
+ for(int i=0;i<bnum;i++)
{
BoxedTriangle* bt=m_Boxes[i];
if (bt->center[longest]<center[longest])
diff -u old/coldet/src/coldetimpl.h
new/coldet/src/coldetimpl.h
--- old/coldet/src/coldetimpl.h 2002-10-26
09:53:10.000000000 +0000
+++ new/coldet/src/coldetimpl.h 2002-11-09
15:20:12.000000000 +0000
@@ -73,7 +73,7 @@
int getTriangleIndex(BoxedTriangle* bt)
{
- return int(bt-&(*m_Triangles.begin()));
+ return int(bt-&m_Triangles.front());
}
/** Stores all the actual triangles. Other objects
will use
Only in old/coldet/src: cvs
diff -u old/coldet/src/makefile.g++
new/coldet/src/makefile.g++
--- old/coldet/src/makefile.g++ 2000-11-18
21:13:34.000000000 +0000
+++ new/coldet/src/makefile.g++ 2003-08-31
22:44:54.000000000 +0000
@@ -1,8 +1,8 @@
PROJECT=coldet
LIB=libcoldet.a
CC=g++
-OPT=-O2
-CFLAGS=-c $(OPT) -DGCC
+OPT=-O2 -Wall -W -ansi -pedantic
+CFLAGS=-c $(OPT)
OBJS= \
coldet.o \
coldet_bld.o \
@@ -33,7 +33,7 @@
$(CC) $(CFLAGS) box_bld.cpp
tritri.o: tritri.c
- $(CC) $(CFLAGS) tritri.c
+ gcc $(CFLAGS) tritri.c
mytritri.o: mytritri.cpp
$(CC) $(CFLAGS) mytritri.cpp
diff -u old/coldet/src/mytritri.h new/coldet/src/mytritri.h
--- old/coldet/src/mytritri.h 2000-11-18
21:13:48.000000000 +0000
+++ new/coldet/src/mytritri.h 2002-10-30
22:13:08.000000000 +0000
@@ -93,4 +93,4 @@
-#endif // H_MYTRITRI
\ No newline at end of file
+#endif // H_MYTRITRI
diff -u old/coldet/src/sysdep.cpp new/coldet/src/sysdep.cpp
--- old/coldet/src/sysdep.cpp 2000-11-18
21:13:36.000000000 +0000
+++ new/coldet/src/sysdep.cpp 2003-08-31
22:33:08.000000000 +0000
@@ -23,7 +23,8 @@
*/
#include "sysdep.h"
-#ifdef GCC
+#ifdef __GNUC__
+#ifndef __WIN32__
#include <sys/time.h>
@@ -39,3 +40,4 @@
}
#endif
+#endif
diff -u old/coldet/src/sysdep.h new/coldet/src/sysdep.h
--- old/coldet/src/sysdep.h 2000-12-07
17:06:42.000000000 +0000
+++ new/coldet/src/sysdep.h 2002-10-31
00:00:12.000000000 +0000
@@ -28,17 +28,19 @@
///////////////////////////////////////////////////
// g++ compiler on most systems
///////////////////////////////////////////////////
-#ifdef GCC
+#ifdef __GNUC__
typedef unsigned long DWORD;
+#ifndef __WIN32__
DWORD GetTickCount();
+#endif
#define __CD__BEGIN
#define __CD__END
///////////////////////////////////////////////////
// Windows compilers
///////////////////////////////////////////////////
-#elif defined(WIN32)
+#elif defined(__WIN32__)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -65,7 +67,7 @@
#else
-#error No system specified (WIN32 GCC macintosh)
+#error No system specified (__WIN32__ __GNUC__ macintosh)
#endif
diff -u old/coldet/src/tritri.c new/coldet/src/tritri.c
--- old/coldet/src/tritri.c 2001-02-23
18:08:22.000000000 +0000
+++ new/coldet/src/tritri.c 2003-08-31
22:35:56.000000000 +0000
@@ -152,11 +152,15 @@
short i0,i1;
/* first project onto an axis-aligned plane, that
maximizes the area */
/* of the triangles, compute indices: i0,i1. */
+#ifndef __GNUC__
#pragma warning( disable : 4244 )
+#endif
A[0]=fabs(N[0]);
A[1]=fabs(N[1]);
A[2]=fabs(N[2]);
+#ifndef __GNUC__
#pragma warning( default : 4244 )
+#endif
if(A[0]>A[1])
{
if(A[0]>A[2])
@@ -263,12 +267,16 @@
CROSS(D,N1,N2);
/* compute and index to the largest component of D */
+#ifndef __GNUC__
#pragma warning( disable : 4244 )
+#endif
max=fabs(D[0]);
index=0;
b=fabs(D[1]);
c=fabs(D[2]);
+#ifndef __GNUC__
#pragma warning( default : 4244 )
+#endif
if(b>max) max=b,index=1;
if(c>max) max=c,index=2;