comparison liboctave/oct-time.h @ 10312:cbc402e64d83

untabify liboctave header files
author John W. Eaton <jwe@octave.org>
date Thu, 11 Feb 2010 12:14:48 -0500
parents fa7b5751730c
children 12d25a1d84bf
comparison
equal deleted inserted replaced
10311:a217e1d74353 10312:cbc402e64d83
47 { 47 {
48 int rem, extra; 48 int rem, extra;
49 49
50 if (us >= 0) 50 if (us >= 0)
51 { 51 {
52 rem = us % 1000000; 52 rem = us % 1000000;
53 extra = (us - rem) / 1000000; 53 extra = (us - rem) / 1000000;
54 } 54 }
55 else 55 else
56 { 56 {
57 us = -us; 57 us = -us;
58 rem = us % 1000000; 58 rem = us % 1000000;
59 extra = - (1 + (us - rem) / 1000000); 59 extra = - (1 + (us - rem) / 1000000);
60 rem = 1000000 - us % 1000000; 60 rem = 1000000 - us % 1000000;
61 } 61 }
62 62
63 ot_usec = rem; 63 ot_usec = rem;
64 ot_unix_time += extra; 64 ot_unix_time += extra;
65 } 65 }
78 78
79 octave_time& operator = (const octave_time& ot) 79 octave_time& operator = (const octave_time& ot)
80 { 80 {
81 if (this != &ot) 81 if (this != &ot)
82 { 82 {
83 ot_unix_time = ot.ot_unix_time; 83 ot_unix_time = ot.ot_unix_time;
84 ot_usec = ot.ot_usec; 84 ot_usec = ot.ot_usec;
85 } 85 }
86 86
87 return *this; 87 return *this;
88 } 88 }
89 89
160 160
161 inline octave_time 161 inline octave_time
162 operator + (const octave_time& t1, const octave_time& t2) 162 operator + (const octave_time& t1, const octave_time& t2)
163 { 163 {
164 return octave_time (t1.unix_time () + t2.unix_time (), 164 return octave_time (t1.unix_time () + t2.unix_time (),
165 t1.usec () + t2.usec ()); 165 t1.usec () + t2.usec ());
166 } 166 }
167 167
168 class 168 class
169 OCTAVE_API 169 OCTAVE_API
170 octave_base_tm 170 octave_base_tm
186 186
187 octave_base_tm& operator = (const octave_base_tm& tm) 187 octave_base_tm& operator = (const octave_base_tm& tm)
188 { 188 {
189 if (this != &tm) 189 if (this != &tm)
190 { 190 {
191 tm_usec = tm.tm_usec; 191 tm_usec = tm.tm_usec;
192 tm_sec = tm.tm_sec; 192 tm_sec = tm.tm_sec;
193 tm_min = tm.tm_min; 193 tm_min = tm.tm_min;
194 tm_hour = tm.tm_hour; 194 tm_hour = tm.tm_hour;
195 tm_mday = tm.tm_mday; 195 tm_mday = tm.tm_mday;
196 tm_mon = tm.tm_mon; 196 tm_mon = tm.tm_mon;
197 tm_year = tm.tm_year; 197 tm_year = tm.tm_year;
198 tm_wday = tm.tm_wday; 198 tm_wday = tm.tm_wday;
199 tm_yday = tm.tm_yday; 199 tm_yday = tm.tm_yday;
200 tm_isdst = tm.tm_isdst; 200 tm_isdst = tm.tm_isdst;
201 tm_zone = tm.tm_zone; 201 tm_zone = tm.tm_zone;
202 } 202 }
203 203
204 return *this; 204 return *this;
205 } 205 }
206 206