[MOAB-dev] commit/MOAB: danwu: Fixed some -Wunused-variable warnings for NC writer (in an optimized build with NDEBUG defined).

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon May 19 17:21:55 CDT 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/e3ba85206688/
Changeset:   e3ba85206688
Branch:      master
User:        danwu
Date:        2014-05-20 00:21:43
Summary:     Fixed some -Wunused-variable warnings for NC writer (in an optimized build with NDEBUG defined).

Affected #:  4 files

diff --git a/src/io/NCWriteGCRM.cpp b/src/io/NCWriteGCRM.cpp
index 6d245b6..1f9bb97 100644
--- a/src/io/NCWriteGCRM.cpp
+++ b/src/io/NCWriteGCRM.cpp
@@ -71,7 +71,9 @@ ErrorCode NCWriteGCRM::collect_mesh_info()
     int rank = myPcomm->proc_config().proc_rank();
     int procs = myPcomm->proc_config().proc_size();
     if (procs > 1) {
+#ifndef NDEBUG
       unsigned int num_local_verts = localVertsOwned.size();
+#endif
       rval = myPcomm->filter_pstatus(localVertsOwned, PSTATUS_NOT_OWNED, PSTATUS_NOT);
       ERRORR(rval, "Trouble getting owned vertices in set.");
 
@@ -130,7 +132,9 @@ ErrorCode NCWriteGCRM::collect_variable_data(std::vector<std::string>& var_names
       ERRORR(MB_FAILURE, "Can't find one variable.");
 
     WriteNC::VarData& currentVarData = vit->second;
+#ifndef NDEBUG
     std::vector<int>& varDims = currentVarData.varDims;
+#endif
 
     // Skip edge variables, if there are no edges
     if (localEdgesOwned.empty() && currentVarData.entLoc == WriteNC::ENTLOCEDGE)

diff --git a/src/io/NCWriteHOMME.cpp b/src/io/NCWriteHOMME.cpp
index 7adb909..abfe4ff 100644
--- a/src/io/NCWriteHOMME.cpp
+++ b/src/io/NCWriteHOMME.cpp
@@ -59,7 +59,9 @@ ErrorCode NCWriteHOMME::collect_mesh_info()
     int rank = myPcomm->proc_config().proc_rank();
     int procs = myPcomm->proc_config().proc_size();
     if (procs > 1) {
+#ifndef NDEBUG
       unsigned int num_local_verts = localVertsOwned.size();
+#endif
       rval = myPcomm->filter_pstatus(localVertsOwned, PSTATUS_NOT_OWNED, PSTATUS_NOT);
       ERRORR(rval, "Trouble getting owned vertices in set.");
 
@@ -94,7 +96,9 @@ ErrorCode NCWriteHOMME::collect_variable_data(std::vector<std::string>& var_name
       ERRORR(MB_FAILURE, "Can't find one variable.");
 
     WriteNC::VarData& currentVarData = vit->second;
+#ifndef NDEBUG
     std::vector<int>& varDims = currentVarData.varDims;
+#endif
 
     // Skip set variables, which were already processed in NCWriteHelper::collect_variable_data()
     if (WriteNC::ENTLOCSET == currentVarData.entLoc)

diff --git a/src/io/NCWriteHelper.cpp b/src/io/NCWriteHelper.cpp
index 028bce4..ee6e7aa 100644
--- a/src/io/NCWriteHelper.cpp
+++ b/src/io/NCWriteHelper.cpp
@@ -653,7 +653,9 @@ ErrorCode ScdNCWriteHelper::collect_variable_data(std::vector<std::string>& var_
       ERRORR(MB_FAILURE, "Can't find one variable.");
 
     WriteNC::VarData& currentVarData = vit->second;
+#ifndef NDEBUG
     std::vector<int>& varDims = currentVarData.varDims;
+#endif
 
     // Skip set variables, which were already processed in NCWriteHelper::collect_variable_data()
     if (WriteNC::ENTLOCSET == currentVarData.entLoc)

diff --git a/src/io/NCWriteMPAS.cpp b/src/io/NCWriteMPAS.cpp
index 6a40dad..0ece324 100644
--- a/src/io/NCWriteMPAS.cpp
+++ b/src/io/NCWriteMPAS.cpp
@@ -71,7 +71,9 @@ ErrorCode NCWriteMPAS::collect_mesh_info()
     int rank = myPcomm->proc_config().proc_rank();
     int procs = myPcomm->proc_config().proc_size();
     if (procs > 1) {
+#ifndef NDEBUG
       unsigned int num_local_verts = localVertsOwned.size();
+#endif
       rval = myPcomm->filter_pstatus(localVertsOwned, PSTATUS_NOT_OWNED, PSTATUS_NOT);
       ERRORR(rval, "Trouble getting owned vertices in set.");

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list