Changeset 79290f for pcp/src/init.c
- Timestamp:
- Jun 7, 2008, 1:13:29 PM (17 years ago)
- Children:
- 02bc3c
- Parents:
- a97897
- File:
-
- 1 edited
-
pcp/src/init.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/init.c
ra97897 r79290f 22 22 */ 23 23 24 #ifdef HAVE_CONFIG_H 25 #include <config.h> 26 #endif 27 24 28 #include <stdlib.h> 25 29 #include <stdio.h> … … 28 32 29 33 // use double precision fft when we have it 30 #ifdef HAVE_CONFIG_H31 #include <config.h>32 #endif33 34 34 #ifdef HAVE_DFFTW_H 35 35 #include "dfftw.h" … … 1305 1305 * \sa ReadMainParameterFile Calling routine 1306 1306 */ 1307 int ParseForParameter(int verbose, FILE *file, const char *const name, int sequential, int const xth, int const yth, enum value_type type, void *value, int repetition, enum necessity critical) {1307 int ParseForParameter(int verbose, FILE *file, const char *const name, int sequential, int const xth, int const yth, enum value_type type, void *value, int repetition, enum necessity BreaksOrNot) { 1308 1308 int i,j; // loop variables 1309 1309 int me, length, maxlength = -1; … … 1326 1326 fgets(dummy1, 256, file); // Read the whole line 1327 1327 if (feof(file)) { 1328 if (( critical) && (found == 0)) {1328 if ((BreaksOrNot) && (found == 0)) { 1329 1329 Free(free_dummy, "ParseForParameter: free_dummy"); 1330 1330 Error(InitReading, name); … … 1369 1369 } else dummy = dummy1; 1370 1370 // ... and check if it is the keyword! 1371 if ((name == NULL) || ((dummy-dummy1 >= 3) && (strncmp(dummy1, name, strlen(name)) == 0) && ( dummy-dummy1== strlen(name)))) {1371 if ((name == NULL) || ((dummy-dummy1 >= 3) && (strncmp(dummy1, name, strlen(name)) == 0) && ((size_t)(dummy-dummy1) == strlen(name)))) { 1372 1372 found++; // found the parameter! 1373 1373 //fprintf(stderr,"(%i) found %s at line %i\n",me, name, line); … … 1381 1381 fgets(dummy1, 256, file); // Read the whole line, skip commentary and empty ones 1382 1382 if (feof(file)) { 1383 if (( critical) && (found == 0)) {1383 if ((BreaksOrNot) && (found == 0)) { 1384 1384 Free(free_dummy, "ParseForParameter: free_dummy"); 1385 1385 Error(InitReading, name); … … 1435 1435 dummy = strchr(dummy1, '\n'); // ... at line end then 1436 1436 if ((i < xth-1) && (type < 4)) { // check if xth value or not yet 1437 if ( critical) {1437 if (BreaksOrNot) { 1438 1438 if (verbose) fprintf(stderr,"(%i)Error: EoL or comment at %i and still missing %i value(s) for parameter %s\n", me, line, yth-j, name); 1439 1439 Free(free_dummy, "ParseForParameter: free_dummy");
Note:
See TracChangeset
for help on using the changeset viewer.
