Changeset 9874
- Timestamp:
- Nov 6, 2006, 7:09:32 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/types/psMetadataConfig.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psMetadataConfig.c
r9873 r9874 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.11 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-11-07 0 4:35:21$12 * @version $Revision: 1.111 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-11-07 05:09:32 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 247 247 // Returns single parsed value as a long signed int. The input string must be cleaned and null 248 248 // terminated. 249 static long intparseSignedInt(char *inString,250 psS32 *status)249 static psS64 parseSignedInt(char *inString, 250 psS32 *status) 251 251 { 252 252 char *end = NULL; 253 psS 32value = 0;253 psS64 value = 0; 254 254 255 255 value = strtol(inString, &end, 0); … … 266 266 // Returns single parsed value as a double precision number. The input string must be cleaned and null 267 267 // terminated. 268 static unsigned long intparseUnsignedInt(char *inString,269 psS32 *status)268 static psU64 parseUnsignedInt(char *inString, 269 psS32 *status) 270 270 { 271 271 char *end = NULL; 272 psU 32value = 0;272 psU64 value = 0; 273 273 274 274 value = strtoul(inString, &end, 0); … … 705 705 psF64 tempDbl = 0.0; 706 706 psBool tempBool = false; 707 psS 32tempInt = 0;708 psU 32 tempUint= 0;707 psS64 tempInt = 0; 708 psU64 tempUint = 0; 709 709 psVector* tempVec = NULL; 710 710 char* tempStr = NULL; … … 948 948 } 949 949 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; 950 962 case PS_DATA_U8: 951 963 tempUint = (psU8)parseUnsignedInt(strValue, &status); … … 974 986 case PS_DATA_U32: 975 987 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); 976 1000 if(!status) { 977 1001 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, mdType | flags,
Note:
See TracChangeset
for help on using the changeset viewer.
