[GRASS-SVN] r54330 - in grass/trunk: include/iostream lib/iostream raster/r.viewshed

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 18 05:16:02 PST 2012


Author: glynn
Date: 2012-12-18 05:16:00 -0800 (Tue, 18 Dec 2012)
New Revision: 54330

Modified:
   grass/trunk/include/iostream/ami_stream.h
   grass/trunk/include/iostream/embuffer.h
   grass/trunk/include/iostream/empq_impl.h
   grass/trunk/lib/iostream/ami_stream.cpp
   grass/trunk/raster/r.viewshed/distribute.cpp
Log:
Fix some C++ portability warnings


Modified: grass/trunk/include/iostream/ami_stream.h
===================================================================
--- grass/trunk/include/iostream/ami_stream.h	2012-12-18 08:34:17 UTC (rev 54329)
+++ grass/trunk/include/iostream/ami_stream.h	2012-12-18 13:16:00 UTC (rev 54330)
@@ -94,7 +94,7 @@
   AMI_ERROR_NO_MAIN_MEMORY_OPERATION,
 };
 
-extern char *ami_str_error[];
+extern const char *ami_str_error[];
 
 //
 // AMI stream types passed to constructors

Modified: grass/trunk/include/iostream/embuffer.h
===================================================================
--- grass/trunk/include/iostream/embuffer.h	2012-12-18 08:34:17 UTC (rev 54329)
+++ grass/trunk/include/iostream/embuffer.h	2012-12-18 13:16:00 UTC (rev 54330)
@@ -988,7 +988,7 @@
 #endif
   }
 
-  T* in_objects[arity]; //pointers to current leading elements of streams
+  std::vector<T*> in_objects(arity); //pointers to current leading elements of streams
   AMI_err ami_err;
   
  

Modified: grass/trunk/include/iostream/empq_impl.h
===================================================================
--- grass/trunk/include/iostream/empq_impl.h	2012-12-18 08:34:17 UTC (rev 54329)
+++ grass/trunk/include/iostream/empq_impl.h	2012-12-18 13:16:00 UTC (rev 54330)
@@ -1250,7 +1250,7 @@
   /* Pointers to current leading elements of streams */
   unsigned int arity = buf->get_nbstreams();
   AMI_STREAM<T>** instreams = buf->get_streams();
-  T* in_objects[arity];
+  std::vector<T*> in_objects(arity);
   AMI_err ami_err;
   unsigned int i, j;
 

Modified: grass/trunk/lib/iostream/ami_stream.cpp
===================================================================
--- grass/trunk/lib/iostream/ami_stream.cpp	2012-12-18 08:34:17 UTC (rev 54329)
+++ grass/trunk/lib/iostream/ami_stream.cpp	2012-12-18 13:16:00 UTC (rev 54330)
@@ -47,7 +47,7 @@
 #include <grass/iostream/ami_stream.h>
 
 
-char *ami_str_error[] = {
+const char *ami_str_error[] = {
   "AMI_ERROR_NO_ERROR",
   "AMI_ERROR_IO_ERROR",
   "AMI_ERROR_END_OF_STREAM",

Modified: grass/trunk/raster/r.viewshed/distribute.cpp
===================================================================
--- grass/trunk/raster/r.viewshed/distribute.cpp	2012-12-18 08:34:17 UTC (rev 54329)
+++ grass/trunk/raster/r.viewshed/distribute.cpp	2012-12-18 13:16:00 UTC (rev 54330)
@@ -189,7 +189,7 @@
 
     G_debug(2, "***  DISTRIBUTE sector [%.4f, %.4f]  ***",
 			    start_angle, end_angle);
-    G_debug(2, "initial_gradient: %lf", SMALLEST_GRADIENT);
+    G_debug(2, "initial_gradient: %f", SMALLEST_GRADIENT);
     G_debug(2, "eventlist: %s", eventList->sprint());
     if (enterBndEvents)
 	G_debug(2, "BndEvents: %s", enterBndEvents->sprint());



More information about the grass-commit mailing list