summaryrefslogtreecommitdiffstats
path: root/src/time64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/time64.c')
-rw-r--r--src/time64.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/time64.c b/src/time64.c
index db571d8..364e159 100644
--- a/src/time64.c
+++ b/src/time64.c
@@ -176,34 +176,28 @@ static int is_exception_century(Year year)
176static int cmp_date( const struct TM* left, const struct tm* right ) { 176static int cmp_date( const struct TM* left, const struct tm* right ) {
177 if( left->tm_year > right->tm_year ) 177 if( left->tm_year > right->tm_year )
178 return 1; 178 return 1;
179 else if( left->tm_year < right->tm_year ) 179 if( left->tm_year < right->tm_year )
180 return -1; 180 return -1;
181
182 if( left->tm_mon > right->tm_mon ) 181 if( left->tm_mon > right->tm_mon )
183 return 1; 182 return 1;
184 else if( left->tm_mon < right->tm_mon ) 183 if( left->tm_mon < right->tm_mon )
185 return -1; 184 return -1;
186
187 if( left->tm_mday > right->tm_mday ) 185 if( left->tm_mday > right->tm_mday )
188 return 1; 186 return 1;
189 else if( left->tm_mday < right->tm_mday ) 187 if( left->tm_mday < right->tm_mday )
190 return -1; 188 return -1;
191
192 if( left->tm_hour > right->tm_hour ) 189 if( left->tm_hour > right->tm_hour )
193 return 1; 190 return 1;
194 else if( left->tm_hour < right->tm_hour ) 191 if( left->tm_hour < right->tm_hour )
195 return -1; 192 return -1;
196
197 if( left->tm_min > right->tm_min ) 193 if( left->tm_min > right->tm_min )
198 return 1; 194 return 1;
199 else if( left->tm_min < right->tm_min ) 195 if( left->tm_min < right->tm_min )
200 return -1; 196 return -1;
201
202 if( left->tm_sec > right->tm_sec ) 197 if( left->tm_sec > right->tm_sec )
203 return 1; 198 return 1;
204 else if( left->tm_sec < right->tm_sec ) 199 if( left->tm_sec < right->tm_sec )
205 return -1; 200 return -1;
206
207 return 0; 201 return 0;
208} 202}
209 203
@@ -774,15 +768,15 @@ struct TM *localtime64_r (const Time64_T *timev, struct TM *local_tm)
774static int valid_tm_wday( const struct TM* date ) { 768static int valid_tm_wday( const struct TM* date ) {
775 if( 0 <= date->tm_wday && date->tm_wday <= 6 ) 769 if( 0 <= date->tm_wday && date->tm_wday <= 6 )
776 return 1; 770 return 1;
777 else 771
778 return 0; 772 return 0;
779} 773}
780 774
781static int valid_tm_mon( const struct TM* date ) { 775static int valid_tm_mon( const struct TM* date ) {
782 if( 0 <= date->tm_mon && date->tm_mon <= 11 ) 776 if( 0 <= date->tm_mon && date->tm_mon <= 11 )
783 return 1; 777 return 1;
784 else 778
785 return 0; 779 return 0;
786} 780}
787 781
788 782