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

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


The following commit has been merged in the master branch:
commit 31ca8695c8dbd9fbe521a4d769121d4b0df6c392
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Mon Jun 10 22:59:29 2013 +0300

    use operator[](x) instead of (*this)[x], etc

diff --git a/src/libsigfile/edf-io.cc b/src/libsigfile/edf-io.cc
index b64b96e..8aa3295 100644
--- a/src/libsigfile/edf-io.cc
+++ b/src/libsigfile/edf-io.cc
@@ -29,7 +29,7 @@ get_region_original_smpl( const int h,
 					   "CEDFFile::get_region_original(%s[%s]): bad region (req %zu:%zu, avail end %zu x %g sec = %g, or %zu x %zu = %zu)",
 					   filename(), operator[](h).ucd.name(),
 					   sa, sz, samplerate(h), recording_time(), samplerate(h) * recording_time(),
-					   n_data_records, (*this)[h].samples_per_record, n_data_records * (*this)[h].samples_per_record));
+					   n_data_records, operator[](h).samples_per_record, n_data_records * operator[](h).samples_per_record));
 
 	valarray<TFloat> recp;
 
@@ -75,7 +75,7 @@ get_region_filtered_smpl( const int h,
 	// and zeromean
        	recp -= (recp.sum() / recp.size());
 
-	const SSignal& H = (*this)[h];
+	const SSignal& H = operator[](h);
 
       // artifacts
 	size_t this_samplerate = H.samples_per_record / data_record_size;
@@ -175,7 +175,7 @@ put_region_smpl( const int h,
 		throw range_error("CEDFFile::put_region_(): attempt to write past end of file");
 	}
 
-	const SSignal& H = (*this)[h];
+	const SSignal& H = operator[](h);
 	size_t	r0    =                            offset  / H.samples_per_record,
 		r_cnt = (size_t) ceilf( (double)src.size() / H.samples_per_record);
 
diff --git a/src/libsigfile/edf.hh b/src/libsigfile/edf.hh
index 199d1b3..e9b4393 100644
--- a/src/libsigfile/edf.hh
+++ b/src/libsigfile/edf.hh
@@ -155,18 +155,18 @@ class CEDFFile
 
 	SChannel::TType
 	signal_type( const int h) const
-		{ return (*this)[h].ucd.type(); }
+		{ return operator[](h).ucd.type(); }
 
 	size_t
 	samplerate( const int h) const
-		{ return (*this)[h].samples_per_record / data_record_size; }
+		{ return operator[](h).samples_per_record / data_record_size; }
 
 	list<SAnnotation>&
 	annotations( const int h)
-		{ return (*this)[h].annotations; }
+		{ return operator[](h).annotations; }
 	const list<SAnnotation>&
 	annotations( const int h) const
-		{ return (*this)[h].annotations; }
+		{ return operator[](h).annotations; }
 
 	list<SAnnotation>&
 	annotations()
@@ -178,18 +178,18 @@ class CEDFFile
 	// artifacts
 	SArtifacts&
 	artifacts( int h)
-		{ return (*this)[h].artifacts; }
+		{ return operator[](h).artifacts; }
 	const SArtifacts&
 	artifacts( int h) const
-		{ return (*this)[h].artifacts; }
+		{ return operator[](h).artifacts; }
 
 	// filters
 	SFilterPack&
 	filters( const int h)
-		{ return (*this)[h].filters; }
+		{ return operator[](h).filters; }
 	const SFilterPack&
 	filters( const int h) const
-		{ return (*this)[h].filters; }
+		{ return operator[](h).filters; }
 
 
       // signal data extractors
@@ -199,7 +199,7 @@ class CEDFFile
 	valarray<TFloat>
 	get_signal_original( const int h) const // there is a CSource::get_signal_original already, but this one is a little better
 		{ return get_region_original_smpl(
-				h, 0, n_data_records * (*this)[h].samples_per_record); }
+				h, 0, n_data_records * operator[](h).samples_per_record); }
 
 	valarray<TFloat>
 	get_region_filtered_smpl( int, size_t, size_t) const;
@@ -207,7 +207,7 @@ class CEDFFile
 	valarray<TFloat>
 	get_signal_filtered( const int h) const
 		{ return get_region_filtered_smpl(
-				h, 0, n_data_records * (*this)[h].samples_per_record); }
+				h, 0, n_data_records * operator[](h).samples_per_record); }
 
       // put signal
 	int
diff --git a/src/libsigfile/page.cc b/src/libsigfile/page.cc
index 88d8723..31fae2c 100644
--- a/src/libsigfile/page.cc
+++ b/src/libsigfile/page.cc
@@ -66,7 +66,7 @@ save( const char* fname) const
 
 	of << _pagesize << endl;
 	for ( size_t p = 0; p < _pages.size(); ++p )
-		of << (*this)[p].NREM << '\t' << (*this)[p].REM << '\t' << (*this)[p].Wake << endl;
+		of << operator[](p).NREM << '\t' << operator[](p).REM << '\t' << operator[](p).Wake << endl;
 
 	return CHypnogram::TError::ok;
 }
@@ -114,9 +114,9 @@ save_canonical( const char *fname) const
 		return -1;
 
 	for ( size_t p = 0; p < pages(); ++p ) {
-		float	N = (*this)[p].NREM,
-			R = (*this)[p].REM,
-			W = (*this)[p].Wake;
+		float	N = operator[](p).NREM,
+			R = operator[](p).REM,
+			W = operator[](p).Wake;
 		fprintf( f, "%s\n",
 			 N > .7 ?"NREM4"
 			 : N > .4 ?"NREM3"
@@ -183,7 +183,7 @@ load_canonical( const char *fname,
 			;
 		}
 
-		(*this)[p++] = P;
+		operator[](p++) = P;
 	}
 
 	return f.eof() ? 0 : 1;
diff --git a/src/sigproc/sigproc.hh b/src/sigproc/sigproc.hh
index da3b86d..ed78c8c 100644
--- a/src/sigproc/sigproc.hh
+++ b/src/sigproc/sigproc.hh
@@ -172,23 +172,23 @@ struct SCachedEnvelope
 
 	T breadth( double scope_, size_t i)
 		{
-			(*this)( scope_);
+			operator()( scope_);
 			return upper[i] - lower[i];
 		}
 	valarray<T> breadth( double scope_)
 		{
-			(*this)( scope_);
+			operator()( scope_);
 			return upper - lower;
 		}
 
 	T centre( double scope_, size_t i)
 		{
-			(*this)( scope_);
+			operator()( scope_);
 			return mid[i];
 		}
 	valarray<T> centre( double scope_)
 		{
-			(*this)( scope_);
+			operator()( scope_);
 			return mid;
 		}
 

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list