Changes in src/helpers.cpp [ce5ac3:042f82]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/helpers.cpp
rce5ac3 r042f82 1 1 /** \file helpers.cpp 2 2 * 3 * Implementation of some auxiliary functions for memory dis-/allocation and so on 3 * Implementation of some auxiliary functions for memory dis-/allocation and so on 4 4 */ 5 5 … … 20 20 cin >> test; 21 21 } while (test == 0.1439851348959832147598734598273456723948652983045928346598365); 22 return test; 22 return test; 23 23 }; 24 24 … … 40 40 * \return pointer to memory range 41 41 */ 42 void * Malloc(size_t size, const char* output) 42 void * Malloc(size_t size, const char* output) 43 43 { 44 44 void *buffer = NULL; … … 54 54 * \return pointer to memory range 55 55 */ 56 void * Calloc(size_t size, const char* output) 56 void * Calloc(size_t size, const char* output) 57 57 { 58 58 void *buffer = NULL; … … 69 69 * \return pointer to memory range 70 70 */ 71 void * ReAlloc(void * OldPointer, size_t size, const char* output) 71 void * ReAlloc(void * OldPointer, size_t size, const char* output) 72 72 { 73 73 void *buffer = NULL; … … 86 86 * \param *output message if free fails 87 87 */ 88 void Free(void ** buffer, const char* output) 88 void Free(void ** buffer, const char* output) 89 89 { 90 90 if (*buffer == NULL) { … … 101 101 * \return pointer to string array 102 102 */ 103 char* MallocString(size_t size, const char* output) 103 char* MallocString(size_t size, const char* output) 104 104 { 105 105 size_t i; … … 123 123 double step = (upper_bound - lower_bound); 124 124 while (*b >= upper_bound) 125 *b -= step; 125 *b -= step; 126 126 while (*b < lower_bound) 127 *b += step; 128 }; 127 *b += step; 128 }; 129 129 130 130 /** Flips two doubles. … … 170 170 } 171 171 // allocate string 172 returnstring = (char *) Malloc(sizeof(char)*(order+2), " MoleculeListClass::CreateFragmentNumberForOutput: *returnstring");172 returnstring = (char *) Malloc(sizeof(char)*(order+2), "FixedDigitNumber: *returnstring"); 173 173 // terminate and fill string array from end backward 174 174 returnstring[order] = '\0'; … … 186 186 * \return true - is a number, false - is not a valid number 187 187 */ 188 bool IsValidNumber( const char *string) 188 bool IsValidNumber( const char *string) 189 189 { 190 190 int ptr = 0;
Note:
See TracChangeset
for help on using the changeset viewer.