Revision: 52530
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52530
Author:   jwilkins
Date:     2012-11-24 06:09:43 +0000 (Sat, 24 Nov 2012)
Log Message:
-----------
Fixed error that prevents eltopo3d from compiling on 32-bit MSVC 2008.

Changed 'to_int' into a template so it can work with all types instead of just 
the two it was originally written for.

Modified Paths:
--------------
    trunk/blender/extern/eltopo/eltopo3d/nondestructivetrimesh.h

Modified: trunk/blender/extern/eltopo/eltopo3d/nondestructivetrimesh.h
===================================================================
--- trunk/blender/extern/eltopo/eltopo3d/nondestructivetrimesh.h        
2012-11-24 05:38:20 UTC (rev 52529)
+++ trunk/blender/extern/eltopo/eltopo3d/nondestructivetrimesh.h        
2012-11-24 06:09:43 UTC (rev 52530)
@@ -26,15 +26,16 @@
 //  Non-member function declarations
 // ---------------------------------------------------------
 
-/// Safely convert a size_t to an int
+/// Safely convert a value to an int
 ///
-int to_int( size_t a );
+template <typename T>
+inline int to_int(T a)
+{
+       assert(a < INT_MAX);
+       return static_cast<int>(a);
+}
 
-/// Safely convert a ssize_t to an int
-///
-int to_int( ssize_t a );
 
-
 // ---------------------------------------------------------
 //  Class definitions
 // ---------------------------------------------------------
@@ -239,35 +240,7 @@
 
 
 // ---------------------------------------------------------
-//  Inline functions
-// ---------------------------------------------------------
-
-// ---------------------------------------------------------
 ///
-/// Safely convert a size_t to an int
-///
-// ---------------------------------------------------------
-
-inline int to_int( size_t a )
-{
-    assert( a < INT_MAX );
-    return static_cast<int>(a);
-}
-
-// ---------------------------------------------------------
-///
-/// Safely convert a ssize_t to an int
-///
-// ---------------------------------------------------------
-
-inline int to_int( ssize_t a )
-{
-    assert( a < INT_MAX );
-    return static_cast<int>(a);
-}
-
-// ---------------------------------------------------------
-///
 /// Return a reference to the set of all triangles, including triangles marked 
as deleted.
 ///
 // ---------------------------------------------------------

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to