[MOAB-dev] commit/MOAB: danwu: Removed compiler warnings about "unused variable" or "variable set but not used" for an optimized build.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Jun 16 16:30:31 CDT 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/63c9d750c543/
Changeset: 63c9d750c543
Branch: master
User: danwu
Date: 2014-06-16 23:30:17
Summary: Removed compiler warnings about "unused variable" or "variable set but not used" for an optimized build.
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index c4db384..d563293 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -96,6 +96,9 @@ ReadCGM::ReadCGM(Interface *impl)
rval = mdbImpl->tag_get_handle("GEOMETRY_RESABS", 1, MB_TYPE_DOUBLE,
geometry_resabs_tag, MB_TAG_SPARSE|MB_TAG_CREAT);
assert(!rval);
+#ifdef NDEBUG
+ if (!rval) {}; // Line to avoid compiler warning about variable set but not used
+#endif
}
ReadCGM::~ReadCGM()
diff --git a/tools/mbcoupler/addfield.cpp b/tools/mbcoupler/addfield.cpp
index 8d3a2ac..e1547c9 100644
--- a/tools/mbcoupler/addfield.cpp
+++ b/tools/mbcoupler/addfield.cpp
@@ -35,7 +35,10 @@ void putElementField(Interface *mbi, const char *tagname, double factor){
Tag fieldTag;
ErrorCode rval = mbi->tag_get_handle(tagname, 1, MB_TYPE_DOUBLE, fieldTag, MB_TAG_DENSE|MB_TAG_CREAT, &defVal);
assert(MB_SUCCESS == rval);
-
+#ifdef NDEBUG
+ if (MB_SUCCESS == rval) {}; // Line to avoid compiler warning about unused variable
+#endif
+
int numElems = elems.size();
for(int i=0; i<numElems; i++){
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