[med-svn] [SCM] aghermann branch, master, updated. 99b1d5a023eee9df74b0e0d6f894516fc79435ad

Andrei Zavada johnhommer at gmail.com
Sun Jul 7 23:03:52 UTC 2013


The following commit has been merged in the master branch:
commit 832373f26c09dba03c8392196899759a52813780
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Mon Jun 10 02:45:16 2013 +0300

    CSource::recording_time() is of type double

diff --git a/src/libsigfile/edf-io.cc b/src/libsigfile/edf-io.cc
index db9023e..2f306e1 100644
--- a/src/libsigfile/edf-io.cc
+++ b/src/libsigfile/edf-io.cc
@@ -165,7 +165,7 @@ put_region_smpl( const int h,
 	if ( unlikely (offset >= samplerate(h) * recording_time()) )
 		throw range_error("CEDFFile::put_region_(): offset beyond end of file");
 	if ( unlikely (offset + src.size() > samplerate(h) * recording_time()) ) {
-		fprintf( stderr, "CEDFFile::put_region_(): attempt to write past end of file (%zu + %zu > %zu * %lu)\n",
+		fprintf( stderr, "CEDFFile::put_region_(): attempt to write past end of file (%zu + %zu > %zu * %g)\n",
 			 offset, src.size(), samplerate(h), recording_time());
 		throw range_error("CEDFFile::put_region_(): attempt to write past end of file");
 	}
diff --git a/src/libsigfile/edf.hh b/src/libsigfile/edf.hh
index 60925f1..199d1b3 100644
--- a/src/libsigfile/edf.hh
+++ b/src/libsigfile/edf.hh
@@ -114,7 +114,7 @@ class CEDFFile
 		{ return _start_time; }
 	time_t end_time() const
 		{ return _end_time; }
-	time_t recording_time() const // in seconds
+	double recording_time() const // in seconds
 		{ return n_data_records * data_record_size; }
 
 	// setters
diff --git a/src/libsigfile/source-base.hh b/src/libsigfile/source-base.hh
index 6ee29f0..2ee2be4 100644
--- a/src/libsigfile/source-base.hh
+++ b/src/libsigfile/source-base.hh
@@ -229,7 +229,7 @@ class CSource {
       // recording time and duration
 	virtual time_t start_time()			const = 0;
 	virtual time_t end_time()			const = 0;
-	virtual time_t recording_time()			const = 0;
+	virtual double recording_time()			const = 0;
 
       // channels
 	virtual size_t n_channels()			const = 0;
diff --git a/src/libsigfile/source.cc b/src/libsigfile/source.cc
index b63ded3..e68b6b0 100644
--- a/src/libsigfile/source.cc
+++ b/src/libsigfile/source.cc
@@ -35,10 +35,10 @@ CTypedSource (const string& fname,
 	if ( flags | ~no_ancillary_files ) {
 		// CHypnogram::
 		CHypnogram::load( sigfile::make_fname_hypnogram(fname, pagesize));
-		size_t scorable_pages = ceil( (double)_obj->recording_time() / pagesize);
+		size_t scorable_pages = ceil( _obj->recording_time() / pagesize);
 		if ( CHypnogram::pages() != scorable_pages ) {
 			if ( CHypnogram::pages() > 0 )
-				fprintf( stderr, "CSource(\"%s\"): number of scorable pages @pagesize=%zu (%lu / %zu = %zu) "
+				fprintf( stderr, "CSource(\"%s\"): number of scorable pages @pagesize=%zu (%g / %zu = %zu) "
 					 "differs from the number read from hypnogram file (%zu); adjusting hypnogram size\n",
 					 fname.c_str(), pagesize, _obj->recording_time(), pagesize, scorable_pages, CHypnogram::pages());
 			CHypnogram::_pages.resize( scorable_pages);

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list