[MOAB-dev] commit/MOAB: danwu: Initialize some variables in NCHelperHOMME.cpp, found by Rajeev using cppcheck.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Sep 19 12:10:22 CDT 2013
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/08e5e52074a2/
Changeset: 08e5e52074a2
Branch: master
User: danwu
Date: 2013-09-19 19:09:19
Summary: Initialize some variables in NCHelperHOMME.cpp, found by Rajeev using cppcheck.
Affected #: 1 file
diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index 4f2ac51..f750e78 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -232,7 +232,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
conn_fname = "HommeMapping.nc";
}
- int success;
+ int success = 0;
int rank = 0;
int procs = 1;
@@ -265,9 +265,11 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
ERRORR(rval, "Failed to get dimensions for connectivity.");
// Read connectivity into temporary variable
- int num_fine_quads, num_coarse_quads, start_idx;
+ int num_fine_quads = 0;
+ int num_coarse_quads = 0;
+ int start_idx = 0;
std::vector<std::string>::iterator vit;
- int idx;
+ int idx = 0;
if ((vit = std::find(conn_names.begin(), conn_names.end(), "ncells")) != conn_names.end())
idx = vit - conn_names.begin();
else if ((vit = std::find(conn_names.begin(), conn_names.end(), "ncenters")) != conn_names.end())
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