[eclib] 01/03: Imported Upstream version 20160206
Julien Puydt
julien.puydt at laposte.net
Sat Apr 16 18:32:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to branch master
in repository eclib.
commit 96c130628bc6b36cecc3a2bd580a9671899abb47
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Wed Apr 13 20:38:21 2016 +0200
Imported Upstream version 20160206
---
libsrc/newforms.cc | 2 +-
libsrc/timer.cc | 16 +++++++---------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/libsrc/newforms.cc b/libsrc/newforms.cc
index 400f445..0d05872 100644
--- a/libsrc/newforms.cc
+++ b/libsrc/newforms.cc
@@ -1336,7 +1336,7 @@ void newforms::createfromolddata()
ifstream intdatafile(intdataname.str().c_str());
if(!intdatafile.is_open())
{
- cout<<"Unable to open data file "<<intdataname<<" for data input"<<endl;
+ cout<<"Unable to open data file "<<intdataname.str()<<" for data input"<<endl;
abort();
return;
}
diff --git a/libsrc/timer.cc b/libsrc/timer.cc
index f2b890d..0c4e361 100644
--- a/libsrc/timer.cc
+++ b/libsrc/timer.cc
@@ -74,7 +74,7 @@ timer::~timer() {
// Close file, if ever opened
// Do not reference s_ _ever_. We do not
// want to close std::cout nonetheless.
- if( file_ != NULL ) {
+ if( file_.is_open() ) {
file_.close();
}
}
@@ -101,15 +101,13 @@ void timer::stream( string filename ) {
file_.open(filename.c_str(),ios::out|ios::trunc);
// Check is file successfully opened
- if( file_ == NULL ) {
- {
- cout << "File " << filename << " could not be opened ... using stout" << endl;
- s_ = &cout;
- }
+ if( !file_.is_open() ) {
+ cout << "File " << filename << " could not be opened ... using stout" << endl;
+ s_ = &cout;
+ } else {
+ // Point main reference to newly opened file
+ s_ = &file_;
}
-
- // Point main reference to newly opened file
- s_ = &file_;
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/eclib.git
More information about the debian-science-commits
mailing list