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

Andrei Zavada johnhommer at gmail.com
Wed May 1 00:09:41 UTC 2013


The following commit has been merged in the master branch:
commit aa1164e60e5cce4c1ef040f6d227579a05b301e2
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Mon Apr 29 01:37:04 2013 +0300

    code preening

diff --git a/src/tools/edfcat.cc b/src/tools/edfcat.cc
index 45d8e1b..32d1f4b 100644
--- a/src/tools/edfcat.cc
+++ b/src/tools/edfcat.cc
@@ -194,8 +194,7 @@ make_channel_headers_for_CEDFFile( size_t n, const char *fmt, size_t samplerate)
 	list<pair<string, size_t>> ret;
 	for ( size_t i = 0; i < n; ++i ) {
 		DEF_UNIQUE_CHARP (_);
-		assert (asprintf( &_, fmt, i) > 0 );
-		ret.emplace_back( _, samplerate);
+		ret.emplace_back( (ASPRINTF( &_, fmt, i), _), samplerate);
 	}
 	return ret;
 }
@@ -342,7 +341,7 @@ exec_convert( const SOperation::SObject& obj)
 
 	sigfile::CEDFFile F ((obj + ".edf").c_str(),
 			     sigfile::CEDFFile::TSubtype::edf,
-			     sigfile::CTypedSource::no_ancillary_files,
+			     0|sigfile::CTypedSource::no_ancillary_files,
 			     make_channel_headers_for_CEDFFile( Hh.size(), "channel%zu", obj.samplerate),
 			     obj.record_size,
 			     ceilf(duration / obj.record_size));
@@ -371,8 +370,8 @@ exec_prune( const SOperation::SObject& obj)
 	for ( auto& select_this : obj.channels ) {
 		if ( select_this >= F.n_channels() ) {
 			DEF_UNIQUE_CHARP (_);
-			assert (asprintf( &_, "Prune: Requested channel #%zu (1-based) in file %s which only has %zu channel(s)",
-					  select_this, F.filename(), F.n_channels()) > 0 );
+			ASPRINTF( &_, "Prune: Requested channel #%zu (1-based) in file %s which only has %zu channel(s)",
+				  select_this, F.filename(), F.n_channels());
 			throw invalid_argument (_);
 		}
 		string label (F[select_this].header.label, 16);
diff --git a/src/ui/mw/mw.hh b/src/ui/mw/mw.hh
index d5ad5de..26e9914 100644
--- a/src/ui/mw/mw.hh
+++ b/src/ui/mw/mw.hh
@@ -178,11 +178,11 @@ class SExpDesignUI
 		_AghHi,	_AghTi;
 	list<string>::iterator
 		_AghGi,	_AghDi,	_AghEi;
-	const char* AghH() const { return (_AghHi != AghHH.end()) ? _AghHi->c_str() : "(no channels)"; }
-	const char* AghT() const { return (_AghTi != AghTT.end()) ? _AghTi->c_str() : "(no channels)"; }
-	const char* AghG() const { return (_AghGi != AghGG.end()) ? _AghGi->c_str() : "(no groups)"; }
-	const char* AghD() const { return (_AghDi != AghDD.end()) ? _AghDi->c_str() : "(no sessions)"; }
-	const char* AghE() const { return (_AghEi != AghEE.end()) ? _AghEi->c_str() : "(no episodes)"; }
+	const char* AghH() const { return (_AghHi != AghHH.end()) ? _AghHi->c_str() : "(invalid channel)"; }
+	const char* AghT() const { return (_AghTi != AghTT.end()) ? _AghTi->c_str() : "(invalid channel)"; }
+	const char* AghG() const { return (_AghGi != AghGG.end()) ? _AghGi->c_str() : "(invalid group)"; }
+	const char* AghD() const { return (_AghDi != AghDD.end()) ? _AghDi->c_str() : "(invalid session)"; }
+	const char* AghE() const { return (_AghEi != AghEE.end()) ? _AghEi->c_str() : "(invalid episode)"; }
 	int AghTi() const;
 	int AghDi() const;
 

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list