Fix most errors found by cppcheck
authorRoland Schulz <roland@utk.edu>
Sun, 11 Mar 2012 03:26:39 +0000 (22:26 -0500)
committerRoland Schulz <roland@utk.edu>
Thu, 15 Mar 2012 17:04:18 +0000 (13:04 -0400)
While some are only style issues (e.g. include "" instead of <>),
it includes a couple of real bugs.
- Not correct handling of '\0' termination of string
- assignment in if statement
- using of variable before checking that it isn't null

Warnings from a couple of non-critical categories aren't fixed.

To run cppcheck (tested with latest 1.53):
cppcheck -j8 `find src -name '*.c' -o -name '*.cpp' -o -name '*.cu'` \
   -DHAVE_CONFIG_H -DSIZEOF_LONG_LONG_INT=8 -DSIZEOF_INT=4 -DLINUX -I include \
  --enable=style \
  --suppress=variableScope --suppress=unusedVariable --suppress=unreadVariable \
  --suppress=invalidscanf --suppress=unusedStructMember --suppress=sizeofCalculation \
  --suppress=unnecessaryForwardDeclaration --suppress=*:src/gmxlib/gmx_lapack/* \
  --suppress=*:src/contrib/*  --suppress=missingInclude \
  --template gcc  --inline-suppr

Change-Id: I1eabfce3e6cf8a6bed0f1282868667e290159279

78 files changed:
include/types/simple.h
src/gmxlib/confio.c
src/gmxlib/copyrite.c
src/gmxlib/futil_test.c [deleted file]
src/gmxlib/maths.c
src/gmxlib/md5.c
src/gmxlib/network.c
src/gmxlib/nonbonded/nb_kernel_bluegene/nb_kernel_gen_bluegene.h
src/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel430_sse2_double.c
src/gmxlib/pdbio.c
src/gmxlib/splitter.c
src/gmxlib/statutil.c
src/gmxlib/string2.c
src/gmxlib/thread_mpi/p2p_send_recv.c
src/gmxlib/vmdio.c
src/gmxlib/wman.c
src/kernel/g_luck.c
src/kernel/g_x2top.c
src/kernel/gmx_gpu_utils/memtestG80_core.cu
src/kernel/gmx_gpu_utils/memtestG80_core.h
src/kernel/gmxcheck.c
src/kernel/gmxdump.c
src/kernel/md_openmm.c
src/kernel/mk_ghat.c
src/kernel/openmm_wrapper.cpp
src/kernel/pdb2top.c
src/kernel/pgutil.c
src/kernel/readpull.c
src/kernel/readrot.c
src/kernel/xmdrun.h
src/kernel/xutils.c
src/mdlib/domdec.c
src/mdlib/edsam.c
src/mdlib/fft5d.c
src/mdlib/forcerec.c
src/mdlib/pull.c
src/mdlib/sim_util.c
src/mdlib/tables.c
src/mdlib/wnblist.c
src/ngmx/dialogs.c
src/ngmx/molps.c
src/ngmx/nener.c [deleted file]
src/ngmx/nener.h [deleted file]
src/ngmx/nload.c [deleted file]
src/ngmx/nload.h [deleted file]
src/ngmx/nmol.c
src/ngmx/x11.c
src/tools/gmx_chi.c
src/tools/gmx_confrms.c
src/tools/gmx_current.c
src/tools/gmx_density.c
src/tools/gmx_densorder.c
src/tools/gmx_dist.c
src/tools/gmx_dos.c
src/tools/gmx_genbox.c
src/tools/gmx_genpr.c
src/tools/gmx_h2order.c
src/tools/gmx_hbond.c
src/tools/gmx_helix.c
src/tools/gmx_helixorient.c
src/tools/gmx_hydorder.c
src/tools/gmx_mindist.c
src/tools/gmx_order.c
src/tools/gmx_potential.c
src/tools/gmx_rama.c
src/tools/gmx_relax.c
src/tools/gmx_rms.c
src/tools/gmx_rmsf.c
src/tools/gmx_sas.c
src/tools/gmx_sgangle.c
src/tools/gmx_spatial.c
src/tools/gmx_tcaf.c
src/tools/gmx_traj.c
src/tools/gmx_trjcat.c
src/tools/gmx_trjconv.c
src/tools/gmx_velacc.c
src/tools/pinput.c [deleted file]
src/tools/pinput.h [deleted file]

index 8279e135de40bb9c91bd7bef93d9318e63c67a55..63031a98e0b1fcff823c4cffd81ba92b698ef897 100644 (file)
@@ -166,7 +166,7 @@ typedef int             imatrix[DIM][DIM];
  * Instead, start by looking for "long long", and just go down if we
  * have to (rarely on new systems). /EL 20100810
  */
-#if ( (defined LLONG_MAX && LLONG_MAX==9223372036854775807LL) || (defined SIZEOF_LONG_LONG_INT && SIZEOF_LONG_LONG_INT==8) )
+#if ( (defined SIZEOF_LONG_LONG_INT && SIZEOF_LONG_LONG_INT==8) || (defined LLONG_MAX && LLONG_MAX==9223372036854775807LL) )
 
 /* Long long int is 64 bit */
 typedef long long int gmx_large_int_t;
@@ -177,7 +177,7 @@ typedef long long int gmx_large_int_t;
 #define GMX_LARGE_INT_MIN     (-GMX_LARGE_INT_MAX - 1LL)
 #define GMX_MPI_LARGE_INT MPI_LONG_LONG_INT
 
-#elif ( (defined LONG_MAX && LONG_MAX==9223372036854775807L) || (defined SIZEOF_LONG_INT && SIZEOF_LONG_INT==8) )
+#elif ( (defined SIZEOF_LONG_INT && SIZEOF_LONG_INT==8) || (defined LONG_MAX && LONG_MAX==9223372036854775807L) )
 
 /* Long int is 64 bit */
 typedef long int gmx_large_int_t;
@@ -188,7 +188,7 @@ typedef long int gmx_large_int_t;
 #define GMX_LARGE_INT_MIN     (-GMX_LARGE_INT_MAX - 1LL)
 #define GMX_MPI_LARGE_INT MPI_LONG_INT
 
-#elif ( (defined INT_MAX && INT_MAX==9223372036854775807L) || (defined SIZEOF_INT && SIZEOF_INT==8) )
+#elif ( (defined SIZEOF_INT && SIZEOF_INT==8) || (defined INT_MAX && INT_MAX==9223372036854775807L) )
 
 /* int is 64 bit */
 typedef int gmx_large_int_t;
index 2acf638dbd89d07da7dbb0e7095d8ea912086f36..07af6413c89d85123398be87b787c09baa35921b 100644 (file)
@@ -41,7 +41,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "sysstuff.h"
-#include "errno.h"
+#include <errno.h>
 #include "macros.h"
 #include "string2.h"
 #include "confio.h"
@@ -98,7 +98,7 @@ static int read_g96_pos(char line[],t_symtab *symtab,
                      "Found more coordinates (%d) in %s than expected %d\n",
                      natoms,infile,nwanted);
        if (atoms) {
-         if (atoms && fr->bAtoms &&
+         if (fr->bAtoms &&
              (sscanf(line,"%5d%c%5s%c%5s%7d",&resnr,&c1,resnm,&c2,anm,&atnr) 
               != 6)) {
            if (oldres>=0)
index da538eac1dc5984137f1a26dd931dfda7c9e530e..e720b8faf95a7ea6859dd7708f6a6d84776da956 100644 (file)
@@ -48,7 +48,7 @@
 #include "smalloc.h"
 #include "string2.h"
 #include "macros.h"
-#include "time.h"
+#include <time.h>
 #include "random.h"
 #include "statutil.h"
 #include "copyrite.h"
diff --git a/src/gmxlib/futil_test.c b/src/gmxlib/futil_test.c
deleted file mode 100644 (file)
index a3df6ca..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#error XXXXXXX
-
index 81e49aae4a86685c5854b2fd51eadb69f551c32b..24d66798b405e365a46229f26ed2175008b4e35c 100644 (file)
@@ -89,7 +89,7 @@ real sign(real x,real y)
  * ====================================================
  */
 
-#if (INT_MAX == 2147483647)
+#if ( (defined SIZEOF_INT && SIZEOF_INT==4) || (SIZEOF_INT_MAX == 2147483647) )
    typedef int erf_int32_t;
    typedef unsigned int erf_u_int32_t;
 #elif (LONG_MAX == 2147483647L)
index 5c83dfcdcba096963e8da7bbb68a6fd11e60a343..ce195bee2e14ef8c9db688b27b62eafbec6046ec 100644 (file)
@@ -183,6 +183,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
 #else
     /* Define storage for little-endian or both types of CPUs. */
     md5_word_t xbuf[16];
+    /* cppcheck-suppress unassignedVariable */
     const md5_word_t *X;
 #endif
 
index f711b32f7b8c5b8ad711b6b964d0cdcd87fb9c78..91517dbf11fe903df91a50640648b6891688c874 100644 (file)
@@ -43,7 +43,7 @@
 #include "network.h"
 #include "copyrite.h"
 #include "statutil.h"
-#include "ctype.h"
+#include <ctype.h>
 #include "macros.h"
 
 #ifdef GMX_LIB_MPI
index a8cdc3440fa00cf7deccdd3859f5eac6108fbb5c..744135cd2116d40724d0661e6ecb277d9d1b0711 100644 (file)
@@ -326,6 +326,7 @@ void NB_KERNEL (
             _rinv  = sqrt_newton_scalar(_rinv,_rsq);
 
 #endif
+        /* cppcheck-suppress selfAssignment */
            FULL_INTERACTION_(_qq,_rinv,_rsq,jnr);
 
 #ifndef NO_FORCE
index 2df2ed04c32857d9fe973dabe5cfdb941c071fce..8e3ce2c0d3cd54daaa3480ade3f82b2e333da989 100644 (file)
@@ -26,7 +26,7 @@
 /* get gmx_gbdata_t */
 #include "../nb_kerneltype.h"
 
-#include "nb_kernel430_x86_64_sse2.h"
+#include "../nb_kernel_x86_64_sse2/nb_kernel430_x86_64_sse2.h"
 
 void nb_kernel430_sse2_double(int *           p_nri,
                               int *           iinr,
index 33fb2078a0a51769ac5108bd33c4954bb080b070..d134f62860106c8bc078ca06a5eb5b5cc2a930bf 100644 (file)
@@ -749,8 +749,8 @@ int read_pdbfile(FILE *in,char *title,int *model_nr,
                 {
                     c=line+6;
                     /* skip HEADER or TITLE and spaces */
-                    while (c && (c[0]!=' ')) c++;
-                    while (c && (c[0]==' ')) c++;
+                    while (c[0]!=' ') c++;
+                    while (c[0]==' ') c++;
                     /* truncate after title */
                     d=strstr(c,"      ");
                     if (d) 
@@ -772,8 +772,8 @@ int read_pdbfile(FILE *in,char *title,int *model_nr,
                         c=line;
                     }
                     /* skip 'MOLECULE:' and spaces */
-                    while (c && (c[0]!=' ')) c++;
-                    while (c && (c[0]==' ')) c++;
+                    while (c[0]!=' ') c++;
+                    while (c[0]==' ') c++;
                     /* truncate after title */
                     d=strstr(c,"   ");
                     if (d) 
index 791ec16c68975a1058ae2fdfb7fe5c4c47323bd6..de954fbc059a7c2b0f36592af12477190c0367b0 100644 (file)
@@ -47,7 +47,7 @@
 #include "mshift.h"
 #include "invblock.h"
 #include "txtdump.h"
-#include "math.h"
+#include <math.h>
 #include "assert.h"
 #include "gmx_fatal.h"
 #include "splitter.h"
index 5284428df77ae2b70191c61a8a86192b3f3b84aa..589cbea166dc821402331289478b248c5e2928de 100644 (file)
@@ -252,7 +252,7 @@ int check_times(real t)
 
 static void set_default_time_unit(const char *time_list[], gmx_bool bCanTime)
 {
-    int i,j;
+    int i=0,j;
     const char *select;
 
     if (bCanTime)
index ce6f341905e4967c01c67c2b0ecbb2ed4dadf539..df937a7a08ca355b908bac4e1fd9b62b3d7baff5 100644 (file)
@@ -195,10 +195,10 @@ void nice_header (FILE *out,const char *fn)
 {
   const char *unk = "onbekend";
   time_t clock;
-  char   *user=NULL;
+  const char *user=unk;
   int    gh;
   uid_t  uid;
-  char   buf[256];
+  char   buf[256]="";
   char   timebuf[STRLEN];
 #ifdef HAVE_PWD_H
   struct passwd *pw;
index 4b0c340aabf45b1b8777559201e0cbfd96a1c9b5..3f1f5aa2da8ea9f365d7ba33a28b8abce51f9033 100644 (file)
@@ -65,7 +65,7 @@ int tMPI_Send(void* buf, int count, tMPI_Datatype datatype, int dest,
               int tag, tMPI_Comm comm)
 {
     struct envelope *sev;
-    struct tmpi_thread *send_dst=tMPI_Get_thread(comm, dest);
+    struct tmpi_thread *send_dst;
     struct tmpi_thread *cur=tMPI_Get_current();
     struct tmpi_req_ req;
 
@@ -80,6 +80,7 @@ int tMPI_Send(void* buf, int count, tMPI_Datatype datatype, int dest,
     {
         return tMPI_Error(TMPI_COMM_WORLD, TMPI_ERR_COMM);
     }
+    send_dst = tMPI_Get_thread(comm, dest);
     if (!send_dst)
     {
         return tMPI_Error(comm, TMPI_ERR_SEND_DEST);
@@ -151,7 +152,7 @@ int tMPI_Sendrecv(void *sendbuf, int sendcount, tMPI_Datatype sendtype,
     struct envelope *rev, *sev;
     struct tmpi_thread *cur=tMPI_Get_current();
     struct tmpi_thread *recv_src=0;
-    struct tmpi_thread *send_dst=tMPI_Get_thread(comm, dest);
+    struct tmpi_thread *send_dst;
     struct tmpi_req_ sreq, rreq;
     int ret=TMPI_SUCCESS;
 
@@ -167,6 +168,7 @@ int tMPI_Sendrecv(void *sendbuf, int sendcount, tMPI_Datatype sendtype,
     {
         return tMPI_Error(TMPI_COMM_WORLD, TMPI_ERR_COMM);
     }
+    send_dst=tMPI_Get_thread(comm, dest);
     if (!send_dst)
     {
         return tMPI_Error(comm, TMPI_ERR_SEND_DEST); 
@@ -227,7 +229,7 @@ int tMPI_Isend(void* buf, int count, tMPI_Datatype datatype, int dest,
     struct tmpi_thread *cur=tMPI_Get_current();
     struct req_list *rql=&(cur->rql);
     struct tmpi_req_ *rq=tMPI_Get_req(rql);
-    struct tmpi_thread *send_dst=tMPI_Get_thread(comm, dest);
+    struct tmpi_thread *send_dst;
     struct envelope *ev;
 
 #ifdef TMPI_PROFILE
@@ -242,6 +244,7 @@ int tMPI_Isend(void* buf, int count, tMPI_Datatype datatype, int dest,
         tMPI_Return_req(rql,rq);
         return tMPI_Error(TMPI_COMM_WORLD, TMPI_ERR_COMM);
     }
+    send_dst=tMPI_Get_thread(comm, dest);
     if (!send_dst)
     {
         tMPI_Return_req(rql,rq);
index a16cf5fab46eaa7a08089897b7535d808d6b1bf4..9b4a1f1b2698ee0828a90dd1c7ef88d7079d7f23 100644 (file)
@@ -79,7 +79,7 @@ OTHER DEALINGS WITH THE SOFTWARE.
 #include "molfile_plugin.h"
 #include "vmddlopen.h"
 #if !((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
-#include "glob.h"
+#include <glob.h>
 #else
 #include <windows.h>
 #include <shlobj.h>
index 4c51f10a80cdea832bc640db35d9bccac44394be..da4b42aa7bedaa9a69b7dee75f8791f360e53f98 100644 (file)
@@ -46,7 +46,7 @@
 #include "statutil.h"
 #include "copyrite.h"
 #include "strdb.h"
-#include "time.h"
+#include <time.h>
 #include "readinp.h"
 
 /* The source code in this file should be thread-safe. 
index 0b9aca37da7c9edd7bdcb54881f39f9167138490..b8aba8d4a792ddef79031db5d89ed45aa6df2136 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <stdio.h>
 #include "copyrite.h"
-#include "string.h"
+#include <string.h>
 #include "statutil.h"
 
 int main(int argc,char *argv[])
index cdac5a0ffa31e2ae95f916c2b69891525037a888..ca62e06b5a2b275107f08883b2677cfff207c1c9 100644 (file)
@@ -565,6 +565,7 @@ int main(int argc, char *argv[])
     dump_hybridization(debug,atoms,nbonds);
   }
   close_symtab(&symtab);
+  free(mymol.name);
 
   printf("\nWARNING: topologies generated by %s can not be trusted at face value.\n",Program());
   printf("         Please verify atomtypes and charges by comparison to other\n");
index de8ad85d963f8c24f224c935316c488b7982357f..2a4c6067133480db7a18d2d9429a79f896bfeec7 100644 (file)
@@ -65,7 +65,7 @@ uint memtestState::allocate(uint mbToTest) {
                        if (cudaMalloc((void**)&devTestMem,megsToTest*1048576UL) != cudaSuccess) throw 1;
                        if (cudaMalloc((void**)&devTempMem,sizeof(uint)*nBlocks) != cudaSuccess) throw 2;
                        if ( (hostTempMem = (uint*)malloc(sizeof(uint)*nBlocks)) == NULL) throw 3;
-               } catch (int allocFailed) {
+               } catch (...) {
             // Clear CUDA error flag for outside world
             cudaGetLastError();
                        if (devTempMem) {
index 44ef0d8ec6d716ad81da2a7a63582732f603f35a..079a67fcb5cb77debeab3f68cbf8890f22cc09d3 100644 (file)
@@ -75,7 +75,7 @@ protected:
        bool allocated;
 public:
     uint initTime;
-       memtestState() : nBlocks(1024), nThreads(512), allocated(false), devTestMem(NULL),devTempMem(NULL),hostTempMem(NULL), initTime(0),lcgPeriod(1024) {};
+    memtestState() : nBlocks(1024), nThreads(512), loopIters(0), megsToTest(0), allocated(false), devTestMem(NULL),devTempMem(NULL),hostTempMem(NULL), initTime(0),lcgPeriod(1024) {};
     ~memtestState() {deallocate();}
 
        uint allocate(uint mbToTest);
index f3efce54f1050f6e27015cba4206bd84339536ac..8dc415a6ef1c07670056e497fe80d68a7dd282d3 100644 (file)
@@ -41,7 +41,7 @@
 #include <ctype.h>
 #include "main.h"
 #include "macros.h"
-#include "math.h"
+#include <math.h>
 #include "futil.h"
 #include "statutil.h"
 #include "copyrite.h"
@@ -519,7 +519,7 @@ void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
 void chk_ndx(const char *fn)
 {
   t_blocka *grps;
-  char **grpname=NULL;
+  char **grpname;
   int  i,j;
   
   grps = init_index(fn,&grpname);
index 4e99088d8415146d18e2c0c5396eea21c3565533..8540b6e6066bbb645f5e740150741da05a96d91a 100644 (file)
@@ -320,7 +320,7 @@ void list_ene(const char *fn)
     int        ndr;
     ener_file_t in;
     gmx_bool       bCont;
-    gmx_enxnm_t *enm=NULL;
+    gmx_enxnm_t *enm;
     t_enxframe *fr;
     int        i,j,nre,b;
     real       rav,minthird;
index 810c2b7ba5431a8c05202669b1fab0b98b453ba1..a4c2f2ee54b15dd1fa2bcb2fcca17cb8e6a2f095 100644 (file)
@@ -131,7 +131,7 @@ double do_md_openmm(FILE *fplog,t_commrec *cr,int nfile,const t_filenm fnm[],
     t_vcm      *vcm;
     int        nchkpt=1;
     gmx_localtop_t *top;
-    t_mdebin *mdebin=NULL;
+    t_mdebin *mdebin;
     t_state    *state=NULL;
     rvec       *f_global=NULL;
     int        n_xtc=-1;
index 802d0211571bffd5dca305c4de404d38c84091d0..46c007a03efddd05ef003448110208e5ac49ca77 100644 (file)
@@ -294,54 +294,6 @@ real  ursum(int term,int porder,real acut,real r1,
   return urs;
 }
  
-real  ursum1D(int term,int porder,real acut,real r1,real k1,real h1,int nalias)
-{
-  real kt,ksq,kmag;
-/*   real kcutsq; */
-  real kn1,urs,tmp;
-  real h_1;
-  int  n1;
-
-  real twopi=2*M_PI;
-  h_1=twopi/h1;
-  /*
-    c
-    c     for large enough values of k, the terms become negligable
-    c     if shat(k) = exp(-k^2/4*acut) < eps
-    c     kcutsq = 4*alpha* (-ln(eps))
-    c     eps = 10^-6, -ln(eps) = 14
-    c     eps = 10^-10, -ln(eps) = 23
-    c     eps = 10^-20, -ln(eps) = 46
-    c
-    */
-/*   kcutsq = 4.0*acut*115; */
-
-  if (nalias==0) {
-    if (term==1) kt = k1;
-    ksq = k1*k1;
-    kmag = sqrt(ksq);
-    tmp = uhat1D(porder,k1,h1);
-    urs = tmp*tmp*kt*shat(acut,kmag,r1)/(EPSILON0*ksq);
-  }
-  else {
-    urs = 0.0;
-    for(n1 = -nalias; (n1<= nalias); n1++) {
-      kn1 = k1 + n1*h_1;
-      ksq = kn1*kn1;
-      /*c              if (ksq.lt.kcutsq) then*/
-      if (term==XX) kt = kn1;
-      if (kt != 0.0) {
-       kmag = sqrt(ksq);
-       tmp = uhat1D(porder,kn1,h1);
-       if (tmp != 0.0)
-         urs = urs + tmp*tmp*kt*shat(acut,kmag,r1)/(EPSILON0*ksq);
-      }
-      /*c              endif*/
-    }
-  }
-  return urs;
-}
 real sym(int indx,int maxind)
 {
   if ( (indx == 0 ) || (indx == maxind/2) ) 
@@ -465,81 +417,6 @@ void calc(gmx_bool bSym,gmx_bool bVerbose,
   *qqopt = qopt/(EPSILON0*box1*box2*box3);
 }
 
-void calc1D(gmx_bool bSym,gmx_bool bVerbose,
-           const int n1max,const int n2max,const int n3max,
-           const real h1,const real h2,const real h3,
-           int nalias,int porder,real acut,real r1,const real alpha,
-           const gmx_bool bSearch,
-           real ***ghat,real *ppval,real *zzval,real *eeref,real *qqopt)
-{     
-  real box1,box2,box3;
-  real k1,k2,k3;
-  real gnumer,dsq,gdenom;
-  real rsqal;
-  real symfac;
-  int  l1;
-  real twopi=2*M_PI;
-  real d1,u1;
-  real pval,zval,eref,qopt;
-  int  N1MAX;
-/*   int  N2MAX,N3MAX; */
-  
-  if (bSym) {
-    N1MAX = n1max/2+1;
-/*     N2MAX = n2max/2+1; */
-/*     N3MAX = n3max/2+1; */
-  }
-  else {
-    N1MAX = n1max;
-/*     N2MAX = n2max; */
-/*     N3MAX = n3max; */
-  }
-    
-  box1 = n1max*h1;
-  box2 = n2max*h2;
-  box3 = n3max*h3;
-
-  pval = 0.0;
-  zval = 0.0;
-  eref = 0.0;
-  qopt = 0.0;
-
-  k2 = k3 = 0;
-  
-  for(l1=0; (l1<N1MAX); l1++) {
-    if (bVerbose)
-      fprintf(stderr,"\rl1=%5d  qopt=%12.6e",l1,qopt);
-      
-    k1   = twopi*l1/box1;
-    d1   = dhat(alpha,k1,h1);
-    
-    if (l1 == 0) 
-      ghat[0][0][0] = 0.0;
-    else {
-      u1   = ursum1D(XX,porder,acut,r1,k1,h1,nalias);
-         
-      gnumer = d1*u1;
-      dsq    = d1*d1;
-      gdenom = dsq*usqsq(porder,k1,k2,k3,h1,h2,h3);
-      if (bSym)
-       symfac = sym(l1,n1max);
-      else
-       symfac = 1.0;
-      
-      rsqal  = crsqal(acut,r1,k1,k2,k3,h1,h2,h3,nalias);
-      
-      if (gdenom != 0)   
-       qopt  += symfac*(rsqal - (gnumer*gnumer)/gdenom);
-    }
-  }
-  if (bVerbose)
-    fprintf(stderr,"\n");
-  *ppval = pval/(box1*box2*box3);
-  *zzval = zval/(box1*box2*box3);
-  *eeref = eref/(box1*box2*box3);
-  *qqopt = qopt/(box1*box2*box3);
-}
-
 void read_params(char *fn,t_inputrec *ir,rvec boxs)
 {
   real   t,lambda;
index 051a13a704fa9bdde6be55cabdc429b35516dedb..a03760817cdbeedd8fc0f705a86e5b306487095c 100644 (file)
@@ -783,7 +783,7 @@ void* openmm_init(FILE *fplog, const char *platformOptStr,
             if (pluginDir != NULL && *pluginDir != '\0')
             {
                 loadedPlugins = Platform::loadPluginsFromDirectory(pluginDir);
-                if (loadedPlugins.size() > 0)
+                if (!loadedPlugins.empty())
                 {
                     hasLoadedPlugins = true;
                     usedPluginDir = pluginDir;
@@ -801,7 +801,7 @@ void* openmm_init(FILE *fplog, const char *platformOptStr,
             if (!hasLoadedPlugins)
             {
                 loadedPlugins = Platform::loadPluginsFromDirectory(OPENMM_PLUGIN_DIR);
-                if (loadedPlugins.size() > 0)
+                if (!loadedPlugins.empty())
                 {
                     hasLoadedPlugins = true;
                     usedPluginDir = OPENMM_PLUGIN_DIR;
@@ -812,7 +812,7 @@ void* openmm_init(FILE *fplog, const char *platformOptStr,
             if (!hasLoadedPlugins)
             {
                 loadedPlugins = Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
-                if (loadedPlugins.size() > 0)
+                if (!loadedPlugins.empty())
                 {
                     hasLoadedPlugins = true;
                     usedPluginDir = Platform::getDefaultPluginsDirectory();
index 5169ffefd17a4132e27586e41081d4276809dfc2..091d2abff8428312235ae2167bbfbb19b0e97f5f 100644 (file)
@@ -553,6 +553,7 @@ void print_top_comment(FILE *out,
   else
   {
       strncpy(ffdir_parent,ffdir,STRLEN-1);
+      ffdir_parent[STRLEN-1]='\0'; /*make sure it is 0-terminated even for long string*/
       p=strrchr(ffdir_parent,'/');
 
       *p='\0';
index 7a3e7d86818beb272b4a08cd946016726a58bdb6..337c8fb21c0ef5658785f32b5932afe06835e1ae 100644 (file)
@@ -39,7 +39,7 @@
 #endif
 #include "string2.h"
 #include "pgutil.h"
-#include "string.h"
+#include <string.h>
 #include "gmx_fatal.h"
 
 #define BUFSIZE 1024
index 7e623fbfcacfc9e53c7f4263aa98ce55116d87ba..f7092de28ace93fdd995ea0a980a15031193c4d1 100644 (file)
@@ -52,7 +52,7 @@
 #include "symtab.h"
 #include "readinp.h"
 #include "readir.h"
-#include "string.h"
+#include <string.h>
 #include "mdatoms.h"
 #include "pbc.h"
 #include "pull.h"
index a660188641afbbd4f78d0d6bf34cee69269914bd..eb8644418e0db3c5b9b37101ac1b1fbf4dcabb53 100644 (file)
@@ -231,6 +231,7 @@ extern void set_reference_positions(
     
     /* Base name and extension of the reference file: */
     strncpy(base, fn, STRLEN - 1);
+    base[STRLEN-1]='\0';
     extpos = strrchr(base, '.');
     strcpy(extension,extpos+1);
     *extpos = '\0';
index c8ce25b44f35107adf4884c1a93c204ee1489fd1..5470ff97939a13661cfd3db9e284f36112ff1734 100644 (file)
@@ -47,7 +47,7 @@
 #include "filenm.h"
 #include "mshift.h"
 #include "force.h"
-#include "time.h"
+#include <time.h>
 #include "edsam.h"
 #include "mdebin.h"
 #include "vcm.h"
index e374c5d263fe3d1b2d753836a77235a409095666..aa7fa23f702fc6038ec8ad0c8668161d9dda2224 100644 (file)
@@ -135,7 +135,7 @@ static void init_range(t_range *r,int np,int atype,int ptype,
 static t_range *read_range(const char *db,int *nrange)
 {
   int     nlines,nr,np,i;
-  char    **lines=NULL;
+  char    **lines;
   t_range *range;
   int     atype,ptype;
   double  rmin,rmax;
index 961ad66596709d65420fca651db9294e9c129409..cb2afde9b4c9dc53f43419535471e167fcc141fa 100644 (file)
@@ -1858,7 +1858,7 @@ static void write_dd_grid_pdb(const char *fn,gmx_large_int_t step,
                 }
                 else
                 {
-                    if (dd->nc[d] > 1 && d < ddbox->npbcdim)
+                    if (d < ddbox->npbcdim && dd->nc[d] > 1)
                     {
                         tric[d][i] = box[i][d]/box[i][i];
                     }
index 8359863d3b2081edc924c8c267fe3b0b61a3ba36..3a0b21dc91703b83aeb11cf58af22e4d6c7f2f09 100644 (file)
@@ -46,7 +46,7 @@
 #include "mvdata.h"
 #include "txtdump.h"
 #include "vec.h"
-#include "time.h"
+#include <time.h>
 #include "nrnb.h"
 #include "mshift.h"
 #include "mdrun.h"
index 50e2abad6f8f5581a1b1193d692d410c65659930..82a0ba7c5133ba16604272f8c4fc5e5433ef9558 100644 (file)
@@ -67,6 +67,7 @@
 #include <float.h>
 #include <math.h>
 #include <assert.h>
+#include "smalloc.h"
 
 #ifndef __FLT_EPSILON__
 #define __FLT_EPSILON__ FLT_EPSILON
@@ -146,35 +147,6 @@ static int vmax(int* a, int s) {
     return max;
 } 
 
-/*
-copied here from fftgrid, because:
-1. function there not publically available
-2. not sure whether we keep fftgrid
-3. less dependencies for fft5d
-
-Only used for non-fftw case
-*/
-static void *
-gmx_calloc_aligned(size_t size)
-{
-    void *p0,*p;
-    
-    /*We initialize by zero for Valgrind
-      For non-divisible case we communicate more than the data.
-      If we don't initialize the data we communicate uninitialized data*/
-    p0 = calloc(size+32,1);  
-    
-    if(p0 == NULL)
-    {
-        gmx_fatal(FARGS,"Failed to allocated %u bytes of aligned memory.",size+32);
-    }
-    
-    p = (void *) (((size_t) p0 + 32) & (~((size_t) 31)));
-    
-    /* Yeah, yeah, we cannot free this pointer, but who cares... */
-    return p;
-}
-
 
 /* NxMxK the size of the data
  * comm communicator to use for fft5d
@@ -404,10 +376,10 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_
     lsize = fft5d_fmax(N[0]*M[0]*K[0]*nP[0],fft5d_fmax(N[1]*M[1]*K[1]*nP[1],C[2]*M[2]*K[2])); 
     /* int lsize = fmax(C[0]*M[0]*K[0],fmax(C[1]*M[1]*K[1],C[2]*M[2]*K[2])); */
     if (!(flags&FFT5D_NOMALLOC)) { 
-        lin = (t_complex*)gmx_calloc_aligned(sizeof(t_complex) * lsize);   
-        lout = (t_complex*)gmx_calloc_aligned(sizeof(t_complex) * lsize); 
-        lout2 = (t_complex*)gmx_calloc_aligned(sizeof(t_complex) * lsize);
-        lout3 = (t_complex*)gmx_calloc_aligned(sizeof(t_complex) * lsize);
+        snew_aligned(lin, lsize, 32);
+        snew_aligned(lout, lsize, 32);
+        snew_aligned(lout2, lsize, 32);
+        snew_aligned(lout3, lsize, 32);
     } else {
         lin = *rlin;
         lout = *rlout;
@@ -1159,8 +1131,13 @@ void fft5d_destroy(fft5d_plan plan) {
 #endif /* FFT5D_MPI_TRANSPOS */
 #endif /* GMX_FFT_FFTW3 */
 
-    /*We can't free lin/lout here - is allocated by gmx_calloc_aligned which can't be freed*/
-
+    if (!(plan->flags&FFT5D_NOMALLOC))
+    {
+        sfree_aligned(plan->lin);
+        sfree_aligned(plan->lout);
+        sfree_aligned(plan->lout2);
+        sfree_aligned(plan->lout3);
+    }
     
 #ifdef FFT5D_THREADS
 #ifdef FFT5D_FFTW_THREADS
index 967c4a4ffdbc53dbe1622abebb67b3890ffb5d0e..0136396fe66a2a912d3efeb7108a39711a0d7c9b 100644 (file)
@@ -1022,7 +1022,6 @@ static void make_nbf_tables(FILE *fp,const output_env_t oenv,
 {
   char buf[STRLEN];
   int i,j;
-  void *      p_tmp;
 
   if (tabfn == NULL) {
     if (debug)
@@ -1048,18 +1047,8 @@ static void make_nbf_tables(FILE *fp,const output_env_t oenv,
    * to do this...
    */
   
-  /* 8 fp entries per vdw table point, n+1 points, and 16 bytes extra to align it. */
-  p_tmp = malloc(8*(nbl->tab.n+1)*sizeof(real)+16);
-  
-  /* align it - size_t has the same same as a pointer */
-  nbl->vdwtab = (real *) (((size_t) p_tmp + 16) & (~((size_t) 15)));  
-
-  /* 4 fp entries per coul table point, n+1 points, and 16 bytes extra to align it. */
-  p_tmp = malloc(4*(nbl->tab.n+1)*sizeof(real)+16);
-  
-  /* align it - size_t has the same same as a pointer */
-  nbl->coultab = (real *) (((size_t) p_tmp + 16) & (~((size_t) 15)));  
-
+  snew_aligned(nbl->vdwtab,8*nbl->tab.n,16);
+  snew_aligned(nbl->coultab,4*nbl->tab.n,16);
   
   for(i=0; i<=nbl->tab.n; i++) {
     for(j=0; j<4; j++)
index 2d4db43a422bd253c731d28a2978402c408e77b7..e5f0c1ec763e1cf817ad250e31f59f4bd350a4c0 100644 (file)
@@ -49,7 +49,7 @@
 #include "typedefs.h"
 #include "network.h"
 #include "filenm.h"
-#include "string.h"
+#include <string.h>
 #include "smalloc.h"
 #include "pull.h"
 #include "xvgr.h"
index 830ff9538b3828e56bcaef8d96194d6a306fa3f4..57523b5ba62519402e9e5dc10beff5da6c811f34 100644 (file)
@@ -59,7 +59,7 @@
 #include "pbc.h"
 #include "chargegroup.h"
 #include "vec.h"
-#include "time.h"
+#include <time.h>
 #include "nrnb.h"
 #include "mshift.h"
 #include "mdrun.h"
index eb316c8e9f2fce02376a8aa3ff815d5d0e556691..81889aa04282decec221d1f7a69db9b33cfb22af 100644 (file)
@@ -980,7 +980,6 @@ t_forcetable make_gb_table(FILE *out,const output_env_t oenv,
        gmx_bool        bReadTab,bGenTab;
        real        x0,y0,yp;
        int         i,j,k,nx,nx0,tabsel[etiNR];
-       void *      p_tmp;
        double      r,r2,Vtab,Ftab,expterm;
        
        t_forcetable table;
@@ -1025,12 +1024,7 @@ t_forcetable make_gb_table(FILE *out,const output_env_t oenv,
         * to do this :-)
         */
        
-       /* 4 fp entries per table point, nx+1 points, and 16 bytes extra 
-           to align it. */
-       p_tmp = malloc(4*(nx+1)*sizeof(real)+16);
-       
-       /* align it - size_t has the same same as a pointer */
-       table.tab = (real *) (((size_t) p_tmp + 16) & (~((size_t) 15)));  
+       snew_aligned(table.tab,4*nx,16);
        
        init_table(out,nx,nx0,table.scale,&(td[0]),!bReadTab);
        
@@ -1133,7 +1127,6 @@ t_forcetable make_atf_table(FILE *out,const output_env_t oenv,
        t_tabledata *td;
        real        x0,y0,yp,rtab;
        int         i,nx,nx0;
-       void *      p_tmp;
         real        rx, ry, rz, box_r;
        
        t_forcetable table;
@@ -1191,12 +1184,7 @@ t_forcetable make_atf_table(FILE *out,const output_env_t oenv,
         * to do this :-)
         */
        
-       /* 4 fp entries per table point, nx+1 points, and 16 bytes extra 
-           to align it. */
-       p_tmp = malloc(4*(nx+1)*sizeof(real)+16);
-       
-       /* align it - size_t has the same same as a pointer */
-       table.tab = (real *) (((size_t) p_tmp + 16) & (~((size_t) 15)));
+    snew_aligned(table.tab,4*nx,16);
        
        copy2table(table.n,0,4,td[0].x,td[0].v,td[0].f,table.tab);
        
index 937d3283a8597caa4cae443e4a50e38167c132c7..16a6b4c16eba2de3f3e355f408cf0efc0eec184f 100644 (file)
@@ -201,6 +201,7 @@ int read_nblist(FILE *in,FILE *fp,int **mat,int natoms,gmx_bool bSymm)
            set_mat(fp,mat,iatom,4,j,4,bSymm,shift);
            njtot+=16;
            break;
+         default:
            gmx_incons("non-existing solvent type");
          }
        }
index 72e94e4aca2bd378bff0c03e241de8536187ed38..c6245720ff7bfa461938bda7859c107a6f133fb1 100644 (file)
@@ -79,6 +79,10 @@ static void shell_comm(const char *title,const char *script,int nsleep)
     sprintf(tmp,"%ctmp%cdialogXXXXXX",DIR_SEPARATOR,DIR_SEPARATOR);
     gmx_tmpnam(tmp);
   }
+  else
+  {
+      fclose(tfil);
+  }
   if ((tfil = fopen(tmp,"w")) == NULL) 
     gmx_fatal(FARGS,"Can not open tmp file %s",tmp);
   
@@ -225,7 +229,7 @@ static void ExportCB(t_x11 *x11,int dlg_mess,int item_id,
 #endif
     break;
   case DLG_EXIT:
-    if ((bOk=(gmx_strcasecmp("ok",set))==0)) 
+    if ((bOk=gmx_strcasecmp("ok",set))==0)
       strcpy(gmx->confout,EditText(dlg,eExConf));
     HideDlg(dlg);
     if (bOk)
index 679813496088508b29649c55222dc17203214a29..d3af044d1a2ff349d9b066d25c69d6223e0162f3 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <math.h>
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "smalloc.h"
 #include "macros.h"
 #include "xutil.h"
diff --git a/src/ngmx/nener.c b/src/ngmx/nener.c
deleted file mode 100644 (file)
index b21c726..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Gyas ROwers Mature At Cryogenic Speed
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include <smalloc.h>
-#include <macros.h>
-#include <names.h>
-#include "nener.h"
-#include "buttons.h"
-
-static void DrawEGraph(t_x11 *x11,t_enerwin *ew)
-{
-  t_windata *wd;
-  int       i,EHeight,EZero;
-  real      epr,scale,MaxE,MinE;
-  char      maxstr[80];
-  int       y;
-
-  wd=&(ew->wd);
-  /* Clear */
-  XClearWindow(x11->disp,wd->self);
-
-  /* Calculate boundaries */
-  MaxE=MinE=ew->e[ew->etype][0];
-  for (i=1; (i<ew->nlast); i++) {
-    MaxE=max(ew->e[ew->etype][i],MaxE);
-    MinE=min(ew->e[ew->etype][i],MinE);
-  }
-
-  /* Print title */
-  epr=max(fabs(MaxE),fabs(MinE));
-  sprintf(maxstr,"%.0f",epr);
-  EHeight=XTextHeight(x11->font)+AIR;
-  TextInRect(x11,wd->self,EType[ew->etype],AIR,0,
-            wd->width-2*AIR,EHeight,eXLeft,eYCenter);
-  TextInRect(x11,wd->self,maxstr,AIR,0,
-            wd->width-2*AIR,EHeight,eXRight,eYCenter);
-  XDrawLine(x11->disp, wd->self,x11->gc,0,EHeight,wd->width,EHeight);
-  
-  if (ew->nlast==0)
-    return;
-
-  if (fabs(MaxE-MinE) < 1e-5)
-    return;
-  
-  EZero=(wd->height-EHeight)/2;
-  scale=EZero/(real) epr;
-  EZero+=EHeight;
-  XDrawLine(x11->disp,wd->self,x11->gc,0,EZero,wd->width,EZero);
-  
-  for(i=0; (i<ew->nlast); i++) {
-    y=ew->e[ew->etype][i]*scale;
-    if (y)
-      XDrawLine(x11->disp,wd->self,x11->gc,i,EZero,i,EZero-y);
-  }
-}
-
-static gmx_bool EWCallBack(t_x11 *x11,XEvent *event, Window w, void *data)
-{
-  t_enerwin *ew;
-  int       i,x,y,width;
-
-  return FALSE;
-  ew=(t_enerwin *)data;
-  switch(event->type) {
-  case Expose:
-    XSetForeground(x11->disp,x11->gc,WHITE);
-    DrawEGraph(x11,ew);
-    XSetForeground(x11->disp,x11->gc,x11->fg);
-    break;
-  case ConfigureNotify:
-    ew->wd.x=event->xconfigure.x;
-    ew->wd.y=event->xconfigure.y;
-    ew->wd.width=event->xconfigure.width;
-    ew->wd.height=event->xconfigure.height;
-    if (ew->wd.width > ew->nwidth) {
-      ew->nwidth=ew->wd.width;
-      for (i=0; (i<ew->nre); i++)
-       srenew(ew->e[i],ew->nwidth);
-    }
-    break;
-  case ButtonPress:
-    x=event->xbutton.x;
-    y=ew->wd.y+event->xbutton.y;
-    width=menu_width(ew->selener);
-    x=min(x+ew->wd.x,ew->wd.x+ew->wd.width-width);
-    printf("Showing at %d,%d, width %d\n",x,y,width);
-    show_menu(x11,ew->selener,x,y,TRUE);
-    break;
-  case ClientMessage:
-    ew->etype=event->xclient.data.l[0];
-    ExposeWin(x11->disp,ew->wd.self);
-    /* no break */
-  case ButtonRelease:
-    hide_menu(x11,ew->selener);
-    break;
-  default:
-    break;
-  }
-  return FALSE;
-}
-
-static void create_selener(t_x11 *x11,t_enerwin *ew,Window Parent)
-{
-  static t_mentry *se;
-  int    i;
-
-  snew(se,ew->nre);
-  for(i=0; (i<ew->nre); i++) {
-    se[i].send_to=ew->wd.self;
-    se[i].nreturn=i;
-    se[i].bChecked=FALSE;
-    se[i].str=EType[i];
-  }
-  ew->selener=init_menu(x11,Parent,x11->fg,x11->bg,ew->nre,se,1);
-}
-
-t_enerwin *init_ew(t_x11 *x11,Window Parent,
-                  int x,int y,int width,int height,
-                  unsigned long fg,unsigned long bg)
-{
-  t_enerwin *ew;
-  int       i;
-  
-  snew(ew,1);
-  ew->etype=0;
-  ew->nlast=0;
-  ew->nwidth=width;
-  ew->nre=F_NRE;
-  snew(ew->e,ew->nre);
-  for(i=0; (i<ew->nre); i++)
-    snew(ew->e[i],width);
-  InitWin(&ew->wd,x,y,width,height,1,"Ener Window");
-  ew->wd.self=XCreateSimpleWindow(x11->disp,Parent,x,y,1,1,1,fg,bg);
-  x11->RegisterCallback(x11,ew->wd.self,Parent,EWCallBack,ew);
-  x11->SetInputMask(x11,ew->wd.self,ExposureMask | ButtonPressMask |
-                   ButtonReleaseMask |  StructureNotifyMask |
-                   OwnerGrabButtonMask);
-  create_selener(x11,ew,Parent);
-
-  return ew;
-}
-
-void map_ewin(t_x11 *x11,t_enerwin *ew)
-{
-  XMapWindow(x11->disp,ew->wd.self);
-}
-
-void add_ener(t_x11 *x11,t_enerwin *ew,t_energy e[])
-{
-  int i,j,w;
-  
-  w=ew->nwidth/2;
-  if (ew->nlast >= ew->nwidth) {
-    for(j=0; (j<ew->nre); j++)
-      for(i=0; (i<w); i++)
-       ew->e[j][i]=ew->e[j][i+w];
-    ew->nlast=w;
-  }
-
-  for(j=0; (j<ew->nre); j++) {
-    ew->e[j][ew->nlast]=e[j].e;
-  }
-  ew->nlast++;
-  ExposeWin(x11->disp,ew->wd.self);
-}
-
-void rewind_ener(t_x11 *x11,t_enerwin *ew)
-{
-  ew->nlast=0;
-  ExposeWin(x11->disp,ew->wd.self);
-}
-
-void done_ew(t_x11 *x11,t_enerwin *ew)
-{
-  done_menu(x11,ew->selener);
-  x11->UnRegisterCallback(x11,ew->wd.self);
-  sfree(ew);
-}
-
-
diff --git a/src/ngmx/nener.h b/src/ngmx/nener.h
deleted file mode 100644 (file)
index 529b6dd..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Gyas ROwers Mature At Cryogenic Speed
- */
-
-#ifndef _nener_h
-#define _nener_h
-
-#include "x11.h"
-#include "xutil.h"
-#include "popup.h"
-
-typedef struct {
-  t_windata   wd;              /* Window struct                */
-  t_menu      *selener;                /* The Select energy menu       */
-  int         nre,nwidth;      /* The number of terms          */
-  int        nlast;            /* The last frame added         */      
-  int         etype;           /* The term selected            */
-  real        **e;             /* The energy array             */
-} t_enerwin;
-
-extern t_enerwin *init_ew(t_x11 *x11,Window Parent,
-                         int x,int y,int width,int height,
-                         unsigned long fg,unsigned long bg);
-
-extern void map_ewin(t_x11 *x11,t_enerwin *ew);
-
-extern void add_ener(t_x11 *x11,t_enerwin *ew,t_energy e[]);
-
-extern void rewind_ener(t_x11 *x11,t_enerwin *ew);
-
-extern void done_ew(t_x11 *x11,t_enerwin *ew);
-
-#endif /* _nener_h */
diff --git a/src/ngmx/nload.c b/src/ngmx/nload.c
deleted file mode 100644 (file)
index cc34951..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Gyas ROwers Mature At Cryogenic Speed
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include <typedefs.h>
-#include <macros.h>
-#include <smalloc.h>
-#include <string.h>
-#include "nload.h"
-#include "buttons.h"
-
-void DrawLoad(t_x11 *x11,t_windata *Win,int nloads,int *loadinfo)
-{
-  static char *Strings[] = { "Unbalance","Single Node","Your Ad Here ?"};
-  int  i,y0,bwidth,boff,bar,bmax,bmin,ym,yh;
-  int  *lb;
-  real bav,bscale;
-  char maxstr[6];
-
-  return;
-  
-  XClearWindow(x11->disp, Win->self);
-  y0=XTextHeight(x11->font)+AIR;
-  yh=(Win->height-y0)/2;
-  ym=y0+yh;
-  XSetForeground(x11->disp,x11->gc,WHITE);
-  XDrawLine(x11->disp,Win->self,x11->gc,0,y0,Win->width,y0);
-    
-  if (nloads >= 2) {
-    TextInRect(x11,Win->self,Strings[0],AIR,0,Win->width-2*AIR,y0,
-              eXLeft,eYCenter);
-    if (loadinfo[0] == 0) {
-      nloads--;
-      lb=&loadinfo[1];
-    }
-    else {
-      lb=loadinfo;
-      if (loadinfo[nloads-1] == 0) 
-       nloads--;
-    }
-    bwidth = (Win->width) / nloads;
-    boff   = (Win->width % nloads)/2;
-    bav    = 0.0; 
-    
-    bmax=bmin=lb[0];
-    
-    for (i=1; (i<nloads); i++) {
-      bmax = max (bmax,lb[i]);
-      bmin = min (bmin,lb[i]);
-      bav += lb[i];
-    }
-    bav/=nloads;
-    bscale = (yh-2)/max(fabs(bmax-bav),fabs(bav-bmin));
-    sprintf(maxstr,"(%d%%)",(int)(100.0*(bmax-bav)/bav));
-    TextInRect(x11,Win->self,maxstr,AIR,0,Win->width-2*AIR,y0,
-              eXRight,eYCenter);
-
-    XDrawLine(x11->disp,Win->self,x11->gc,0,ym,Win->width,ym);
-    if (bmax-bmin) {
-      for(i=0; i<nloads; i++) {
-       bar=(lb[i]-bav)*bscale;
-       if (bar != 0) {
-         if (bar > 0)
-           XFillRectangle(x11->disp,Win->self,x11->gc,
-                          (i*bwidth)+boff+1,ym-bar+1,bwidth-2,bar);
-         else
-           XFillRectangle(x11->disp,Win->self,x11->gc,
-                          (i*bwidth)+boff+1,ym,bwidth-2,-bar);
-       }
-      }
-      
-    }
-  }
-  else {
-    TextInRect(x11,Win->self,Strings[1],AIR,0,Win->width,y0,eXLeft,eYCenter);
-    TextInRect(x11,Win->self,Strings[2],AIR,y0,Win->width,
-              Win->height-y0,eXLeft,eYCenter);
-  }
-  XSetForeground(x11->disp,x11->gc,x11->fg);
-}
-
-static gmx_bool LWCallBack(t_x11 *x11,XEvent *event, Window w, void *data)
-{
-  t_loadwin *lw;
-
-  lw=(t_loadwin *)data;
-  switch(event->type) {
-  case Expose:
-    DrawLoad(x11,&lw->wd,lw->nnodes,lw->load);
-    break;
-  default:
-    break;
-  }
-  return FALSE;
-}
-
-t_loadwin *init_lw(t_x11 *x11,Window Parent,
-                  int x,int y,int width,int height,
-                  unsigned long fg,unsigned long bg)
-{
-  t_loadwin *lw;
-  
-  snew(lw,1);
-  snew(lw->load,MAXNODES);
-  lw->nnodes=1;
-  InitWin(&lw->wd,x,y,width,height,1,"Load Window");
-  lw->wd.self=XCreateSimpleWindow(x11->disp,Parent,x,y,1,1,1,fg,bg);
-  x11->RegisterCallback(x11,lw->wd.self,Parent,LWCallBack,lw);
-  x11->SetInputMask(x11,lw->wd.self,ExposureMask);
-
-  return lw;
-}
-
-void map_lw(t_x11 *x11,t_loadwin *lw)
-{
-  XMapWindow(x11->disp,lw->wd.self);
-}
-
-void set_load(t_x11 *x11,t_loadwin *lw,int nnodes,int load[])
-{
-  int  i;
-  gmx_bool bChange=FALSE;
-
-  lw->nnodes=nnodes;
-  for(i=0; (i<nnodes); i++)
-    if (lw->load[i] != load[i]) {
-      bChange=TRUE;
-      lw->load[i]=load[i];
-    }
-  if (bChange)
-    ExposeWin(x11->disp,lw->wd.self);
-}
-
-void done_lw(t_x11 *x11,t_loadwin *lw)
-{
-  x11->UnRegisterCallback(x11,lw->wd.self);
-  sfree(lw);
-}
-
diff --git a/src/ngmx/nload.h b/src/ngmx/nload.h
deleted file mode 100644 (file)
index 9dc0395..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Gyas ROwers Mature At Cryogenic Speed
- */
-
-#ifndef _nload_h
-#define _nload_h
-
-#include "x11.h"
-#include "xutil.h"
-
-typedef struct {
-  t_windata wd;
-  int       nnodes;
-  int       *load;
-} t_loadwin;
-
-extern t_loadwin *init_lw(t_x11 *x11,Window Parent,
-                           int x,int y,int width,int height,
-                           unsigned long fg,unsigned long bg);
-
-extern void map_lw(t_x11 *x11,t_loadwin *lw);
-
-extern void set_load(t_x11 *x11,t_loadwin *lw,int nnodes,int load[]);
-
-extern void done_lw(t_x11 *x11,t_loadwin *lw);
-
-#endif /* _nload_h */
index 86c4db387b462572e34fb6898beab7f7a55415ef..ecf5879ae4747f3d6e80507fee2fbbc75cbd8f0b 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <math.h>
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "smalloc.h"
 #include "macros.h"
 #include "xutil.h"
index f45efa7d421070d1e9fd00ccd7e53d0100a4385d..0af58b4fc84b39b8beb4f5ae3599a4766fc0c77a 100644 (file)
@@ -40,7 +40,7 @@
 #include <Xstuff.h>
 #include <x11.h>
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "smalloc.h"
 #include "string2.h"
 
index 60ebc2901306767e5796a384bb400adc9ea791a2..b6a9960bdccc478cacfcf7495b38af59014e97c1 100644 (file)
@@ -51,7 +51,7 @@
 #include "smalloc.h"
 #include "statutil.h"
 #include "tpxio.h"
-#include "string.h"
+#include <string.h>
 #include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
index 41a699a30ea1831ade3a4c711a46ba0112b9e83d..c72ca88e03cd3ae48199c24f658a7ed99b1aca5f 100644 (file)
@@ -39,7 +39,7 @@
 #include "filenm.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "math.h"
+#include <math.h>
 #include "typedefs.h"
 #include "xvgr.h"
 #include "copyrite.h"
index c0a7f0f724098968e70754f74dc786d45bbe1d8e..f311222a102c77a3dbe5b9ddd02e56c0b5c1920a 100644 (file)
@@ -710,7 +710,7 @@ int gmx_current(int argc,char *argv[])
   real       *mass2=NULL;
   rvec       *xtop,*vtop;
   matrix     box;
-  atom_id    *index0=NULL;
+  atom_id    *index0;
   int                                  *indexm=NULL;
   int        isize;
   t_trxstatus *status;
index 9d64e7b839fe3311efc9d353be2048715d9e125f..35a339bd05ef523d34187de0e3cf6a0a66b2fca4 100644 (file)
@@ -39,7 +39,7 @@
 #include <ctype.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "string2.h"
 #include "typedefs.h"
 #include "smalloc.h"
index d13f539e2501fd1031c96026d9f10b26f34199c0..38a372fac47e82dd677ac526b708fb27aec00869 100644 (file)
@@ -39,7 +39,7 @@
 #endif
 #include <math.h>
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "string2.h"
 #include "typedefs.h"
 #include "smalloc.h"
@@ -137,7 +137,7 @@ static void density_in_time (const char *fn, atom_id **index ,int gnx[], int grp
         gmx_fatal(FARGS,"Invalid axes. Terminating\n");
        }
        
-       if( (natoms= read_first_x(oenv,&status,fn,&t,&x0,box)==0))
+       if( (natoms= read_first_x(oenv,&status,fn,&t,&x0,box))==0)
         gmx_fatal(FARGS, "Could not read coordinates from file"); /* Open trajectory for read*/
        
 
@@ -547,7 +547,7 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
 
 static void writesurftoxpms(t_interf ***surf1,t_interf ***surf2, int tblocks,int xbins, int ybins, int zbins, real bw,real bwz, char **outfiles,int maplevels ) 
 {
-    char numbuf[12];
+    char numbuf[13];
     int n, i, j;
     real **profile1, **profile2;
     real max1, max2, min1, min2, *xticks, *yticks;
index 11a7e6c41adc50126d7dcbf16b84510750cd5d81..72cbacea7a2bdb5a6b3e3ae47d29578129649c4d 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "smalloc.h"
 #include "macros.h"
-#include "math.h"
+#include <math.h>
 #include "xvgr.h"
 #include "copyrite.h"
 #include "statutil.h"
index 05d67690e9de675b0ee8bcc56353f109b6bda0af..983eeb33eb92cc67750fc7df8b7231f1a2117abb 100644 (file)
@@ -49,7 +49,7 @@
 #include "index.h"
 #include "smalloc.h"
 #include "statutil.h"
-#include "string.h"
+#include <string.h>
 #include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
index 61bf59feb232652b78837862f28858c1f92d8818..1b31ab681c9a8bd0b48705971f91f076f65e024c 100644 (file)
@@ -45,7 +45,7 @@
 #include "confio.h"
 #include "copyrite.h"
 #include "txtdump.h"
-#include "math.h"
+#include <math.h>
 #include "macros.h"
 #include "random.h"
 #include "futil.h"
index 6463fbd6def6ca67485128a3c9820dd500304f3c..2616edc490b5037c04f34aa1e1dcb9961b6c4991 100644 (file)
@@ -39,7 +39,7 @@
 #include <math.h>
 #include "sysstuff.h"
 #include "statutil.h"
-#include "string.h"
+#include <string.h>
 #include "copyrite.h"
 #include "smalloc.h"
 #include "typedefs.h"
index 1785fea7b8e4616c95fc5014badc9877fb34d5d1..e7e98d7dc9c078a7ab884c9c6da51b8cdb65538a 100644 (file)
@@ -39,7 +39,7 @@
 #include <math.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index 95c01eab40e0f3304d2c08e61783286e75a8f213..2a4d7ab850df66688a680339d3a592ad057f8d9b 100644 (file)
@@ -1540,10 +1540,7 @@ static int is_hbond(t_hbdata *hb,int grpd,int grpa,int d,int a,
         if (bDA || (!bDA && (rha2 <= rc2))) {
             rvec_sub(x[d],x[hh],r_dh);
             if (bBox) {
-                if (hb->bGem)
-                    pbc_correct_gem(r_dh,box,hbox);
-                else
-                    pbc_correct_gem(r_dh,box,hbox);
+                pbc_correct_gem(r_dh,box,hbox);
             }
        
             if (!bDA)
@@ -2967,10 +2964,7 @@ static void dump_hbmap(t_hbdata *hb,
     fp = opt2FILE("-hbn",nfile,fnm,"w");
     if (opt2bSet("-g",nfile,fnm)) {
         fplog = ffopen(opt2fn("-g",nfile,fnm),"w");
-        if (bContact)
-            fprintf(fplog,"# %10s  %12s  %12s\n","Donor","Hydrogen","Acceptor");
-        else
-            fprintf(fplog,"# %10s  %12s  %12s\n","Donor","Hydrogen","Acceptor");
+        fprintf(fplog,"# %10s  %12s  %12s\n","Donor","Hydrogen","Acceptor");
     }
     else
         fplog = NULL;
index ca64bc5596a2a4c0406269e4e65815ac1277fb42..8a6115b8c1a3ff46c9bd7f5f943c91e9779ba862 100644 (file)
@@ -54,7 +54,7 @@
 #include "index.h"
 #include "smalloc.h"
 #include "statutil.h"
-#include "string.h"
+#include <string.h>
 #include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
index 973d9d293f1b20d4afda60f8dc695f787eaac79e..b3359e0eb8e586da1fc2f2892acfbb7e4b3ed191 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "smalloc.h"
 #include "macros.h"
-#include "math.h"
+#include <math.h>
 #include "xvgr.h"
 #include "copyrite.h"
 #include "statutil.h"
index 305222e0b01a820c5e2029423e45de9e6853a87b..3ef4088ee581c7ceb4b4c97aa13edafab26cae3f 100644 (file)
@@ -42,7 +42,7 @@
 #include <ctype.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "statutil.h"
 #include "smalloc.h"
index f3062942726e0576fff6ae1320cdc21a3330c9a1..1e30d5cf44903eb99b7ec894760b596410e66a95 100644 (file)
@@ -40,7 +40,7 @@
 #include <stdlib.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index 3b21564dd4d2ee67d4cb2ff9594b70e85966eea6..f554c92a10c26329449c764e6ffa7654d849ceaa 100644 (file)
@@ -40,7 +40,7 @@
 #include <ctype.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index 8b3705a825bbe61ca012246f5560a0f8a2d480e3..3446bb24aaf206bfb500a2ddc62956b75db1384d 100644 (file)
@@ -40,7 +40,7 @@
 #include <ctype.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index 4d25a3536d940b557dff7fec6e455a4ba3fb6d75..9f0997c879c51bf8261a3d0092ee79a65d59a042 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <math.h>
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index 2b911c9c95fa69264b28f464a3f781797839fb95..28ef03f2bd8481220f8f06efa4861f079ac9983a 100644 (file)
@@ -39,7 +39,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index a848bb931b077d2b451e6294554fdf58f661a32a..ea1efb13433e003fe20e25d19c8c798e514f1b77 100644 (file)
@@ -37,7 +37,7 @@
 #endif
 
 #include "smalloc.h"
-#include "math.h"
+#include <math.h>
 #include "macros.h"
 #include "typedefs.h"
 #include "xvgr.h"
index 89f8f7dff6cd36e7ba5728da1bfd476c8856924f..2fabc1e6ec85f533d9a9a97e8d27240921ac9474 100644 (file)
@@ -37,7 +37,7 @@
 #endif
 
 #include "smalloc.h"
-#include "math.h"
+#include <math.h>
 #include "macros.h"
 #include "typedefs.h"
 #include "xvgr.h"
index d985bfa1aaad2795e9269c9cdc7022744ef1ed92..2205bb20eb892766c85f2f4b3f9a5e750bf4667a 100644 (file)
@@ -39,7 +39,7 @@
 #include <stdlib.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index cde0e648878acd2cf5a0eb33de4117fce149665c..8dce7a27e37d8e9d47bb504a57fdc4d850293732 100644 (file)
@@ -38,7 +38,7 @@
 #include <math.h>
 
 #include "sysstuff.h"
-#include "string.h"
+#include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
index 1cb9ffb19a27524d66953e79ac97e460fb5999ed..bab9d0b57fee149736492e27f2345fe018726efe 100644 (file)
@@ -45,7 +45,7 @@
 #include "copyrite.h"
 #include "statutil.h"
 #include "tpxio.h"
-#include "math.h"
+#include <math.h>
 #include "index.h"
 #include "pbc.h"
 #include "rmpbc.h"
index dee6fabc0a9688bbbf112d325e68c3ac4d7c05e5..5a7babd4695ae78a4490290868819a2cda992e47 100644 (file)
@@ -49,7 +49,7 @@
 #include "index.h"
 #include "smalloc.h"
 #include "statutil.h"
-#include "string.h"
+#include <string.h>
 #include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
index cb2d2e0c76804cd04cddcfd03fb773e7576e2bca..9fd6516e73c55e30a5a5775bcec2fae09eeb1a5c 100644 (file)
@@ -542,7 +542,7 @@ static void update_histo(int gnx,atom_id index[],rvec v[],
     int  i,m,in,nnn;
     real vn,vnmax;
   
-    if (histo == NULL)
+    if (*histo == NULL)
     {
         vnmax = 0;
         for(i=0; (i<gnx); i++)
index 2ca470dc4864c0b5df8a3848d893077e768ee8d9..de3c248a81a14c8433332a16985e5627c41f5052 100644 (file)
@@ -567,6 +567,7 @@ int gmx_trjcat(int argc, char *argv[])
                 snew(fnms_out[i],strlen(buf)+32);
                 sprintf(fnms_out[i],"%d_%s",i,buf);
             }
+            sfree(buf);
         }
         do_demux(nfile_in,fnms,fnms_out,n,val,t,dt_remd,isize,index,dt,oenv);
     }
index b848fabd1488de7948d5fc36a394a0beab40bb1a..007eaacab011320d1921f1f0a68158563e2b737e 100644 (file)
@@ -1553,6 +1553,8 @@ int gmx_trjconv(int argc,char *argv[])
         fprintf(stderr,"\n");
 
         close_trj(status);
+        sfree(outf_base);
+
        if (bRmPBC)
          gmx_rmpbc_done(gpbc);
        
index ee3083a3d80a8a6c5e7c2e706356a75f6c9fee10..257f44a4f80500bd2071f350ea076a7c59d990f2 100644 (file)
@@ -49,7 +49,7 @@
 #include "index.h"
 #include "smalloc.h"
 #include "statutil.h"
-#include "string.h"
+#include <string.h>
 #include "sysstuff.h"
 #include "txtdump.h"
 #include "typedefs.h"
diff --git a/src/tools/pinput.c b/src/tools/pinput.c
deleted file mode 100644 (file)
index 14c980c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "paramio.h"
-#include "pinput.h"
-
-#define PPIN \
-  ITYPE("nframes",              p->nframes,        1) \
-  ETYPE("optimize",             p->nSel)              \
-        "radius", "twist", "rise", "len", "nhx", "dipole", "rms", "cphi", NULL, \
-  ETYPE("funct",                p->funct)              \
-        "MC", "RECOMB", "PROPTRJ", NULL, \
-  ITYPE("nsteps",               p->nsteps,         100) \
-  ITYPE("nev",                  p->nev,            10) \
-  ITYPE("nskip",                p->nskip,          0) \
-  STYPE("projection",           p->base,           "WEDPRJVEC10.DAT") \
-  STYPE("recomb",               p->recomb,         "WEDRECOMB10.DAT") \
-  STYPE("gamma",                p->gamma,          "WEDGAMMA10.DAT") \
-  RTYPE("stepsize",             p->step,           0.1) \
-  RTYPE("tolerance",            p->tol,            1e-6) \
-  RTYPE("ref-fluc",             p->v0,             1e-3) \
-  NULL
-
-void read_inp(char *fnin,char *fnout,t_pinp *p)
-{
-  read_params(fnin,PPIN);
-  write_params(fnout,PPIN);
-}
diff --git a/src/tools/pinput.h b/src/tools/pinput.h
deleted file mode 100644 (file)
index fb8e91b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
- */
-
-#ifndef _pinput_h
-#define _pinput_h
-
-#include "typedefs.h"
-#include "string2.h"
-
-enum { ptMC, ptREC, ptPTRJ, ptNR };
-
-typedef struct {
-  real step;
-  real tol;
-  real v0;
-  char base[STRLEN];
-  char recomb[STRLEN];
-  char gamma[STRLEN];
-  int  funct;
-  int  nsteps;
-  int  nframes;
-  int  nskip;
-  int  nSel;
-  int  nev;
-} t_pinp;
-       
-extern void read_inp(char *fnin,char *fnout,t_pinp *p);
-
-#endif