[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Problem in CVS with "inline" in "src/path.cpp"



Hello Jens,

Found a little show stopper in the CVS.

I had problmes compiling under Linux with gcc caused by a little
(possibly) typo in "src/path.cpp". The method "BasicPath::GetStep()" was
defined as "inline". But this definition was in the class implementation
and by all what I know from C++ this is not possible.

If it should (and yes I too think it should) be inlined you have to
define it in the header file "src/path.h".

I have attached a patch that make things work for me.

Bye, Sascha.



-- 
Freundliche Gruesse

Sascha Flohr

Yinc Software Entwicklung - Sascha Flohr & Arnd Otto GbR
Web: http://www.yinc.de
Index: src/cf/path.cpp
===================================================================
RCS file: /home/cvspsrv/cvsroot/games/crimson/src/cf/path.cpp,v
retrieving revision 1.6
diff -u -r1.6 path.cpp
--- src/cf/path.cpp	2 Nov 2004 17:08:16 -0000	1.6
+++ src/cf/path.cpp	9 Dec 2004 22:28:45 -0000
@@ -86,18 +86,6 @@
   }
 }
 
-////////////////////////////////////////////////////////////////////////
-// NAME       : Path::GetStep
-// DESCRIPTION: Get the path buffer content at a hex position. Usually,
-//              it will contain the direction of the next step on the
-//              path.
-// PARAMETERS : current - hex position to look at
-// RETURNS    : content of path buffer at the position of 'current'
-////////////////////////////////////////////////////////////////////////
-
-inline signed char BasicPath::GetStep( const Point &current ) const {
-  return path[map->Hex2Index(current)];
-}
 
 ////////////////////////////////////////////////////////////////////////
 // NAME       : BasicPath::Find
Index: src/cf/path.h
===================================================================
RCS file: /home/cvspsrv/cvsroot/games/crimson/src/cf/path.h,v
retrieving revision 1.4
diff -u -r1.4 path.h
--- src/cf/path.h	30 Oct 2004 19:32:31 -0000	1.4
+++ src/cf/path.h	9 Dec 2004 22:28:45 -0000
@@ -69,6 +69,23 @@
   bool buf_private;     // delete buffer when path is destroyed
 };
 
+////////////////////////////////////////////////////////////////////////
+// NAME       : Path::GetStep
+// DESCRIPTION: Get the path buffer content at a hex position. Usually,
+//              it will contain the direction of the next step on the
+//              path.
+// PARAMETERS : current - hex position to look at
+// RETURNS    : content of path buffer at the position of 'current'
+//
+// REMARKS    : must be defined in the header file to be inlined
+////////////////////////////////////////////////////////////////////////
+
+inline signed char BasicPath::GetStep( const Point &current ) const {
+  return path[map->Hex2Index(current)];
+}
+
+
+
 
 class Path : public BasicPath {
 public: