Changeset 79290f for pcp/src/init.c


Ignore:
Timestamp:
Jun 7, 2008, 1:13:29 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
02bc3c
Parents:
a97897
Message:

config.h is included in each and every file. After trying to compile on JUMP (with xlc).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pcp/src/init.c

    ra97897 r79290f  
    2222*/
    2323
     24#ifdef HAVE_CONFIG_H
     25#include <config.h>
     26#endif
     27
    2428#include <stdlib.h>
    2529#include <stdio.h>
     
    2832
    2933// use double precision fft when we have it
    30 #ifdef HAVE_CONFIG_H
    31 #include <config.h>
    32 #endif
    33 
    3434#ifdef HAVE_DFFTW_H
    3535#include "dfftw.h"
     
    13051305 * \sa ReadMainParameterFile Calling routine
    13061306 */
    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) {
     1307int 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) {
    13081308        int i,j;        // loop variables
    13091309        int me, length, maxlength = -1;
     
    13261326                        fgets(dummy1, 256, file);       // Read the whole line
    13271327      if (feof(file)) {
    1328         if ((critical) && (found == 0)) {
     1328        if ((BreaksOrNot) && (found == 0)) {
    13291329          Free(free_dummy, "ParseForParameter: free_dummy");
    13301330          Error(InitReading, name);
     
    13691369                } else dummy = dummy1;
    13701370                // ... 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)))) {
    13721372                        found++; // found the parameter!
    13731373                        //fprintf(stderr,"(%i) found %s at line %i\n",me, name, line);         
     
    13811381                                                        fgets(dummy1, 256, file);       // Read the whole line, skip commentary and empty ones
    13821382              if (feof(file)) {
    1383                 if ((critical) && (found == 0)) {
     1383                if ((BreaksOrNot) && (found == 0)) {
    13841384                  Free(free_dummy, "ParseForParameter: free_dummy");
    13851385                  Error(InitReading, name);
     
    14351435                                                                dummy = strchr(dummy1, '\n');    // ... at line end then
    14361436                                                                if ((i < xth-1) && (type < 4)) {        // check if xth value or not yet
    1437                   if (critical) {
     1437                  if (BreaksOrNot) {
    14381438                    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);
    14391439                    Free(free_dummy, "ParseForParameter: free_dummy");
Note: See TracChangeset for help on using the changeset viewer.