The following commit has been merged in the master branch:
commit 84b5c55cf9c1c2eb19314a1e788e9cb0a9e008c9
Author: Andrei Zavada <[email protected]>
Date:   Tue Apr 9 02:07:49 2013 +0300

    return time_t bits by value

diff --git a/src/expdesign/primaries.hh b/src/expdesign/primaries.hh
index f07a4ad..00fab5c 100644
--- a/src/expdesign/primaries.hh
+++ b/src/expdesign/primaries.hh
@@ -67,10 +67,10 @@ class CSubject {
        class SEpisodeSequence;
        class SEpisode {
            public:
-               const time_t& start_time() const        { return 
sources.front()().start_time(); }
-               const time_t& end_time() const          { return 
sources.front()().end_time();   }
-               const time_t& start_time()              { return 
sources.front()().start_time(); }
-               const time_t& end_time()                { return 
sources.front()().end_time();   }
+               time_t start_time() const       { return 
sources.front()().start_time(); }
+               time_t end_time() const         { return 
sources.front()().end_time();   }
+               time_t start_time()             { return 
sources.front()().start_time(); }
+               time_t end_time()               { return 
sources.front()().end_time();   }
                time_t  // relative to start_time
                        start_rel,
                        end_rel;
diff --git a/src/expdesign/recording.cc b/src/expdesign/recording.cc
index 3a17112..704ba97 100644
--- a/src/expdesign/recording.cc
+++ b/src/expdesign/recording.cc
@@ -128,9 +128,10 @@ CProfile (CSubject& J, const string& d, const 
sigfile::SChannel& h,
 //                     pz = (size_t)difftime( F.end_time(), _0at) / _pagesize;
                        pz = pa + M.hypnogram().pages();
              // anchor zero page, get pagesize from edf^W CBinnedPower^W 
either goes
+               time_t dima = F.start_time();
                printf( "CProfile::CProfile(): adding %s of [%s, %s, %s] %zu 
pages (%zu full, %zu in hypnogram) recorded %s",
                        metrics::name(params.metric), F.subject(), F.session(), 
F.episode(),
-                       M.total_pages(), M.full_pages(), M.hypnogram().pages(), 
ctime( &F.start_time()));
+                       M.total_pages(), M.full_pages(), M.hypnogram().pages(), 
ctime( &dima));
 
                if ( pz - pa != (int)M.full_pages() ) {
                        fprintf( stderr, "CProfile::CProfile(): correcting end 
page to match full page count in EDF: %d->%zu\n",
@@ -182,9 +183,10 @@ CProfile (CRecording& M,
 
        int     pa = (size_t)difftime( M.F().start_time(), _0at) / _pagesize,
                pz = (size_t)difftime( M.F().end_time(), _0at) / _pagesize;
+       time_t  dima = M.F().start_time();
        printf( "CProfile::CProfile(): adding single recording %s of [%s, %s, 
%s] %zu pages (%zu full, %zu in hypnogram) recorded %s",
                metrics::name(params.metric), M.F().subject(), M.F().session(), 
M.F().episode(),
-               M.total_pages(), M.full_pages(), M.hypnogram().pages(), ctime( 
&M.F().start_time()));
+               M.total_pages(), M.full_pages(), M.hypnogram().pages(), ctime( 
&dima));
 
        if ( pz - pa != (int)M.full_pages() ) {
                fprintf( stderr, "CProfile::CProfile(): correcting end page to 
match full page count in EDF: %d->%zu\n",
diff --git a/src/libsigfile/edf.hh b/src/libsigfile/edf.hh
index 62812fd..d233a71 100644
--- a/src/libsigfile/edf.hh
+++ b/src/libsigfile/edf.hh
@@ -99,15 +99,13 @@ class CEDFFile
                {
                        return _session.c_str();
                }
-       // metrics
-       const time_t& start_time() const
-               {
-                       return _start_time;
-               }
-       const time_t& end_time() const
-               {
-                       return _end_time;
-               }
+               { return _session.c_str(); }
+
+       // times
+       time_t start_time() const
+               { return _start_time; }
+       time_t end_time() const
+               { return _end_time; }
        time_t recording_time() const // in seconds
                {
                        return n_data_records * data_record_size;
diff --git a/src/libsigfile/source-base.hh b/src/libsigfile/source-base.hh
index f3b27f7..fc8ad43 100644
--- a/src/libsigfile/source-base.hh
+++ b/src/libsigfile/source-base.hh
@@ -224,8 +224,8 @@ class CSource {
        virtual const char* session()                   const = 0;
 
       // recording time and duration
-       virtual const time_t& start_time()              const = 0;
-       virtual const time_t& end_time()                const = 0;
+       virtual time_t start_time()                     const = 0;
+       virtual time_t end_time()                       const = 0;
        virtual time_t recording_time()                 const = 0;
 
       // channels

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to