From 278ef5360168c7eedc47b233648d4d12c4bd473c Mon Sep 17 00:00:00 2001 From: Dawid Jagiela Date: Sat, 26 May 2012 17:50:05 +0200 Subject: [PATCH] compinfo.c warning supresion --- source/cluster/wham/src-M/CMakeLists.txt | 4 ++-- source/unres/src_CSA/compinfo.c | 8 ++++---- source/unres/src_MD-M/compinfo.c | 8 ++++---- source/unres/src_MD/compinfo.c | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) 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"); -- 1.7.9.5