Changeset 29680
- Timestamp:
- Nov 5, 2010, 9:50:55 AM (16 years ago)
- Location:
- branches/eam_branches/ipp-20101103/psLib/src/sys
- Files:
-
- 3 edited
-
psSlurp.c (modified) (1 diff)
-
psString.c (modified) (1 diff)
-
psString.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/psLib/src/sys/psSlurp.c
r12072 r29680 38 38 // increase the allocated string size 39 39 size += SLURP_SIZE; 40 str = ps Realloc(str, size);40 str = psStringRealloc(str, size); 41 41 42 42 // read a block from the stream -
branches/eam_branches/ipp-20101103/psLib/src/sys/psString.c
r19070 r29680 48 48 psString string = p_psAlloc(file, lineno, func, nChar + 1); 49 49 psMemSetDeallocator(string, (psFreeFunc)stringFree); 50 51 return string; 52 } 53 54 55 psString p_psStringRealloc(const char *file, 56 unsigned int lineno, 57 const char *func, 58 psString string, 59 size_t nChar) 60 { 61 if (!string) { 62 string = p_psAlloc(file, lineno, func, nChar + 1); 63 psMemSetDeallocator(string, (psFreeFunc)stringFree); 64 } else { 65 string = p_psRealloc(file, lineno, func, string, nChar + 1); 66 } 50 67 51 68 return string; -
branches/eam_branches/ipp-20101103/psLib/src/sys/psString.h
r15523 r29680 40 40 #define PS_FILE_LINE p_psFileLine(__FILE__,__LINE__) 41 41 42 43 42 /** Allocates a new psString. 44 43 * … … 60 59 #endif // ifdef DOXYGEN 61 60 61 /** Reallocate an existing psString (or alloc if not existent) 62 * 63 * @return psString: string of length n. 64 */ 65 #ifdef DOXYGEN 66 psString psStringRealloc( 67 psString string, 68 size_t nChar ///< Size of psString to allocate. 69 ); 70 #else // ifdef DOXYGEN 71 psString p_psStringRealloc( 72 const char *file, ///< File of caller 73 unsigned int lineno, ///< Line number of caller 74 const char *func, ///< Function name of caller 75 psString string, ///< supplied string or NULL 76 size_t nChar ///< Size of psString to allocate. 77 ) PS_ATTR_MALLOC; 78 #define psStringRealloc(string, nChar) \ 79 p_psStringRealloc(__FILE__, __LINE__, __func__, string, nChar) 80 #endif // ifdef DOXYGEN 62 81 63 82 /** Checks the type of a particular pointer.
Note:
See TracChangeset
for help on using the changeset viewer.
