Changeset 2204 for trunk/psLib/src/astro/psTime.c
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psTime.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r2196 r2204 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-10-2 6 00:37:44$13 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-10-27 00:57:30 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 144 144 static double lookupSer7Table( 145 145 const psTime *time, ///< time to lookup. 146 intcol ///< Column to lookup.146 psS32 col ///< Column to lookup. 147 147 ); 148 148 … … 150 150 { 151 151 char line[LINESIZE]; 152 intj = 0;153 intmaxLines = 100;152 psS32 j = 0; 153 psS32 maxLines = 100; 154 154 psF64 *ptr = NULL; 155 155 psImage *table = NULL; … … 180 180 } 181 181 182 *( unsigned int*)&table->numRows = j;182 *(psU32 *)&table->numRows = j; 183 183 184 184 p_psMemSetPersistent(table,true); … … 191 191 static psImage* readSer7File(const char *fileName) 192 192 { 193 bool beginRecord = false;193 psBool beginRecord = false; 194 194 char line[LINESIZE]; 195 intj = 0;196 intmaxLines = 400;195 psS32 j = 0; 196 psS32 maxLines = 400; 197 197 psImage *table = NULL; 198 198 FILE *fd = NULL; … … 231 231 } 232 232 } 233 *( unsigned int*)&table->numRows = j;233 *(psU32 *)&table->numRows = j; 234 234 235 235 p_psMemSetPersistent(table,true); … … 244 244 { 245 245 char line[LINESIZE]; 246 inti = 0;247 intj = 0;248 intmaxLines = 2500;246 psS32 i = 0; 247 psS32 j = 0; 248 psS32 maxLines = 2500; 249 249 psImage *table = NULL; 250 250 FILE *fd = NULL; … … 276 276 } 277 277 278 *( unsigned int*)&table->numRows = j;278 *(psU32 *)&table->numRows = j; 279 279 280 280 return table; … … 284 284 { 285 285 char line[LINESIZE]; 286 intj = 0;287 intmaxLines = 15000;286 psS32 j = 0; 287 psS32 maxLines = 15000; 288 288 psImage *table = NULL; 289 289 FILE *fd = NULL; … … 346 346 } 347 347 348 *( unsigned int*)&table->numRows = j;348 *(psU32 *)&table->numRows = j; 349 349 350 350 return table; … … 354 354 static double lookupTaiUtcTable(const psTime *time) 355 355 { 356 inthiIdx = 0;357 intloIdx = 0;358 intnumRows = 0;356 psS32 hiIdx = 0; 357 psS32 loIdx = 0; 358 psS32 numRows = 0; 359 359 double jd = 0.0; 360 360 double mjd = 0.0; … … 422 422 } 423 423 424 static double lookupSer7Table(const psTime *time, intcol)425 { 426 inthiIdx = 0;427 intloIdx = 0;428 intnumRows = 0;424 static double lookupSer7Table(const psTime *time, psS32 col) 425 { 426 psS32 hiIdx = 0; 427 psS32 loIdx = 0; 428 psS32 numRows = 0; 429 429 double out = 0.0; 430 430 double denom = 0.0; … … 752 752 } 753 753 754 longpsTimeLeapseconds(const psTime *time1, const psTime *time2)755 { 756 longdiff = 0;754 psS64 psTimeLeapseconds(const psTime *time1, const psTime *time2) 755 { 756 psS64 diff = 0; 757 757 758 758 … … 827 827 char* psTimeToISOTime(const psTime *time) 828 828 { 829 intms = 0;829 psS32 ms = 0; 830 830 char *timeString = NULL; 831 831 char *tempString = NULL; … … 889 889 struct tm* psTimeToTM(const psTime *time) 890 890 { 891 longcent = 0;892 longyear = 0;893 longmonth = 0;894 longday = 0;895 longhour = 0;896 longminute = 0;897 longseconds = 0;898 longtemp = 0;891 psS64 cent = 0; 892 psS64 year = 0; 893 psS64 month = 0; 894 psS64 day = 0; 895 psS64 hour = 0; 896 psS64 minute = 0; 897 psS64 seconds = 0; 898 psS64 temp = 0; 899 899 struct tm* tmTime = NULL; 900 900 … … 975 975 seconds = days * SEC_PER_DAY; 976 976 if(seconds < 0.0) { 977 outTime->usec = (seconds - ( long)seconds) * -1000000.0; // psTime earlier than epoch977 outTime->usec = (seconds - (psS64)seconds) * -1000000.0; // psTime earlier than epoch 978 978 } else { 979 outTime->usec = (seconds - ( long)seconds) * 1000000.0; // psTime greater than epoch979 outTime->usec = (seconds - (psS64)seconds) * 1000000.0; // psTime greater than epoch 980 980 } 981 981 outTime->sec = seconds; … … 1003 1003 seconds = days * SEC_PER_DAY; 1004 1004 if(seconds < 0.0) { 1005 outTime->usec = (seconds - ( long)seconds) * -1000000.0; // psTime earlier than epoch1005 outTime->usec = (seconds - (psS64)seconds) * -1000000.0; // psTime earlier than epoch 1006 1006 } else { 1007 outTime->usec = (seconds - ( long)seconds) * 1000000.0; // psTime greater than epoch1007 outTime->usec = (seconds - (psS64)seconds) * 1000000.0; // psTime greater than epoch 1008 1008 } 1009 1009 outTime->sec = seconds; … … 1020 1020 { 1021 1021 char tempString[MAX_TIME_STRING_LENGTH]; 1022 intmonth;1023 intday;1024 intyear;1025 inthour;1026 intminute;1027 intsecond;1028 intmillisecond;1022 psS32 month; 1023 psS32 day; 1024 psS32 year; 1025 psS32 hour; 1026 psS32 minute; 1027 psS32 second; 1028 psS32 millisecond; 1029 1029 struct tm tmTime; 1030 1030 psTime *outTime = NULL; … … 1127 1127 psTime* psTimeFromTM(const struct tm* time) 1128 1128 { 1129 longyear;1130 longmonth;1131 longday;1132 longhour;1133 longminute;1134 longseconds;1135 longtemp;1129 psS64 year; 1130 psS64 month; 1131 psS64 day; 1132 psS64 hour; 1133 psS64 minute; 1134 psS64 seconds; 1135 psS64 temp; 1136 1136 psTime *outTime = NULL; 1137 1137 … … 1194 1194 { 1195 1195 psF64 deltaSec = 0; 1196 longdeltaUsec = 0;1196 psS64 deltaUsec = 0; 1197 1197 psTime *outTime = NULL; 1198 1198 … … 1243 1243 { 1244 1244 psS64 deltaSec = 0; 1245 longdeltaUsec = 0;1245 psS64 deltaUsec = 0; 1246 1246 psTime *outTime = NULL; 1247 1247 … … 1267 1267 outTime = psTimeAlloc(tai1->type); 1268 1268 deltaSec = tai1->sec - tai2->sec; 1269 deltaUsec = ( long)tai1->usec - (long)tai2->usec;1269 deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec; 1270 1270 1271 1271 // Adjust time in case of microsecond underflow after subtraction … … 1289 1289 { 1290 1290 psS64 deltaSec = 0; 1291 longdeltaUsec = 0;1291 psS64 deltaUsec = 0; 1292 1292 psTime *outTime = NULL; 1293 1293 … … 1313 1313 outTime = psTimeAlloc(tai1->type); 1314 1314 deltaSec = tai1->sec - tai2->sec; 1315 deltaUsec = ( long)tai1->usec - (long)tai2->usec;1315 deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec; 1316 1316 1317 1317 // Adjust time in case of microsecond underflow after subtraction
Note:
See TracChangeset
for help on using the changeset viewer.
