[cig-commits] [commit] baagaard/update-autoconf: Trivial code cleanup. (ee0bcfa)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Aug 19 09:23:06 PDT 2014
Repository : https://github.com/geodynamics/spatialdata
On branch : baagaard/update-autoconf
Link : https://github.com/geodynamics/spatialdata/compare/0000000000000000000000000000000000000000...473ea3d9dd7315efc81bd16966e607cfa86cf5cf
>---------------------------------------------------------------
commit ee0bcfafdbf747e41500ad6686eea0d928281c0b
Author: Brad Aagaard <baagaard at usgs.gov>
Date: Tue Aug 19 08:35:39 2014 -0700
Trivial code cleanup.
>---------------------------------------------------------------
ee0bcfafdbf747e41500ad6686eea0d928281c0b
libsrc/spatialdb/SimpleDB.cc | 6 +++---
libsrc/spatialdb/SimpleIOAscii.cc | 26 ++++++++++++--------------
2 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/libsrc/spatialdb/SimpleDB.cc b/libsrc/spatialdb/SimpleDB.cc
index f975cd3..d7ba627 100644
--- a/libsrc/spatialdb/SimpleDB.cc
+++ b/libsrc/spatialdb/SimpleDB.cc
@@ -67,16 +67,16 @@ spatialdata::spatialdb::SimpleDB::~SimpleDB(void)
void
spatialdata::spatialdb::SimpleDB::open(void)
{ // open
- assert(0 != _iohandler);
+ assert(_iohandler);
// Read data
- if (0 == _data) {
+ if (!_data) {
_data = new SimpleDBData;
_iohandler->read(_data, &_cs);
} // if
// Create query object
- if (0 == _query)
+ if (!_query)
_query = new SimpleDBQuery(*this);
} // open
diff --git a/libsrc/spatialdb/SimpleIOAscii.cc b/libsrc/spatialdb/SimpleIOAscii.cc
index d61408d..7dc7de0 100644
--- a/libsrc/spatialdb/SimpleIOAscii.cc
+++ b/libsrc/spatialdb/SimpleIOAscii.cc
@@ -45,18 +45,17 @@ const char* spatialdata::spatialdb::SimpleIOAscii::HEADER =
// ----------------------------------------------------------------------
// Read ascii database file.
void
-spatialdata::spatialdb::SimpleIOAscii::read(
- SimpleDBData* pData,
- spatialdata::geocoords::CoordSys** ppCS)
+spatialdata::spatialdb::SimpleIOAscii::read(SimpleDBData* pData,
+ spatialdata::geocoords::CoordSys** ppCS)
{ // read
- assert(0 != pData);
+ assert(pData);
try {
std::ifstream filein(filename());
if (!filein.is_open() || !filein.good()) {
std::ostringstream msg;
msg << "Could not open spatial database file '" << filename()
- << "' for reading.\n";
+ << "' for reading.";
throw std::runtime_error(msg.str());
} // if
@@ -77,7 +76,7 @@ spatialdata::spatialdb::SimpleIOAscii::read(
std::ostringstream msg;
msg
<< "Magic header '" << buffer.str() << "' does not match expected header '"
- << HEADER << "' in spatial database file '" << filename() << "'.\n";
+ << HEADER << "' in spatial database file '" << filename() << "'.";
throw std::runtime_error(msg.str());
} // if
int version = 0;
@@ -92,7 +91,7 @@ spatialdata::spatialdb::SimpleIOAscii::read(
std::ostringstream msg;
msg
<< "Did not recognize format version " << version
- << " of spatial database file '" << filename() << "'.\n";
+ << " of spatial database file '" << filename() << "'.";
throw std::runtime_error(msg.str());
} // default
} // switch
@@ -107,7 +106,7 @@ spatialdata::spatialdb::SimpleIOAscii::read(
} catch (...) {
std::ostringstream msg;
msg << "Unknown error occurred while reading spatial database file '"
- << filename() << "'.\n";
+ << filename() << "'.";
throw std::runtime_error(msg.str());
} // try/catch
@@ -116,13 +115,12 @@ spatialdata::spatialdb::SimpleIOAscii::read(
// ----------------------------------------------------------------------
// Read ascii database file.
void
-spatialdata::spatialdb::SimpleIOAscii::_readV1(
- SimpleDBData* pData,
- spatialdata::geocoords::CoordSys** ppCS,
- std::istream& filein)
+spatialdata::spatialdb::SimpleIOAscii::_readV1(SimpleDBData* pData,
+ spatialdata::geocoords::CoordSys** ppCS,
+ std::istream& filein)
{ // ReadV1
- assert(0 != pData);
- assert(0 != ppCS);
+ assert(pData);
+ assert(ppCS);
utils::LineParser parser(filein, "//");
parser.eatwhitespace(true);
More information about the CIG-COMMITS
mailing list