IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psTime.c

    r2196 r2204  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-10-26 00:37:44 $
     13 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-10-27 00:57:30 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    144144static double lookupSer7Table(
    145145    const psTime *time,                 ///< time to lookup.
    146     int col                             ///< Column to lookup.
     146    psS32 col                             ///< Column to lookup.
    147147);
    148148
     
    150150{
    151151    char line[LINESIZE];
    152     int j = 0;
    153     int maxLines = 100;
     152    psS32 j = 0;
     153    psS32 maxLines = 100;
    154154    psF64 *ptr = NULL;
    155155    psImage *table = NULL;
     
    180180    }
    181181
    182     *(unsigned int *)&table->numRows = j;
     182    *(psU32 *)&table->numRows = j;
    183183
    184184    p_psMemSetPersistent(table,true);
     
    191191static psImage* readSer7File(const char *fileName)
    192192{
    193     bool beginRecord = false;
     193    psBool beginRecord = false;
    194194    char line[LINESIZE];
    195     int j = 0;
    196     int maxLines = 400;
     195    psS32 j = 0;
     196    psS32 maxLines = 400;
    197197    psImage *table = NULL;
    198198    FILE *fd = NULL;
     
    231231        }
    232232    }
    233     *(unsigned int *)&table->numRows = j;
     233    *(psU32 *)&table->numRows = j;
    234234
    235235    p_psMemSetPersistent(table,true);
     
    244244{
    245245    char line[LINESIZE];
    246     int i = 0;
    247     int j = 0;
    248     int maxLines = 2500;
     246    psS32 i = 0;
     247    psS32 j = 0;
     248    psS32 maxLines = 2500;
    249249    psImage *table = NULL;
    250250    FILE *fd = NULL;
     
    276276    }
    277277 
    278     *(unsigned int *)&table->numRows = j;
     278    *(psU32 *)&table->numRows = j;
    279279 
    280280    return table;
     
    284284{
    285285    char line[LINESIZE];
    286     int j = 0;
    287     int maxLines = 15000;
     286    psS32 j = 0;
     287    psS32 maxLines = 15000;
    288288    psImage *table = NULL;
    289289    FILE *fd = NULL;
     
    346346    }
    347347 
    348     *(unsigned int *)&table->numRows = j;
     348    *(psU32 *)&table->numRows = j;
    349349 
    350350    return table;
     
    354354static double lookupTaiUtcTable(const psTime *time)
    355355{
    356     int hiIdx = 0;
    357     int loIdx = 0;
    358     int numRows = 0;
     356    psS32 hiIdx = 0;
     357    psS32 loIdx = 0;
     358    psS32 numRows = 0;
    359359    double jd = 0.0;
    360360    double mjd = 0.0;
     
    422422}
    423423
    424 static double lookupSer7Table(const psTime *time, int col)
    425 {
    426     int hiIdx = 0;
    427     int loIdx = 0;
    428     int numRows = 0;
     424static double lookupSer7Table(const psTime *time, psS32 col)
     425{
     426    psS32 hiIdx = 0;
     427    psS32 loIdx = 0;
     428    psS32 numRows = 0;
    429429    double out = 0.0;
    430430    double denom = 0.0;
     
    752752}
    753753
    754 long psTimeLeapseconds(const psTime *time1, const psTime *time2)
    755 {
    756     long diff = 0;
     754psS64 psTimeLeapseconds(const psTime *time1, const psTime *time2)
     755{
     756    psS64 diff = 0;
    757757
    758758
     
    827827char* psTimeToISOTime(const psTime *time)
    828828{
    829     int ms = 0;
     829    psS32 ms = 0;
    830830    char *timeString = NULL;
    831831    char *tempString = NULL;
     
    889889struct tm* psTimeToTM(const psTime *time)
    890890{
    891     long cent = 0;
    892     long year = 0;
    893     long month = 0;
    894     long day = 0;
    895     long hour = 0;
    896     long minute = 0;
    897     long seconds = 0;
    898     long temp = 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;
    899899    struct tm* tmTime = NULL;
    900900
     
    975975    seconds = days * SEC_PER_DAY;
    976976    if(seconds < 0.0) {
    977         outTime->usec = (seconds - (long)seconds) * -1000000.0;  // psTime earlier than epoch
     977        outTime->usec = (seconds - (psS64)seconds) * -1000000.0;  // psTime earlier than epoch
    978978    } else {
    979         outTime->usec = (seconds - (long)seconds) * 1000000.0;   // psTime greater than epoch
     979        outTime->usec = (seconds - (psS64)seconds) * 1000000.0;   // psTime greater than epoch
    980980    }
    981981    outTime->sec = seconds;
     
    10031003    seconds = days * SEC_PER_DAY;
    10041004    if(seconds < 0.0) {
    1005         outTime->usec = (seconds - (long)seconds) * -1000000.0;  // psTime earlier than epoch
     1005        outTime->usec = (seconds - (psS64)seconds) * -1000000.0;  // psTime earlier than epoch
    10061006    } else {
    1007         outTime->usec = (seconds - (long)seconds) * 1000000.0;   // psTime greater than epoch
     1007        outTime->usec = (seconds - (psS64)seconds) * 1000000.0;   // psTime greater than epoch
    10081008    }
    10091009    outTime->sec = seconds;
     
    10201020{
    10211021    char tempString[MAX_TIME_STRING_LENGTH];
    1022     int month;
    1023     int day;
    1024     int year;
    1025     int hour;
    1026     int minute;
    1027     int second;
    1028     int millisecond;
     1022    psS32 month;
     1023    psS32 day;
     1024    psS32 year;
     1025    psS32 hour;
     1026    psS32 minute;
     1027    psS32 second;
     1028    psS32 millisecond;
    10291029    struct tm tmTime;
    10301030    psTime *outTime = NULL;
     
    11271127psTime* psTimeFromTM(const struct tm* time)
    11281128{
    1129     long year;
    1130     long month;
    1131     long day;
    1132     long hour;
    1133     long minute;
    1134     long seconds;
    1135     long temp;
     1129    psS64 year;
     1130    psS64 month;
     1131    psS64 day;
     1132    psS64 hour;
     1133    psS64 minute;
     1134    psS64 seconds;
     1135    psS64 temp;
    11361136    psTime *outTime = NULL;
    11371137
     
    11941194{
    11951195    psF64 deltaSec = 0;
    1196     long deltaUsec = 0;
     1196    psS64 deltaUsec = 0;
    11971197    psTime *outTime = NULL;
    11981198
     
    12431243{
    12441244    psS64 deltaSec = 0;
    1245     long deltaUsec = 0;
     1245    psS64 deltaUsec = 0;
    12461246    psTime *outTime = NULL;
    12471247
     
    12671267    outTime = psTimeAlloc(tai1->type);
    12681268    deltaSec = tai1->sec - tai2->sec;
    1269     deltaUsec = (long)tai1->usec - (long)tai2->usec;
     1269    deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec;
    12701270
    12711271    // Adjust time in case of microsecond underflow after subtraction
     
    12891289{
    12901290    psS64 deltaSec = 0;
    1291     long deltaUsec = 0;
     1291    psS64 deltaUsec = 0;
    12921292    psTime *outTime = NULL;
    12931293
     
    13131313    outTime = psTimeAlloc(tai1->type);
    13141314    deltaSec = tai1->sec - tai2->sec;
    1315     deltaUsec = (long)tai1->usec - (long)tai2->usec;
     1315    deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec;
    13161316
    13171317    // Adjust time in case of microsecond underflow after subtraction
Note: See TracChangeset for help on using the changeset viewer.