From: Dawid Jagiela Date: Sat, 26 May 2012 15:50:05 +0000 (+0200) Subject: compinfo.c warning supresion X-Git-Tag: v.3.2~103 X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?p=unres.git;a=commitdiff_plain;h=278ef5360168c7eedc47b233648d4d12c4bd473c compinfo.c warning supresion --- diff --git a/source/cluster/wham/src-M/CMakeLists.txt b/source/cluster/wham/src-M/CMakeLists.txt index 3926afb..cd8871c 100644 --- a/source/cluster/wham/src-M/CMakeLists.txt +++ b/source/cluster/wham/src-M/CMakeLists.txt @@ -62,9 +62,9 @@ set(UNRES_CLUSTER_WHAM_M_PP_SRC # Set comipiler flags for different sourcefiles #================================================ if (Fortran_COMPILER_NAME STREQUAL "ifort") - set(FFLAGS0 "-ip -w -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres " ) + set(FFLAGS0 "-ip -w -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres " ) + set(FFLAGS0 "-I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") # Add MPI compiler flags diff --git a/source/unres/src_CSA/compinfo.c b/source/unres/src_CSA/compinfo.c index 177dbd3..d20b2c9 100644 --- a/source/unres/src_CSA/compinfo.c +++ b/source/unres/src_CSA/compinfo.c @@ -14,10 +14,10 @@ time_t Tp; in=fopen("cinfo.f","r"); out=fopen("cinfo.f.new","w"); -fgets(buf,498,in); -fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); -fgets(buf,498,in); -sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); +if (fgets(buf,498,in) != NULL) + fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); +if (fgets(buf,498,in) != NULL) + sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); iv3++; fprintf(out,"C %d %d %d\n",iv1,iv2,iv3); fprintf(out," subroutine cinfo\n"); diff --git a/source/unres/src_MD-M/compinfo.c b/source/unres/src_MD-M/compinfo.c index 177dbd3..d20b2c9 100644 --- a/source/unres/src_MD-M/compinfo.c +++ b/source/unres/src_MD-M/compinfo.c @@ -14,10 +14,10 @@ time_t Tp; in=fopen("cinfo.f","r"); out=fopen("cinfo.f.new","w"); -fgets(buf,498,in); -fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); -fgets(buf,498,in); -sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); +if (fgets(buf,498,in) != NULL) + fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); +if (fgets(buf,498,in) != NULL) + sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); iv3++; fprintf(out,"C %d %d %d\n",iv1,iv2,iv3); fprintf(out," subroutine cinfo\n"); diff --git a/source/unres/src_MD/compinfo.c b/source/unres/src_MD/compinfo.c index 177dbd3..d20b2c9 100644 --- a/source/unres/src_MD/compinfo.c +++ b/source/unres/src_MD/compinfo.c @@ -14,10 +14,10 @@ time_t Tp; in=fopen("cinfo.f","r"); out=fopen("cinfo.f.new","w"); -fgets(buf,498,in); -fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); -fgets(buf,498,in); -sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); +if (fgets(buf,498,in) != NULL) + fprintf(out,"C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C\n"); +if (fgets(buf,498,in) != NULL) + sscanf(&buf[1],"%d %d %d",&iv1,&iv2,&iv3); iv3++; fprintf(out,"C %d %d %d\n",iv1,iv2,iv3); fprintf(out," subroutine cinfo\n");