IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9874


Ignore:
Timestamp:
Nov 6, 2006, 7:09:32 PM (20 years ago)
Author:
drobbin
Message:

Added type handling for S/U64

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadataConfig.c

    r9873 r9874  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.110 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2006-11-07 04:35:21 $
     12*  @version $Revision: 1.111 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-11-07 05:09:32 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    247247// Returns single parsed value as a long signed int. The input string must be cleaned and null
    248248// terminated.
    249 static long int parseSignedInt(char *inString,
    250                                psS32 *status)
     249static psS64 parseSignedInt(char *inString,
     250                            psS32 *status)
    251251{
    252252    char *end = NULL;
    253     psS32 value = 0;
     253    psS64 value = 0;
    254254
    255255    value = strtol(inString, &end, 0);
     
    266266// Returns single parsed value as a double precision number. The input string must be cleaned and null
    267267// terminated.
    268 static unsigned long int parseUnsignedInt(char *inString,
    269         psS32 *status)
     268static psU64 parseUnsignedInt(char *inString,
     269                              psS32 *status)
    270270{
    271271    char *end = NULL;
    272     psU32 value = 0;
     272    psU64 value = 0;
    273273
    274274    value = strtoul(inString, &end, 0);
     
    705705    psF64                tempDbl       = 0.0;
    706706    psBool               tempBool      = false;
    707     psS32                tempInt       = 0;
    708     psU32                tempUint       = 0;
     707    psS64                tempInt       = 0;
     708    psU64                tempUint      = 0;
    709709    psVector*            tempVec       = NULL;
    710710    char*                tempStr       = NULL;
     
    948948        }
    949949        break;
     950    case PS_DATA_S64:
     951        tempInt = (psS64) parseSignedInt(strValue, &status);
     952        if(!status) {
     953            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags,
     954                                      strComment, tempInt);
     955        } else {
     956            psError(PS_ERR_IO, true,
     957                    _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u."),
     958                    strValue, keyName, strType, lineCount);
     959            returnValue = false;
     960        }
     961        break;
    950962    case PS_DATA_U8:
    951963        tempUint = (psU8)parseUnsignedInt(strValue, &status);
     
    974986    case PS_DATA_U32:
    975987        tempUint = (psU32)parseUnsignedInt(strValue, &status);
     988        if(!status) {
     989            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags,
     990                                      strComment, tempUint);
     991        } else {
     992            psError(PS_ERR_IO, true,
     993                    _("Failed to parse the value '%s' of metadata item %s, type %s, on line %u."),
     994                    strValue, keyName, strType, lineCount);
     995            returnValue = false;
     996        }
     997        break;
     998    case PS_DATA_U64:
     999        tempUint = (psU64)parseUnsignedInt(strValue, &status);
    9761000        if(!status) {
    9771001            addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags,
Note: See TracChangeset for help on using the changeset viewer.