[GRASS-SVN] r58434 - in grass/trunk/raster: r.terraflow r.viewshed
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Dec 10 08:50:33 PST 2013
Author: wenzeslaus
Date: 2013-12-10 08:50:33 -0800 (Tue, 10 Dec 2013)
New Revision: 58434
Modified:
grass/trunk/raster/r.terraflow/direction.cpp
grass/trunk/raster/r.terraflow/nodata.cpp
grass/trunk/raster/r.terraflow/nodata.h
grass/trunk/raster/r.viewshed/rbbst.cpp
grass/trunk/raster/r.viewshed/rbbst.h
grass/trunk/raster/r.viewshed/statusstructure.cpp
grass/trunk/raster/r.viewshed/statusstructure.h
Log:
r.terraflow and r.viewshed: using longer names instead of function overloading to fix compilation error with C++11 (reference to is_empty/is_void is ambiguous)
Modified: grass/trunk/raster/r.terraflow/direction.cpp
===================================================================
--- grass/trunk/raster/r.terraflow/direction.cpp 2013-12-10 15:39:03 UTC (rev 58433)
+++ grass/trunk/raster/r.terraflow/direction.cpp 2013-12-10 16:50:33 UTC (rev 58434)
@@ -53,11 +53,11 @@
if(!is_nodata(elevwin.get())) {
dir = 0;
- if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1;
- if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16;
+ if (elevwin.get(5) < elevwin.get() && !elevation_type_is_void(elevwin.get(5))) dir |= 1;
+ if (elevwin.get(3) < elevwin.get() && !elevation_type_is_void(elevwin.get(3))) dir |= 16;
for(int i=0; i<3; i++) {
- if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<<i;
- if(elevwin.get(i+6) < elevwin.get() && !is_void(elevwin.get(6+i))) dir |= 8>>i;
+ if(elevwin.get(i) < elevwin.get() && !elevation_type_is_void(elevwin.get(i))) dir |= 32<<i;
+ if(elevwin.get(i+6) < elevwin.get() && !elevation_type_is_void(elevwin.get(6+i))) dir |= 8>>i;
}
}
Modified: grass/trunk/raster/r.terraflow/nodata.cpp
===================================================================
--- grass/trunk/raster/r.terraflow/nodata.cpp 2013-12-10 15:39:03 UTC (rev 58433)
+++ grass/trunk/raster/r.terraflow/nodata.cpp 2013-12-10 16:50:33 UTC (rev 58434)
@@ -73,7 +73,7 @@
int
-is_void(elevation_type el) {
+elevation_type_is_void(elevation_type el) {
return (el == nodataType::ELEVATION_NODATA);
}
Modified: grass/trunk/raster/r.terraflow/nodata.h
===================================================================
--- grass/trunk/raster/r.terraflow/nodata.h 2013-12-10 15:39:03 UTC (rev 58433)
+++ grass/trunk/raster/r.terraflow/nodata.h 2013-12-10 16:50:33 UTC (rev 58434)
@@ -37,7 +37,7 @@
int is_nodata(elevation_type el);
int is_nodata(int x);
int is_nodata(float x);
-int is_void(elevation_type el);
+int elevation_type_is_void(elevation_type el);
class nodataType : public ijBaseType {
Modified: grass/trunk/raster/r.viewshed/rbbst.cpp
===================================================================
--- grass/trunk/raster/r.viewshed/rbbst.cpp 2013-12-10 15:39:03 UTC (rev 58433)
+++ grass/trunk/raster/r.viewshed/rbbst.cpp 2013-12-10 16:50:33 UTC (rev 58434)
@@ -104,7 +104,7 @@
}
/*LT: not sure if this is correct */
-int is_empty(RBTree * t)
+int rbtree_is_empty(RBTree * t)
{
assert(t);
return (t->root == NIL);
Modified: grass/trunk/raster/r.viewshed/rbbst.h
===================================================================
--- grass/trunk/raster/r.viewshed/rbbst.h 2013-12-10 15:39:03 UTC (rev 58433)
+++ grass/trunk/raster/r.viewshed/rbbst.h 2013-12-10 16:50:33 UTC (rev 58434)
@@ -96,7 +96,7 @@
double find_max_gradient_within_key(RBTree * rbt, double key, double angle, double gradient);
/*LT: not sure if this is correct */
-int is_empty(RBTree * t);
+int rbtree_is_empty(RBTree * t);
Modified: grass/trunk/raster/r.viewshed/statusstructure.cpp
===================================================================
--- grass/trunk/raster/r.viewshed/statusstructure.cpp 2013-12-10 15:39:03 UTC (rev 58433)
+++ grass/trunk/raster/r.viewshed/statusstructure.cpp 2013-12-10 16:50:33 UTC (rev 58434)
@@ -292,7 +292,7 @@
assert(sl);
/*note: if there is nothing in the status struccture, it means this
cell is VISIBLE */
- if (is_empty(sl))
+ if (status_list_is_empty(sl))
return SMALLEST_GRADIENT;
/*it is also possible that the status structure is not empty, but
there are no events with key < dist ---in this case it returns
@@ -301,9 +301,9 @@
}
/*returns true if it is empty */
-int is_empty(StatusList * sl)
+int status_list_is_empty(StatusList * sl)
{
assert(sl);
- return (is_empty(sl->rbt) ||
+ return (rbtree_is_empty(sl->rbt) ||
sl->rbt->root->value.maxGradient == SMALLEST_GRADIENT);
}
Modified: grass/trunk/raster/r.viewshed/statusstructure.h
===================================================================
--- grass/trunk/raster/r.viewshed/statusstructure.h 2013-12-10 15:39:03 UTC (rev 58433)
+++ grass/trunk/raster/r.viewshed/statusstructure.h 2013-12-10 16:50:33 UTC (rev 58434)
@@ -89,7 +89,7 @@
void delete_status_structure(StatusList * sl);
/*returns true is it is empty */
-int is_empty(StatusList * sl);
+int status_list_is_empty(StatusList * sl);
/*delete the statusNode with the given key */
More information about the grass-commit
mailing list