Remove separate title parameter for read_tps_conf()
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 21 Aug 2015 05:55:34 +0000 (08:55 +0300)
committerMark Abraham <mark.j.abraham@gmail.com>
Sat, 29 Aug 2015 22:21:02 +0000 (00:21 +0200)
Instead, return the title as *top->name.  Most callers were either
passing too short a buffer compared to what was expected, and/or not
using the title for anything, so this reduces the possibilities for bugs
and simplifies the API.

Minor cleanup in some callers.

Change-Id: If950cca91894e59f548913779e1cde6e908aa0d2

62 files changed:
src/gromacs/fileio/confio.cpp
src/gromacs/fileio/confio.h
src/gromacs/fileio/espio.cpp
src/gromacs/fileio/espio.h
src/gromacs/fileio/groio.cpp
src/gromacs/fileio/groio.h
src/gromacs/fileio/pdbio.cpp
src/gromacs/fileio/pdbio.h
src/gromacs/fileio/tests/confio.cpp
src/gromacs/gmxana/gmx_anadock.cpp
src/gromacs/gmxana/gmx_anaeig.cpp
src/gromacs/gmxana/gmx_bundle.cpp
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/gmx_cluster.cpp
src/gromacs/gmxana/gmx_confrms.cpp
src/gromacs/gmxana/gmx_covar.cpp
src/gromacs/gmxana/gmx_current.cpp
src/gromacs/gmxana/gmx_densmap.cpp
src/gromacs/gmxana/gmx_do_dssp.cpp
src/gromacs/gmxana/gmx_dos.cpp
src/gromacs/gmxana/gmx_dyndom.cpp
src/gromacs/gmxana/gmx_editconf.cpp
src/gromacs/gmxana/gmx_filter.cpp
src/gromacs/gmxana/gmx_genion.cpp
src/gromacs/gmxana/gmx_genpr.cpp
src/gromacs/gmxana/gmx_gyrate.cpp
src/gromacs/gmxana/gmx_hydorder.cpp
src/gromacs/gmxana/gmx_make_edi.cpp
src/gromacs/gmxana/gmx_make_ndx.cpp
src/gromacs/gmxana/gmx_mdmat.cpp
src/gromacs/gmxana/gmx_mindist.cpp
src/gromacs/gmxana/gmx_morph.cpp
src/gromacs/gmxana/gmx_msd.cpp
src/gromacs/gmxana/gmx_nmens.cpp
src/gromacs/gmxana/gmx_nmtraj.cpp
src/gromacs/gmxana/gmx_order.cpp
src/gromacs/gmxana/gmx_principal.cpp
src/gromacs/gmxana/gmx_rms.cpp
src/gromacs/gmxana/gmx_rmsdist.cpp
src/gromacs/gmxana/gmx_rmsf.cpp
src/gromacs/gmxana/gmx_rotmat.cpp
src/gromacs/gmxana/gmx_sans.cpp
src/gromacs/gmxana/gmx_sorient.cpp
src/gromacs/gmxana/gmx_spatial.cpp
src/gromacs/gmxana/gmx_tcaf.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxana/gmx_trjconv.cpp
src/gromacs/gmxana/gmx_trjorder.cpp
src/gromacs/gmxana/gmx_vanhove.cpp
src/gromacs/gmxana/gmx_velacc.cpp
src/gromacs/gmxana/sfactor.cpp
src/gromacs/gmxpreprocess/genconf.cpp
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/insert-molecules.cpp
src/gromacs/gmxpreprocess/pdb2gmx.cpp
src/gromacs/gmxpreprocess/read-conformation.cpp
src/gromacs/gmxpreprocess/read-conformation.h
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/x2top.cpp
src/gromacs/selection/tests/toputils.cpp
src/gromacs/tools/check.cpp
src/gromacs/trajectoryanalysis/runnercommon.cpp

index 6ae81c82325447b3722a05965af07fdf22cdce7c..a95dc4bdf50212c5ca60bfdd7b7a1dda556d8a0d 100644 (file)
@@ -289,7 +289,7 @@ static void tpx_make_chain_identifiers(t_atoms *atoms, t_block *mols)
     }
 }
 
-static void read_stx_conf(const char *infile, char *title, t_topology *top,
+static void read_stx_conf(const char *infile, t_topology *top,
                           rvec x[], rvec *v, int *ePBC, matrix box)
 {
     FILE       *in;
@@ -315,7 +315,7 @@ static void read_stx_conf(const char *infile, char *title, t_topology *top,
     switch (ftp)
     {
         case efGRO:
-            gmx_gro_read_conf(infile, title, top, x, v, box);
+            gmx_gro_read_conf(infile, top, x, v, box);
             break;
         case efG96:
             fr.title  = NULL;
@@ -328,16 +328,16 @@ static void read_stx_conf(const char *infile, char *title, t_topology *top,
             read_g96_conf(in, infile, &fr, &top->symtab, g96_line);
             gmx_fio_fclose(in);
             copy_mat(fr.box, box);
-            std::strncpy(title, fr.title, STRLEN);
+            top->name = put_symtab(&top->symtab, fr.title);
             sfree(const_cast<char *>(fr.title));
             break;
         case efPDB:
         case efBRK:
         case efENT:
-            gmx_pdb_read_conf(infile, title, top, x, ePBC, box);
+            gmx_pdb_read_conf(infile, top, x, ePBC, box);
             break;
         case efESP:
-            gmx_espresso_read_conf(infile, title, top, x, v, box);
+            gmx_espresso_read_conf(infile, top, x, v, box);
             break;
         default:
             gmx_incons("Not supported in read_stx_conf");
@@ -365,7 +365,7 @@ static void done_gmx_groups_t(gmx_groups_t *g)
     sfree(g->grpname);
 }
 
-gmx_bool read_tps_conf(const char *infile, char *title, t_topology *top, int *ePBC,
+gmx_bool read_tps_conf(const char *infile, t_topology *top, int *ePBC,
                        rvec **x, rvec **v, matrix box, gmx_bool bMass)
 {
     t_tpxheader      header;
@@ -402,7 +402,6 @@ gmx_bool read_tps_conf(const char *infile, char *title, t_topology *top, int *eP
         /* In this case we need to throw away the group data too */
         done_gmx_groups_t(&mtop->groups);
         sfree(mtop);
-        std::strcpy(title, *top->name);
         tpx_make_chain_identifiers(&top->atoms, &top->mols);
     }
     else
@@ -420,7 +419,7 @@ gmx_bool read_tps_conf(const char *infile, char *title, t_topology *top, int *eP
         {
             snew(*v, natoms);
         }
-        read_stx_conf(infile, title, top, *x, (v == NULL) ? NULL : *v, ePBC, box);
+        read_stx_conf(infile, top, *x, (v == NULL) ? NULL : *v, ePBC, box);
         if (bXNULL)
         {
             sfree(*x);
index b7edadde6aca03eec187f300cb0b11464f30198f..d3fa161fff2005692d1b0ced5dfb30ae2f3bb2b1 100644 (file)
@@ -69,7 +69,7 @@ void write_sto_conf_mtop(const char *outfile, const char *title,
                          rvec x[], rvec *v, int ePBC, matrix box);
 /* As write_sto_conf, but uses a gmx_mtop_t struct */
 
-gmx_bool read_tps_conf(const char *infile, char *title, struct t_topology *top,
+gmx_bool read_tps_conf(const char *infile, struct t_topology *top,
                        int *ePBC, rvec **x, rvec **v, matrix box, gmx_bool bMass);
 /* Read title, top.atoms, x, v (if not NULL) and box from an STX file,
  * memory for atoms, x and v will be allocated.
index f5949ab6466d267806b5d9a6c952ad0dce295ab2..d88dc1f05e781ccc80b74870d3e17f70fa3fb9f7 100644 (file)
@@ -163,7 +163,7 @@ static const char *const esp_prop[espNR] = {
     "molecule"
 };
 
-void gmx_espresso_read_conf(const char *infile, char *title,
+void gmx_espresso_read_conf(const char *infile,
                             t_topology *top, rvec x[], rvec *v, matrix box)
 {
     t_atoms  *atoms = &top->atoms;
@@ -175,7 +175,7 @@ void gmx_espresso_read_conf(const char *infile, char *title,
     gmx_bool  bFoundParticles, bFoundProp, bFoundVariable, bMol;
 
     // TODO: The code does not understand titles it writes...
-    title[0] = '\0';
+    top->name = put_symtab(&top->symtab, "");
 
     clear_mat(box);
 
index 6f6c4016258abeaf8c58cede84ff247e3a1d706e..fdd54fc08e9bbd1a9e7f8f5811b8c4cbefe2aa42 100644 (file)
@@ -44,7 +44,7 @@
 struct t_atoms;
 struct t_topology;
 
-void gmx_espresso_read_conf(const char *infile, char *title,
+void gmx_espresso_read_conf(const char *infile,
                             t_topology *top, rvec x[], rvec *v, matrix box);
 
 int get_espresso_coordnum(const char *infile);
index 72117a6cb5d93291e3ac1b3a3b7f7a2080c75f51..fe320792a66d7c6bf0dc2c75c612bbbadd68900f 100644 (file)
@@ -293,12 +293,14 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
     return bVel;
 }
 
-void gmx_gro_read_conf(const char *infile, char *title,
+void gmx_gro_read_conf(const char *infile,
                        t_topology *top, rvec x[], rvec *v, matrix box)
 {
     FILE *in = gmx_fio_fopen(infile, "r");
     int   ndec;
+    char  title[STRLEN];
     get_w_conf(in, infile, title, &top->symtab, &top->atoms, &ndec, x, v, box);
+    top->name = put_symtab(&top->symtab, title);
     gmx_fio_fclose(in);
 }
 
index 234f4af12ebbe62c32fb380a89742b75c498f943..57fd493efad474b526e40ea1c10b21ce91e8e525 100644 (file)
@@ -51,7 +51,7 @@ struct t_topology;
 struct t_trxframe;
 
 void get_coordnum(const char *infile, int *natoms);
-void gmx_gro_read_conf(const char *infile, char *title,
+void gmx_gro_read_conf(const char *infile,
                        struct t_topology *top, rvec x[], rvec *v, matrix box);
 
 gmx_bool gro_next_x_or_v(FILE *status, struct t_trxframe *fr);
index c8e629e52b58ee8ee64e4ad6a016bdfd9725a71a..f4c5c23d6e8dfe6ed76e398340bda3c664a8196b 100644 (file)
@@ -1006,11 +1006,13 @@ void get_pdb_coordnum(FILE *in, int *natoms)
     }
 }
 
-void gmx_pdb_read_conf(const char *infile, char *title,
+void gmx_pdb_read_conf(const char *infile,
                        t_topology *top, rvec x[], int *ePBC, matrix box)
 {
     FILE *in = gmx_fio_fopen(infile, "r");
+    char  title[STRLEN];
     read_pdbfile(in, title, NULL, &top->atoms, &top->symtab, x, ePBC, box, TRUE, NULL);
+    top->name = put_symtab(&top->symtab, title);
     gmx_fio_fclose(in);
 }
 
index 6622d86a5a4c020cb433ebaf72505484fbb43358..f87c3195893e782e216b7fbfdeefe20b14860a2b 100644 (file)
@@ -131,7 +131,7 @@ int read_pdbfile(FILE *in, char *title, int *model_nr,
  * ePBC and gmx_conect structure may be NULL.
  */
 
-void gmx_pdb_read_conf(const char *infile, char *title,
+void gmx_pdb_read_conf(const char *infile,
                        struct t_topology *top, rvec x[], int *ePBC, matrix box);
 /* Read a pdb file and extract ATOM and HETATM fields.
  * Read a box from the CRYST1 line, return 0 box when no CRYST1 is found.
index 7283bad7de88ffb12cdfcd4bfd958c3df0037cce..c5a7642dcb7f89fc19e46cf2d61640dc8cb2788c 100644 (file)
@@ -112,10 +112,8 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         {
             snew(testTop_, 1);
             int  ePBC = -2;
-            char title[STRLEN];
-            read_tps_conf(referenceFilename_.c_str(), title, testTop_,
+            read_tps_conf(referenceFilename_.c_str(), testTop_,
                           &ePBC, &testX_, NULL, testBox_, FALSE);
-            testTop_->name = put_symtab(&testTop_->symtab, title);
         }
 
         void testTopologies()
index a179c62bf27e36cc2b57d085b870902da8bf2d44..446a4b718311a27dda89b48519d516e8e869a285 100644 (file)
@@ -69,34 +69,29 @@ static t_pdbfile *read_pdbf(const char *fn)
 {
     t_pdbfile *pdbf;
     double     e;
-    char       buf[256], *ptr;
     FILE      *fp;
 
     snew(pdbf, 1);
     t_topology top;
-    read_tps_conf(fn, buf, &top, &pdbf->ePBC, &pdbf->x, NULL, pdbf->box, FALSE);
+    read_tps_conf(fn, &top, &pdbf->ePBC, &pdbf->x, NULL, pdbf->box, FALSE);
     pdbf->atoms = top.atoms;
     fp          = gmx_ffopen(fn, "r");
-    do
+    char       buf[256], *ptr;
+    while ((ptr = fgets2(buf, 255, fp)) != NULL)
     {
-        ptr = fgets2(buf, 255, fp);
-        if (ptr)
+        if (std::strstr(buf, "Intermolecular") != NULL)
         {
-            if (std::strstr(buf, "Intermolecular") != NULL)
-            {
-                ptr = std::strchr(buf, '=');
-                sscanf(ptr+1, "%lf", &e);
-                pdbf->edocked = e;
-            }
-            else if (std::strstr(buf, "Estimated Free") != NULL)
-            {
-                ptr = std::strchr(buf, '=');
-                sscanf(ptr+1, "%lf", &e);
-                pdbf->efree = e;
-            }
+            ptr = std::strchr(buf, '=');
+            sscanf(ptr+1, "%lf", &e);
+            pdbf->edocked = e;
+        }
+        else if (std::strstr(buf, "Estimated Free") != NULL)
+        {
+            ptr = std::strchr(buf, '=');
+            sscanf(ptr+1, "%lf", &e);
+            pdbf->efree = e;
         }
     }
-    while (ptr != NULL);
     gmx_ffclose(fp);
 
     return pdbf;
index f7594bb157eca44c28969f411b5ecb02ca915a26..3cc39764efb0d6b03278de46b8e00aba941472ea 100644 (file)
@@ -1079,7 +1079,6 @@ int gmx_anaeig(int argc, char *argv[])
     int            natoms;
     char          *grpname;
     const char    *indexfile;
-    char           title[STRLEN];
     int            i, j, d;
     int            nout, *iout, noutvec, *outvec, nfit;
     atom_id       *index = NULL, *ifit = NULL;
@@ -1259,7 +1258,7 @@ int gmx_anaeig(int argc, char *argv[])
     else
     {
         bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm),
-                             title, &top, &ePBC, &xtop, NULL, topbox, bM);
+                             &top, &ePBC, &xtop, NULL, topbox, bM);
         atoms = &top.atoms;
         gpbc  = gmx_rmpbc_init(&top.idef, ePBC, atoms->nr);
         gmx_rmpbc(gpbc, atoms->nr, topbox, xtop);
index 6d4eeffb0e3839511bbee596e1c4e450d4e1c12c..d5b228d61a49cdda27c3a5a4b8d78009951aa72d 100644 (file)
@@ -231,7 +231,7 @@ int gmx_bundle(int argc, char *argv[])
     t_trxframe      fr;
     t_atoms         outatoms;
     real            t, comp;
-    char           *grpname[MAX_ENDS], title[256];
+    char           *grpname[MAX_ENDS];
     /* FIXME: The constness should not be cast away */
     char           *anm = (char *)"CA", *rnm = (char *)"GLY";
     int             i, gnx[MAX_ENDS];
@@ -266,7 +266,7 @@ int gmx_bundle(int argc, char *argv[])
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, TRUE);
 
     bKink = opt2bSet("-ok", NFILE, fnm) || opt2bSet("-okr", NFILE, fnm)
         || opt2bSet("-okl", NFILE, fnm);
index 201676c46acbb7b529a8e8f78abcb670a523f631..282916e4e0a15284856eb27a1180471a0c3594a1 100644 (file)
@@ -1355,7 +1355,7 @@ int gmx_chi(int argc, char *argv[])
     rvec              *x;
     int                ePBC;
     matrix             box;
-    char               title[256], grpname[256];
+    char               grpname[256];
     t_dlist           *dlist;
     gmx_bool           bChi, bCorr, bSSHisto;
     gmx_bool           bDo_rt, bDo_oh, bDo_ot, bDo_jc;
@@ -1444,13 +1444,13 @@ int gmx_chi(int argc, char *argv[])
     /* Find the chi angles using atoms struct and a list of amino acids */
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), title, top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), top, &ePBC, &x, NULL, box, FALSE);
     t_atoms    &atoms = top->atoms;
     if (atoms.pdbinfo == NULL)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }
-    fprintf(log, "Title: %s\n", title);
+    fprintf(log, "Title: %s\n", *top->name);
 
     gmx_residuetype_init(&rt);
     dlist = mk_dlist(log, &atoms, &nlist, bPhi, bPsi, bChi, bHChi, maxchi, r0, rt);
index 5f88080bb908aae2bf34b78cb298073cad98fad3..16cbe6c70fe8b97cae051881f561798c80b256e1 100644 (file)
@@ -1623,7 +1623,7 @@ int gmx_cluster(int argc, char *argv[])
     if (bReadTraj)
     {
         /* don't read mass-database as masses (and top) are not used */
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), buf, &top, &ePBC, &xtps, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtps, NULL, box,
                       TRUE);
         if (bPBC)
         {
index 4bd9cdb19e9370db4ef71b4af0adf4c0c4de0919..d63151be507363939f0081a296aaf53d53c5766d 100644 (file)
@@ -524,7 +524,7 @@ int gmx_confrms(int argc, char *argv[])
     /* the two structure files */
     const char  *conf1file, *conf2file, *matchndxfile, *outfile;
     FILE        *fp;
-    char         title1[STRLEN], title2[STRLEN], *name1, *name2;
+    char        *name1, *name2;
     t_topology  *top1, *top2;
     int          ePBC1, ePBC2;
     t_atoms     *atoms1, *atoms2;
@@ -562,10 +562,10 @@ int gmx_confrms(int argc, char *argv[])
     /* reading reference structure from first structure file */
     fprintf(stderr, "\nReading first structure file\n");
     snew(top1, 1);
-    read_tps_conf(conf1file, title1, top1, &ePBC1, &x1, &v1, box1, TRUE);
+    read_tps_conf(conf1file, top1, &ePBC1, &x1, &v1, box1, TRUE);
     atoms1 = &(top1->atoms);
     fprintf(stderr, "%s\nContaining %d atoms in %d residues\n",
-            title1, atoms1->nr, atoms1->nres);
+            *top1->name, atoms1->nr, atoms1->nres);
 
     if (bRmpbc)
     {
@@ -585,10 +585,10 @@ int gmx_confrms(int argc, char *argv[])
     /* reading second structure file */
     fprintf(stderr, "\nReading second structure file\n");
     snew(top2, 1);
-    read_tps_conf(conf2file, title2, top2, &ePBC2, &x2, &v2, box2, TRUE);
+    read_tps_conf(conf2file, top2, &ePBC2, &x2, &v2, box2, TRUE);
     atoms2 = &(top2->atoms);
     fprintf(stderr, "%s\nContaining %d atoms in %d residues\n",
-            title2, atoms2->nr, atoms2->nres);
+            *top2->name, atoms2->nr, atoms2->nres);
 
     if (bRmpbc)
     {
@@ -796,9 +796,9 @@ int gmx_confrms(int argc, char *argv[])
             fp = gmx_ffopen(outfile, "w");
             if (!bOne)
             {
-                write_pdbfile(fp, title1, atoms1, x1, ePBC1, box1, ' ', 1, NULL, TRUE);
+                write_pdbfile(fp, *top1->name, atoms1, x1, ePBC1, box1, ' ', 1, NULL, TRUE);
             }
-            write_pdbfile(fp, title2, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, NULL, TRUE);
+            write_pdbfile(fp, *top2->name, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, NULL, TRUE);
             gmx_ffclose(fp);
             break;
         case efGRO:
@@ -809,9 +809,9 @@ int gmx_confrms(int argc, char *argv[])
             fp = gmx_ffopen(outfile, "w");
             if (!bOne)
             {
-                write_hconf_p(fp, title1, atoms1, 3, x1, v1, box1);
+                write_hconf_p(fp, *top1->name, atoms1, 3, x1, v1, box1);
             }
-            write_hconf_p(fp, title2, atoms2, 3, x2, v2, box2);
+            write_hconf_p(fp, *top2->name, atoms2, 3, x2, v2, box2);
             gmx_ffclose(fp);
             break;
         default:
@@ -826,7 +826,7 @@ int gmx_confrms(int argc, char *argv[])
                         "WARNING: cannot write the reference structure to %s file\n",
                         ftp2ext(fn2ftp(outfile)));
             }
-            write_sto_conf(outfile, title2, atoms2, x2, v2, ePBC2, box2);
+            write_sto_conf(outfile, *top2->name, atoms2, x2, v2, ePBC2, box2);
             break;
     }
 
index 6338262b25c1bb512966725848b5f1c4ca77b63d..a6e18bbf257fe9ea16a8bb47a6b12cb8dd8f13a5 100644 (file)
@@ -169,7 +169,7 @@ int gmx_covar(int argc, char *argv[])
     xpmfile    = opt2fn_null("-xpm", NFILE, fnm);
     xpmafile   = opt2fn_null("-xpma", NFILE, fnm);
 
-    read_tps_conf(fitfile, str, &top, &ePBC, &xref, NULL, box, TRUE);
+    read_tps_conf(fitfile, &top, &ePBC, &xref, NULL, box, TRUE);
     atoms = &top.atoms;
 
     if (bFit)
index 833e5a5ef306b27f89c145ac744b531a9532cf76..4ac18801dc33cf6ce9dac96171085f3a6cd2904d 100644 (file)
@@ -804,12 +804,10 @@ int gmx_current(int argc, char *argv[])
 
     output_env_t           oenv;
     t_topology             top;
-    char                   title[STRLEN];
     char                 **grpname = NULL;
     const char            *indexfn;
     t_trxframe             fr;
     real                  *mass2 = NULL;
-    rvec                  *xtop, *vtop;
     matrix                 box;
     atom_id               *index0;
     int                   *indexm = NULL;
@@ -889,12 +887,8 @@ int gmx_current(int argc, char *argv[])
     bACF = opt2bSet("-caf", NFILE, fnm);
     bINT = opt2bSet("-mc", NFILE, fnm);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xtop, &vtop, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
 
-
-
-    sfree(xtop);
-    sfree(vtop);
     indexfn = ftp2fn_null(efNDX, NFILE, fnm);
     snew(grpname, 1);
 
index ebc90defe152d1894c3973e682c9349f58496f61..d13b828f833caa7a9d068180cfc2213e91ff0005 100644 (file)
@@ -138,7 +138,7 @@ int gmx_densmap(int argc, char *argv[])
     real               t, m, mtot;
     t_pbc              pbc;
     int                cav = 0, c1 = 0, c2 = 0;
-    char             **grpname, title[256], buf[STRLEN];
+    char             **grpname, buf[STRLEN];
     const char        *unit;
     int                i, j, k, l, ngrps, anagrp, *gnx = NULL, nindex, nradial = 0, nfr, nmpower;
     atom_id          **ind = NULL, *index;
@@ -197,7 +197,7 @@ int gmx_densmap(int argc, char *argv[])
 
     if (ftp2bSet(efTPS, NFILE, fnm) || !ftp2bSet(efNDX, NFILE, fnm))
     {
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &x, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box,
                       bRadial);
     }
     if (!bRadial)
index 2abed999d596c3444257341c8e80e2eb7f9d76fc..f05d9009baf3d1fe4fa07f1ea7a49434e68d683c 100644 (file)
@@ -506,7 +506,7 @@ int gmx_do_dssp(int argc, char *argv[])
     rvec              *xp, *x;
     int               *average_area;
     real             **accr, *accr_ptr = NULL, *av_area, *norm_av_area;
-    char               pdbfile[32], tmpfile[32], title[256];
+    char               pdbfile[32], tmpfile[32];
     char               dssp[256];
     const char        *dptr;
     output_env_t       oenv;
@@ -538,7 +538,7 @@ int gmx_do_dssp(int argc, char *argv[])
     fnAArea    = opt2fn_null("-aa", NFILE, fnm);
     bDoAccSurf = (fnArea || fnTArea || fnAArea);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xp, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp, NULL, box, FALSE);
     atoms = &(top.atoms);
     check_oo(atoms);
     bPhbres = bPhobics(atoms);
index 04abdb911b6b00f1755ac0cd1f7270d5fac4b888..c7c6cb66ab8050bc536a32033474af211818d634 100644 (file)
@@ -271,7 +271,6 @@ int gmx_dos(int argc, char *argv[])
     t_trxframe          fr;
     matrix              box;
     int                 gnx;
-    char                title[256];
     real                t0, t1;
     t_trxstatus        *status;
     int                 nV, nframes, n_alloc, i, j, fftcode, Nmol, Natom;
@@ -338,7 +337,7 @@ int gmx_dos(int argc, char *argv[])
     please_cite(fplog, "Pascal2011a");
     please_cite(fplog, "Caleman2011b");
 
-    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
 
     /* Handle index groups */
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &grpNatoms, &index, &grpname);
@@ -524,7 +523,7 @@ int gmx_dos(int argc, char *argv[])
     rho   = (tmass*AMU)/(V*NANO*NANO*NANO);
     sigHS = std::pow(6*y*V/(M_PI*Natom), 1.0/3.0);
 
-    fprintf(fplog, "System = \"%s\"\n", title);
+    fprintf(fplog, "System = \"%s\"\n", *top.name);
     fprintf(fplog, "Nmol = %d\n", Nmol);
     fprintf(fplog, "Natom = %d\n", Natom);
     fprintf(fplog, "dt = %g ps\n", dt);
index ad0793e85b60fb543b423b4823cc835d5eb6c54f..6b541ca30b98139d7bda5400b24216d1b389f197 100644 (file)
@@ -191,7 +191,7 @@ int gmx_dyndom(int argc, char *argv[])
     int          i, j, natoms, isize;
     t_trxstatus *status;
     atom_id     *index = NULL, *index_all;
-    char         title[256], *grpname;
+    char        *grpname;
     real         angle, trans;
     rvec        *x, *v, *xout, *vout;
     matrix       box;
@@ -217,7 +217,7 @@ int gmx_dyndom(int argc, char *argv[])
 
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f", NFILE, fnm), title, top, NULL, &x, &v, box, FALSE);
+    read_tps_conf(opt2fn("-f", NFILE, fnm), top, NULL, &x, &v, box, FALSE);
     t_atoms  &atoms = top->atoms;
     if (atoms.pdbinfo == NULL)
     {
index b2e75e5918c0e98829791e04287e849f3fadfd63..17dfa17595b182dea7beb1c617ec130468834497 100644 (file)
@@ -698,7 +698,6 @@ int gmx_editconf(int argc, char *argv[])
 
     FILE          *out;
     const char    *infile, *outfile;
-    char           title[STRLEN];
     int            outftp, inftp, natom, i, j, n_bfac, itype, ntype;
     double        *bfac    = NULL, c6, c12;
     int           *bfac_nr = NULL;
@@ -791,7 +790,7 @@ int gmx_editconf(int argc, char *argv[])
 
     t_topology *top_tmp;
     snew(top_tmp, 1);
-    read_tps_conf(infile, title, top_tmp, &ePBC, &x, &v, box, FALSE);
+    read_tps_conf(infile, top_tmp, &ePBC, &x, &v, box, FALSE);
     t_atoms  &atoms = top_tmp->atoms;
     natom = atoms.nr;
     if (atoms.pdbinfo == NULL)
@@ -1260,12 +1259,12 @@ int gmx_editconf(int argc, char *argv[])
         if (outftp == efPDB)
         {
             out = gmx_ffopen(outfile, "w");
-            write_pdbfile_indexed(out, title, &atoms, x, ePBC, box, ' ', 1, isize, index, conect, TRUE);
+            write_pdbfile_indexed(out, *top_tmp->name, &atoms, x, ePBC, box, ' ', 1, isize, index, conect, TRUE);
             gmx_ffclose(out);
         }
         else
         {
-            write_sto_conf_indexed(outfile, title, &atoms, x, bHaveV ? v : NULL, ePBC, box, isize, index);
+            write_sto_conf_indexed(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : NULL, ePBC, box, isize, index);
         }
     }
     else
@@ -1306,7 +1305,7 @@ int gmx_editconf(int argc, char *argv[])
                     atoms.resinfo[atoms.atom[i].resind].chainid = label[0];
                 }
             }
-            write_pdbfile(out, title, &atoms, x, ePBC, box, ' ', -1, conect, TRUE);
+            write_pdbfile(out, *top_tmp->name, &atoms, x, ePBC, box, ' ', -1, conect, TRUE);
             if (bLegend)
             {
                 pdb_legend(out, atoms.nr, atoms.nres, &atoms, x);
@@ -1320,7 +1319,7 @@ int gmx_editconf(int argc, char *argv[])
         }
         else
         {
-            write_sto_conf(outfile, title, &atoms, x, bHaveV ? v : NULL, ePBC, box);
+            write_sto_conf(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : NULL, ePBC, box);
         }
     }
     gmx_atomprop_destroy(aps);
index 63c6768e29cad1db8221a7e5d169e18fdd52fe87..e79b221c55915c0dac2cfd4095a308a4557ce158 100644 (file)
@@ -96,7 +96,7 @@ int gmx_filter(int argc, char *argv[])
     int             ePBC = -1;
     rvec           *xtop;
     matrix          topbox, *box, boxf;
-    char            title[256], *grpname;
+    char           *grpname;
     int             isize;
     atom_id        *index;
     real           *w_rls = NULL;
@@ -138,7 +138,7 @@ int gmx_filter(int argc, char *argv[])
     }
     if (topfile)
     {
-        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC,
+        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC,
                              &xtop, NULL, topbox, TRUE);
         if (bTop)
         {
index a77f6b11d40e6562dc85be988406c6e4aa1419cd..9874c7a587570d0be1a0a4e03a479ff505601dbb 100644 (file)
@@ -388,7 +388,7 @@ int gmx_genion(int argc, char *argv[])
     t_pbc              pbc;
     int               *repl, ePBC;
     atom_id           *index;
-    char              *grpname, title[STRLEN];
+    char              *grpname;
     gmx_bool          *bSet;
     int                i, nw, nwa, nsa, nsalt, iqtot;
     output_env_t       oenv;
@@ -419,7 +419,7 @@ int gmx_genion(int argc, char *argv[])
     }
 
     /* Read atom positions and charges */
-    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), title, &top, &ePBC, &x, &v, box, FALSE);
+    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), &top, &ePBC, &x, &v, box, FALSE);
     atoms = top.atoms;
 
     /* Compute total charge */
index fd204d62fe2abc29c7464694edf03d37199c45bc..181c21edb90ba06e9b3b1c235ebf6292f6f6ae1b 100644 (file)
@@ -118,7 +118,6 @@ int gmx_genpr(int argc, char *argv[])
     atom_id         *ind_grp;
     const char      *xfn, *nfn;
     char            *gn_grp;
-    char             title[STRLEN];
     matrix           box;
     gmx_bool         bFreeze;
     rvec             dx, *x = NULL, *v = NULL;
@@ -156,12 +155,14 @@ int gmx_genpr(int argc, char *argv[])
         gmx_fatal(FARGS, "disre_dist should be >= 0");
     }
 
+    const char *title = "";
     if (xfn != NULL)
     {
         fprintf(stderr, "\nReading structure file\n");
-        t_topology *top;
+        t_topology *top = NULL;
         snew(top, 1);
-        read_tps_conf(xfn, title, top, NULL, &x, &v, box, FALSE);
+        read_tps_conf(xfn, top, NULL, &x, &v, box, FALSE);
+        title = *top->name;
         atoms = &top->atoms;
         if (atoms->pdbinfo == NULL)
         {
index 4d6dc09f3f25c7311ed9bc77df273cc3eefd2eae..4e0548232586ee58f78d11cddd11345eab31cdc9 100644 (file)
@@ -216,7 +216,7 @@ int gmx_gyrate(int argc, char *argv[])
     rvec            d, d1; /* eigenvalues of inertia tensor */
     real            t, t0, tm, gyro;
     int             natoms;
-    char           *grpname, title[256];
+    char           *grpname;
     int             j, m, gnx, nam, mol;
     atom_id        *index;
     output_env_t    oenv;
@@ -268,7 +268,7 @@ int gmx_gyrate(int argc, char *argv[])
         printf("Will print radius normalised by charge\n");
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, TRUE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
     if (nmol > gnx || gnx % nmol != 0)
index d1c27c207a878a7e645e045dd0fe9cf2bd60dcfa..59f24645c5eed962f9265b7104c4cd0a6055f3e0 100644 (file)
@@ -279,7 +279,6 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
     FILE         *fpsg   = NULL, *fpsk = NULL;
     t_topology    top;
     int           ePBC;
-    char          title[STRLEN];
     t_trxstatus  *status;
     int           natoms;
     real          t;
@@ -298,7 +297,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
      * i.e 1D Row-major order in (t,x,y) */
 
 
-    read_tps_conf(fnTPS, title, &top, &ePBC, &xtop, NULL, box, FALSE);
+    read_tps_conf(fnTPS, &top, &ePBC, &xtop, NULL, box, FALSE);
 
     *nslicex = static_cast<int>(box[XX][XX]/binw + onehalf); /*Calculate slicenr from binwidth*/
     *nslicey = static_cast<int>(box[YY][YY]/binw + onehalf);
index 5104c99fb3a7be89bbc67c02489424d0a7004601..c04942abb16f653c91d12229177d41955656795f 100644 (file)
@@ -394,12 +394,12 @@ void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
     write_t_edx(fp, edpars->sori, "NORIGIN, XORIGIN");
 }
 
-int read_conffile(const char *confin, char *title, rvec **x)
+int read_conffile(const char *confin, rvec **x)
 {
     t_topology  top;
     matrix      box;
     printf("read coordnumber from file %s\n", confin);
-    read_tps_conf(confin, title, &top, NULL, x, NULL, box, FALSE);
+    read_tps_conf(confin, &top, NULL, x, NULL, box, FALSE);
     printf("number of coordinates in file %d\n", top.atoms.nr);
     return top.atoms.nr;
 }
@@ -526,11 +526,10 @@ void get_structure(t_atoms *atoms, const char *IndexFile,
     int      ngro;
     int      ntar;
     rvec    *xtar;
-    char     title[STRLEN];
     char   * grpname;
 
 
-    ntar = read_conffile(StructureFile, title, &xtar);
+    ntar = read_conffile(StructureFile, &xtar);
     printf("Select an index group of %d elements that corresponds to the atoms in the structure file %s\n",
            ntar, StructureFile);
     get_index(atoms, IndexFile, 1, &ngro, &igro, &grpname);
@@ -748,7 +747,6 @@ int gmx_make_edi(int argc, char *argv[])
     /*to read topology file*/
     t_topology  top;
     int         ePBC;
-    char        title[STRLEN];
     matrix      topbox;
     rvec       *xtop;
     gmx_bool    bFit1;
@@ -849,7 +847,7 @@ int gmx_make_edi(int argc, char *argv[])
                       &xref1, &edi_params.fitmas, &xav1, &edi_params.pcamas, &nvec1, &eignr1, &eigvec1, &eigval1);
 
     read_tps_conf(ftp2fn(efTPS, NFILE, fnm),
-                  title, &top, &ePBC, &xtop, NULL, topbox, 0);
+                  &top, &ePBC, &xtop, NULL, topbox, 0);
     atoms = &top.atoms;
 
 
index 67d324ff5376f2817c8bfccd243d2f59937636fa..f640075532ecbe3fbb29e4200b08335b95294c10 100644 (file)
@@ -1540,7 +1540,6 @@ int gmx_make_ndx(int argc, char *argv[])
 #define NPA asize(pa)
 
     output_env_t oenv;
-    char         title[STRLEN];
     int          nndxin;
     const char  *stxfile;
     char       **ndxinfiles;
@@ -1588,7 +1587,7 @@ int gmx_make_ndx(int argc, char *argv[])
         t_topology *top;
         snew(top, 1);
         fprintf(stderr, "\nReading structure file\n");
-        read_tps_conf(stxfile, title, top, &ePBC, &x, &v, box, FALSE);
+        read_tps_conf(stxfile, top, &ePBC, &x, &v, box, FALSE);
         atoms = &top->atoms;
         if (atoms->pdbinfo == NULL)
         {
index d832088c9051cdf4e91e6190ef092b8eaf112958..58e1ebf8cf01e1ab456dc4bff99e8570dae44c7c 100644 (file)
@@ -215,7 +215,7 @@ int gmx_mdmat(int argc, char *argv[])
     t_trxstatus   *status;
     gmx_bool       bCalcN, bFrames;
     real           t, ratio;
-    char           title[256], label[234];
+    char           label[234];
     t_rgb          rlo, rhi;
     rvec          *x;
     real         **mdmat, *resnr, **totmdmat;
@@ -240,7 +240,7 @@ int gmx_mdmat(int argc, char *argv[])
         fprintf(stderr, "Will calculate number of different contacts\n");
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, FALSE);
 
     fprintf(stderr, "Select group for analysis\n");
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpname);
index 44f5d36af840cee470734d9551051289ca65c27f..c1ab45b4ab7e871e0e16bc5310454b0653be7656 100644 (file)
@@ -692,7 +692,6 @@ int gmx_mindist(int argc, char *argv[])
     output_env_t    oenv;
     t_topology     *top  = NULL;
     int             ePBC = -1;
-    char            title[256];
     rvec           *x;
     matrix          box;
     gmx_bool        bTop = FALSE;
@@ -760,7 +759,7 @@ int gmx_mindist(int argc, char *argv[])
     if (tpsfnm || resfnm || !ndxfnm)
     {
         snew(top, 1);
-        bTop = read_tps_conf(tpsfnm, title, top, &ePBC, &x, NULL, box, FALSE);
+        bTop = read_tps_conf(tpsfnm, top, &ePBC, &x, NULL, box, FALSE);
         if (bPI && !bTop)
         {
             printf("\nWARNING: Without a run input file a trajectory with broken molecules will not give the correct periodic image distance\n\n");
index 93c64cda7b256cde39b8d94aaa7111ea70127a8d..cee2c5af95bfeb70f93bf975374f04aac870b53a 100644 (file)
@@ -119,7 +119,7 @@ int gmx_morph(int argc, char *argv[])
     rvec            *x1, *x2, *xx;
     matrix           box;
     real             rms1, rms2, fac, *mass;
-    char             title[STRLEN], *grpname;
+    char            *grpname;
     gmx_bool         bRMS;
     output_env_t     oenv;
 
@@ -132,9 +132,9 @@ int gmx_morph(int argc, char *argv[])
 
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f1", NFILE, fnm), title, top, NULL, &x1, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f1", NFILE, fnm), top, NULL, &x1, NULL, box, FALSE);
     nat1 = top->atoms.nr;
-    read_tps_conf(opt2fn("-f2", NFILE, fnm), title, top, NULL, &x2, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f2", NFILE, fnm), top, NULL, &x2, NULL, box, FALSE);
     nat2 = top->atoms.nr;
     if (nat1 != nat2)
     {
index 90fe9725e2a78659d7fc99b5274633e1234d3e40..4018d267e5025d5eee76b514ec688c3b7facc608 100644 (file)
@@ -1116,7 +1116,6 @@ int gmx_msd(int argc, char *argv[])
     t_topology      top;
     int             ePBC;
     matrix          box;
-    char            title[256];
     const char     *trx_file, *tps_file, *ndx_file, *msd_file, *mol_file, *pdb_file;
     rvec           *xdum;
     gmx_bool        bTop;
@@ -1190,7 +1189,7 @@ int gmx_msd(int argc, char *argv[])
         gmx_fatal(FARGS, "Can only calculate the full tensor for 3D msd");
     }
 
-    bTop = read_tps_conf(tps_file, title, &top, &ePBC, &xdum, NULL, box, bMW || bRmCOMM);
+    bTop = read_tps_conf(tps_file, &top, &ePBC, &xdum, NULL, box, bMW || bRmCOMM);
     if (mol_file && !bTop)
     {
         gmx_fatal(FARGS,
index b53f3b0d602d44ecfdc9765187efc2a90f563465..43a2e99673894a8622fa0c46d022006b4eaa422b 100644 (file)
@@ -96,7 +96,7 @@ int gmx_nmens(int argc, char *argv[])
     matrix              box;
     real               *eigval, *invsqrtm, t, disp;
     int                 natoms;
-    char               *grpname, title[STRLEN];
+    char               *grpname;
     const char         *indexfile;
     int                 i, j, d, s, v;
     int                 nout, *iout, noutvec, *outvec;
@@ -130,7 +130,7 @@ int gmx_nmens(int argc, char *argv[])
     read_eigenvectors(opt2fn("-v", NFILE, fnm), &natoms, &bFit,
                       &xref, &bDMR, &xav, &bDMA, &nvec, &eignr, &eigvec, &eigval);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xtop, NULL, box, bDMA);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, bDMA);
     atoms = &top.atoms;
 
     printf("\nSelect an index group of %d elements that corresponds to the eigenvectors\n", natoms);
index f319773d8445ae416c17cfd35659152dbf7d9188..7fc53fd551cc829cf613995dcebe823805765c3d 100644 (file)
@@ -110,7 +110,6 @@ int gmx_nmtraj(int argc, char *argv[])
     real        *     eigval;
     int        *      dummy;
     real        *     invsqrtm;
-    char              title[STRLEN];
     real              fraction;
     int              *out_eigidx;
     rvec        *     this_eigvec;
@@ -141,7 +140,7 @@ int gmx_nmtraj(int argc, char *argv[])
     read_eigenvectors(opt2fn("-v", NFILE, fnm), &natoms, &bFit,
                       &xref, &bDMR, &xav, &bDMA, &nvec, &eignr, &eigvec, &eigval);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xtop, NULL, box, bDMA);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, bDMA);
 
     /* Find vectors and phases */
 
index a6b2954d0d92637d11118f4c34b00554eabd7a4d..97f94ca08cd60128c1b137dd1d9c3bc52470ebc7 100644 (file)
@@ -258,7 +258,6 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
     FILE        *fpsg = NULL, *fpsk = NULL;
     t_topology   top;
     int          ePBC;
-    char         title[STRLEN];
     t_trxstatus *status;
     int          natoms;
     real         t;
@@ -272,7 +271,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
     gmx_rmpbc_t  gpbc = NULL;
 
 
-    read_tps_conf(fnTPS, title, &top, &ePBC, &xtop, NULL, box, FALSE);
+    read_tps_conf(fnTPS, &top, &ePBC, &xtop, NULL, box, FALSE);
 
     snew(sg_slice, nslice);
     snew(sk_slice, nslice);
index 6ef089ebe82122d557496801ff80180d329e7d6e..689b61330047686c8ea064d71644668c2813b453 100644 (file)
@@ -93,7 +93,7 @@ int gmx_principal(int argc, char *argv[])
     rvec      *     x;
 
     int             natoms;
-    char           *grpname, title[256];
+    char           *grpname;
     int             i, gnx;
     atom_id        *index;
     rvec            moi;
@@ -157,7 +157,7 @@ int gmx_principal(int argc, char *argv[])
     }
     sfree(legend);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
 
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
index 44f98652767aee87c6d1a252ec42c1387537b680..e8c6db18d78beac1449c4460dab6bf319f4ed9ce 100644 (file)
@@ -355,7 +355,7 @@ int gmx_rms(int argc, char *argv[])
         }
     }
 
-    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), buf, &top, &ePBC, &xp,
+    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp,
                          NULL, box, TRUE);
     snew(w_rls, top.atoms.nr);
     snew(w_rms, top.atoms.nr);
index 80245997d036042ec613dca7e1ca7d40e824d60a..984a20e11d5641d85cf223041794b2078d6cdb1f 100644 (file)
@@ -673,7 +673,6 @@ int gmx_rmsdist(int argc, char *argv[])
     t_noe_gr       *noe_gr = NULL;
     t_noe         **noe    = NULL;
     t_rgb           rlo, rhi;
-    char            buf[255];
     gmx_bool        bRMS, bScale, bMean, bNOE, bNMR3, bNMR6, bNMR;
 
     static int      nlevels  = 40;
@@ -733,7 +732,7 @@ int gmx_rmsdist(int argc, char *argv[])
     }
 
     /* get topology and index */
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), buf, &top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, FALSE);
 
     if (!bPBC)
     {
index 2f0b36133aa46aad9992cb2571bd0a29b3fe19a4..f8f182915005c2d0e19cb6b604d5970e6d03c5a8 100644 (file)
@@ -233,7 +233,6 @@ int gmx_rmsf(int argc, char *argv[])
     rvec            *x, *pdbx, *xref;
     t_trxstatus     *status;
     const char      *label;
-    char             title[STRLEN];
 
     FILE            *fp;          /* the graphics file */
     const char      *devfn, *dirfn;
@@ -283,7 +282,8 @@ int gmx_rmsf(int argc, char *argv[])
     devfn    = opt2fn_null("-od", NFILE, fnm);
     dirfn    = opt2fn_null("-dir", NFILE, fnm);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xref, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xref, NULL, box, TRUE);
+    const char *title = *top.name;
     snew(w_rls, top.atoms.nr);
 
     fprintf(stderr, "Select group(s) for root mean square calculation\n");
@@ -313,10 +313,11 @@ int gmx_rmsf(int argc, char *argv[])
         t_topology *top_pdb;
         snew(top_pdb, 1);
         /* Read coordinates twice */
-        read_tps_conf(opt2fn("-q", NFILE, fnm), title, top_pdb, NULL, NULL, NULL, pdbbox, FALSE);
+        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, NULL, NULL, NULL, pdbbox, FALSE);
         snew(pdbatoms, 1);
         *pdbatoms = top_pdb->atoms;
-        read_tps_conf(opt2fn("-q", NFILE, fnm), title, top_pdb, NULL, &pdbx, NULL, pdbbox, FALSE);
+        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, NULL, &pdbx, NULL, pdbbox, FALSE);
+        title = *top_pdb->name;
         snew(refatoms, 1);
         *refatoms = top_pdb->atoms;
         sfree(top_pdb);
index 28fd1e81a6d317aadb713d362d7a8c6f97559a5f..997330d66ac2e682671f5c6e550b2500bb706cec 100644 (file)
@@ -222,7 +222,7 @@ int gmx_rotmat(int argc, char *argv[])
     matrix          box, R;
     real            t;
     int             natoms, i;
-    char           *grpname, title[256];
+    char           *grpname;
     int             gnx;
     gmx_rmpbc_t     gpbc = NULL;
     atom_id        *index;
@@ -244,7 +244,7 @@ int gmx_rotmat(int argc, char *argv[])
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &x_ref, NULL, box, bMW);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x_ref, NULL, box, bMW);
 
     gpbc = gmx_rmpbc_init(&top.idef, ePBC, top.atoms.nr);
 
index f017f4145c1c57d1de072ce7f0e7ee0191f48331..1d075fdaa8eb5606e0849050d8d001a01608de89 100644 (file)
@@ -127,7 +127,6 @@ int gmx_sans(int argc, char *argv[])
     gmx_bool                              bMC  = FALSE;
     int                                   ePBC = -1;
     matrix                                box;
-    char                                  title[STRLEN];
     rvec                                 *x;
     int                                   natoms;
     real                                  t;
@@ -227,7 +226,7 @@ int gmx_sans(int argc, char *argv[])
     snew(grpname, 1);
     snew(index, 1);
 
-    read_tps_conf(fnTPX, title, top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(fnTPX, top, &ePBC, &x, NULL, box, TRUE);
 
     printf("\nPlease select group for SANS spectra calculation:\n");
     get_index(&(top->atoms), ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, grpname);
index 8acf9a03f92205f5f46241c3cd8ba3b648d93797..9928cc7d2691ebaf0c87c0a4977457f87ac9a9a7 100644 (file)
@@ -115,7 +115,6 @@ int gmx_sorient(int argc, char *argv[])
 {
     t_topology      top;
     int             ePBC = -1;
-    char            title[STRLEN];
     t_trxstatus    *status;
     int             natoms;
     real            t;
@@ -206,7 +205,7 @@ int gmx_sorient(int argc, char *argv[])
     bTPS = (opt2bSet("-s", NFILE, fnm) || !opt2bSet("-n", NFILE, fnm) || bCom);
     if (bTPS)
     {
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xtop, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box,
                       bCom);
     }
 
index 44f9b2ac1631285d9c169d8779fea617bb0d76db..69b6eeb8f5ca3c5f94de4f6e2b09d55dfab70855 100644 (file)
@@ -131,7 +131,6 @@ int gmx_spatial(int argc, char *argv[])
     double          MAXBIN[3];
     t_topology      top;
     int             ePBC;
-    char            title[STRLEN];
     t_trxframe      fr;
     rvec           *xtop;
     matrix          box, box_pbc;
@@ -171,7 +170,7 @@ int gmx_spatial(int argc, char *argv[])
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, TRUE);
     sfree(xtop);
 
     atoms = &(top.atoms);
index c139df52ed8f72004f8d0ed337995a33d6847b8f..323c20d86242f539febbfbf6279f989bd315c714 100644 (file)
@@ -346,7 +346,7 @@ int gmx_tcaf(int argc, char *argv[])
         return 0;
     }
 
-    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box,
+    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box,
                          TRUE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
index 3cb4ead8184e090cf246189271f36e5a62ad9e57..507aa5351381a79fbf5159660b7bfdd09c71ba2a 100644 (file)
@@ -658,7 +658,6 @@ int gmx_traj(int argc, char *argv[])
     t_topology      top;
     int             ePBC;
     real           *mass, time;
-    char            title[STRLEN];
     const char     *indexfn;
     t_trxframe      fr, frout;
     int             flags, nvhisto = 0, *vhisto = NULL;
@@ -745,7 +744,7 @@ int gmx_traj(int argc, char *argv[])
     }
     sprintf(sffmt6, "%s%s%s%s%s%s", sffmt, sffmt, sffmt, sffmt, sffmt, sffmt);
 
-    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC,
+    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC,
                          &xtop, NULL, topbox,
                          bCom && (bOX || bOXT || bOV || bOT || bEKT || bEKR));
     sfree(xtop);
index a5e9913ee663bffb0412fd101389c9cff780e5f6..a888acd19e761ba7c161621c9adc17f51b814ee1 100644 (file)
@@ -1095,9 +1095,11 @@ int gmx_trjconv(int argc, char *argv[])
 
         if (bTPS)
         {
-            read_tps_conf(top_file, top_title, &top, &ePBC, &xp, NULL, top_box,
+            read_tps_conf(top_file, &top, &ePBC, &xp, NULL, top_box,
                           bReset || bPBCcomRes);
-            atoms = &top.atoms;
+            std::strncpy(top_title, *top.name, 255);
+            top_title[255] = '\0';
+            atoms          = &top.atoms;
 
             if (0 == top.mols.nr && (bCluster || bPBCcomMol))
             {
index 70c8d7f4b644a0c3067775a3873dcd877e96a84a..675aff899a0c543ed9bc8d70f36328ed7372c306 100644 (file)
@@ -134,7 +134,7 @@ int gmx_trjorder(int argc, char *argv[])
     gmx_rmpbc_t     gpbc;
     real            t, totmass, mass, rcut2 = 0, n2;
     int             natoms, nwat, ncut;
-    char          **grpname, title[256];
+    char          **grpname;
     int             i, j, d, *isize, isize_ref = 0, isize_sol;
     atom_id         sa, sr, *swi, **index, *ind_ref = NULL, *ind_sol;
     output_env_t    oenv;
@@ -153,7 +153,7 @@ int gmx_trjorder(int argc, char *argv[])
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, TRUE);
     sfree(x);
 
     /* get index groups */
index 340491acaeda9ae17f2d40c8593be426f3370010..c78bb51676c3e0d1978e90e0f5bac367f1331ddd 100644 (file)
@@ -130,7 +130,6 @@ int gmx_vanhove(int argc, char *argv[])
 
     output_env_t oenv;
     const char  *matfile, *otfile, *orfile;
-    char         title[256];
     t_topology   top;
     int          ePBC;
     matrix       boxtop, box, *sbox, avbox, corr;
@@ -179,7 +178,7 @@ int gmx_vanhove(int argc, char *argv[])
         exit(0);
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, &xtop, NULL, boxtop,
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, boxtop,
                   FALSE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpname);
 
index 16c24304d769191598825d47d5e37a1ff7ea53c1..df1a9c60afe16af1cd328ec13ae50c6b33d4db3c 100644 (file)
@@ -209,7 +209,6 @@ int gmx_velacc(int argc, char *argv[])
     int             gnx;
     atom_id        *index;
     char           *grpname;
-    char            title[256];
     /* t0, t1 are the beginning and end time respectively.
      * dt is the time step, mass is temp variable for atomic mass.
      */
@@ -250,7 +249,7 @@ int gmx_velacc(int argc, char *argv[])
 
     if (bTPS)
     {
-        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box,
+        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box,
                              TRUE);
         get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
     }
index 029f6e2c8c56b1febfe44590e1bb7d0a5e5007ef..288f50b177c88b083fef475e3d872f26bfeea876 100644 (file)
@@ -446,7 +446,7 @@ extern int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
 {
     int                     i, *isize, flags = TRX_READ_X, **index_atp;
     t_trxstatus            *status;
-    char                  **grpname, title[STRLEN];
+    char                  **grpname;
     atom_id               **index;
     t_topology              top;
     int                     ePBC;
@@ -473,7 +473,7 @@ extern int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
     sf->energy = energy;
 
     /* Read the topology informations */
-    read_tps_conf (fnTPS, title, &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf (fnTPS, &top, &ePBC, &xtop, NULL, box, TRUE);
     sfree (xtop);
 
     /* groups stuff... */
index f9a7e53fa6c22aeff15c795dbe1c867ee598d9da..f1ea383c72546c067adc2f789b5e3d8c8fa655c8 100644 (file)
@@ -146,7 +146,6 @@ int gmx_genconf(int argc, char *argv[])
 
     int             vol;
     t_atoms        *atoms;      /* list with all atoms */
-    char            title[STRLEN];
     rvec           *x, *xx, *v; /* coordinates? */
     real            t;
     vec4           *xrot, *vrot;
@@ -229,7 +228,7 @@ int gmx_genconf(int argc, char *argv[])
     t_topology *top;
     snew(top, 1);
     atoms = &top->atoms;
-    read_tps_conf(opt2fn("-f", NFILE, fnm), title, top, &ePBC, &x, &v, box, FALSE);
+    read_tps_conf(opt2fn("-f", NFILE, fnm), top, &ePBC, &x, &v, box, FALSE);
     natoms = atoms->nr;
     nres   = atoms->nres;          /* nr of residues in one element? */
     /* make space for all the atoms */
@@ -376,7 +375,7 @@ int gmx_genconf(int argc, char *argv[])
     }
     gmx_rng_destroy(rng);
 
-    write_sto_conf(opt2fn("-o", NFILE, fnm), title, atoms, x, v, ePBC, box);
+    write_sto_conf(opt2fn("-o", NFILE, fnm), *top->name, atoms, x, v, ePBC, box);
 
     return 0;
 }
index 683a7e71ca54b9869a2ded27dff2ea99e9500cd5..d24414aec9d99885a330f520ca2fa64b66575656 100644 (file)
@@ -599,11 +599,10 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
         fprintf(stderr, "processing coordinates...\n");
     }
 
-    char        title[STRLEN];
     t_topology *conftop;
     snew(conftop, 1);
     init_state(state, 0, 0, 0, 0, 0);
-    read_tps_conf(confin, title, conftop, NULL, &state->x, &state->v, state->box, FALSE);
+    read_tps_conf(confin, conftop, NULL, &state->x, &state->v, state->box, FALSE);
     state->natoms = state->nalloc = conftop->atoms.nr;
     if (state->natoms != sys->natoms)
     {
@@ -814,14 +813,14 @@ static void read_posres(gmx_mtop_t *mtop, t_molinfo *molinfo, gmx_bool bTopB,
     t_topology     *top;
     matrix          box, invbox;
     int             natoms, npbcdim = 0;
-    char            warn_buf[STRLEN], title[STRLEN];
+    char            warn_buf[STRLEN];
     int             a, i, ai, j, k, mb, nat_molb;
     gmx_molblock_t *molb;
     t_params       *pr, *prfb;
     t_atom         *atom;
 
     snew(top, 1);
-    read_tps_conf(fn, title, top, NULL, &x, &v, box, FALSE);
+    read_tps_conf(fn, top, NULL, &x, &v, box, FALSE);
     natoms = top->atoms.nr;
     done_top(top);
     sfree(top);
index b91d4a244f01de2d34dc5cd8314734085a66b22b..9b2cdd6744f88ae4030348ead88c51817a46d624 100644 (file)
@@ -455,13 +455,15 @@ int InsertMolecules::run()
     if (bProt)
     {
         /* Generate a solute configuration */
-        title = readConformation(inputConfFile_.c_str(), top, &x, NULL,
-                                 &ePBC, box, "solute");
+        readConformation(inputConfFile_.c_str(), top, &x, NULL,
+                         &ePBC, box, "solute");
         if (top->atoms.nr == 0)
         {
             fprintf(stderr, "Note: no atoms in %s\n", inputConfFile_.c_str());
-            sfree(title);
-            title = NULL;
+        }
+        else
+        {
+            title = *top->name;
         }
     }
     if (bBox_)
@@ -484,9 +486,8 @@ int InsertMolecules::run()
     {
         int         ePBC_dummy;
         matrix      box_dummy;
-        char       *title_ins
-            = readConformation(insertConfFile_.c_str(), top_insrt, &x_insrt,
-                               NULL, &ePBC_dummy, box_dummy, "molecule");
+        readConformation(insertConfFile_.c_str(), top_insrt, &x_insrt,
+                         NULL, &ePBC_dummy, box_dummy, "molecule");
         if (top_insrt->atoms.nr == 0)
         {
             gmx_fatal(FARGS, "No molecule in %s, please check your input",
@@ -494,11 +495,7 @@ int InsertMolecules::run()
         }
         if (title == NULL)
         {
-            title = title_ins;
-        }
-        else
-        {
-            sfree(title_ins);
+            title = *top_insrt->name;
         }
         if (positionFile_.empty())
         {
@@ -527,7 +524,6 @@ int InsertMolecules::run()
     sfree(top);
     done_top(top_insrt);
     sfree(top_insrt);
-    sfree(title);
 
     return 0;
 }
index cf2a3a19a6290e4f052dc623a27f37f09050294c..ebb871bba9dbec928ea3e35e1176e50b91779de9 100644 (file)
@@ -540,8 +540,10 @@ static int read_pdball(const char *inf, const char *outf, char *title,
     printf("Reading %s...\n", inf);
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(inf, title, top, ePBC, x, NULL, box, FALSE);
-    *atoms = top->atoms;
+    read_tps_conf(inf, top, ePBC, x, NULL, box, FALSE);
+    strncpy(title, *top->name, STRLEN);
+    title[STRLEN-1] = '\0';
+    *atoms          = top->atoms;
     sfree(top);
     natom = atoms->nr;
     if (atoms->pdbinfo == NULL)
@@ -571,7 +573,7 @@ static int read_pdball(const char *inf, const char *outf, char *title,
     }
 
     printf("Read");
-    if (title && title[0])
+    if (title[0])
     {
         printf(" '%s',", title);
     }
index 133aa09f03ac3c0915542c41ab0862aeefc0576a..5278609d34604fb7734d090e28a03c6a59beb2be 100644 (file)
@@ -69,17 +69,11 @@ real *makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
     return exclusionDistances;
 }
 
-char *readConformation(const char *confin, t_topology *top, rvec **x, rvec **v,
-                       int *ePBC, matrix box, const char *statusTitle)
+void readConformation(const char *confin, t_topology *top, rvec **x, rvec **v,
+                      int *ePBC, matrix box, const char *statusTitle)
 {
-    char       *title;
-
-    snew(title, STRLEN);
-
     fprintf(stderr, "Reading %s configuration%s\n", statusTitle, v ? " and velocities" : "");
-    read_tps_conf(confin, title, top, ePBC, x, v, box, FALSE);
+    read_tps_conf(confin, top, ePBC, x, v, box, FALSE);
     fprintf(stderr, "%s\nContaining %d atoms in %d residues\n",
-            title, top->atoms.nr, top->atoms.nres);
-
-    return title;
+            *top->name, top->atoms.nr, top->atoms.nres);
 }
index 8a4f6cfdefa373e4da958d0d4acd44843dfedfe1..fae7446719d6fe87722591db2d39f967da8c1c42 100644 (file)
@@ -55,7 +55,7 @@ real *makeExclusionDistances(const struct t_atoms *a, struct gmx_atomprop *aps,
  * Used by solvate and insert-molecules. The returned pointers *x and
  * *v should be freed by the caller. top should have its destructor
  * called. */
-char *readConformation(const char *confin, struct t_topology *top, rvec **x, rvec **v,
-                       int *ePBC, matrix box, const char *statusTitle);
+void readConformation(const char *confin, struct t_topology *top, rvec **x, rvec **v,
+                      int *ePBC, matrix box, const char *statusTitle);
 
 #endif
index 20451968683e86d6da9b84422ca91bfc1dbd6bff..f55eb807b75f60822c4b876a61f7f02d598c9a4f 100644 (file)
@@ -624,11 +624,9 @@ static void add_solv(const char *fn, t_topology *top, rvec **x, rvec **v,
 
     char       *filename = gmxlibfn(fn);
     snew(top_solvt, 1);
-    char       *title_solvt
-        = readConformation(filename, top_solvt, &x_solvt, &v_solvt,
-                           &ePBC_solvt, box_solvt, "solvent");
+    readConformation(filename, top_solvt, &x_solvt, &v_solvt,
+                     &ePBC_solvt, box_solvt, "solvent");
     t_atoms *atoms_solvt = &top_solvt->atoms;
-    sfree(title_solvt);
     if (0 == atoms_solvt->nr)
     {
         gmx_fatal(FARGS, "No solvent in %s, please check your input\n", filename);
@@ -896,7 +894,6 @@ int gmx_solvate(int argc, char *argv[])
     gmx_atomprop_t aps;
 
     /* solute configuration data */
-    char       *title = NULL;
     t_topology *top;
     rvec       *x    = NULL, *v = NULL;
     int         ePBC = -1;
@@ -954,8 +951,8 @@ int gmx_solvate(int argc, char *argv[])
     {
         /* Generate a solute configuration */
         conf_prot = opt2fn("-cp", NFILE, fnm);
-        title     = readConformation(conf_prot, top, &x,
-                                     bReadV ? &v : NULL, &ePBC, box, "solute");
+        readConformation(conf_prot, top, &x,
+                         bReadV ? &v : NULL, &ePBC, box, "solute");
         if (bReadV && !v)
         {
             fprintf(stderr, "Note: no velocities found\n");
@@ -988,7 +985,7 @@ int gmx_solvate(int argc, char *argv[])
     fprintf(stderr, "Writing generated configuration to %s\n", confout);
     if (bProt)
     {
-        write_sto_conf(confout, title, &top->atoms, x, v, ePBC, box);
+        write_sto_conf(confout, *top->name, &top->atoms, x, v, ePBC, box);
     }
     else
     {
@@ -1005,7 +1002,6 @@ int gmx_solvate(int argc, char *argv[])
     sfree(v);
     done_top(top);
     sfree(top);
-    sfree(title);
     output_env_done(oenv);
     done_filenms(NFILE, fnm);
 
index c4435f4a0b2b96d867b88a69d7a015860dd86e76..28261c6bd06229ec15862ea3c6b60f76dabbdfb1 100644 (file)
@@ -444,7 +444,7 @@ int gmx_x2top(int argc, char *argv[])
     t_nm2type         *nm2t;
     t_mols             mymol;
     int                nnm;
-    char               title[STRLEN], forcefield[32], ffdir[STRLEN];
+    char               forcefield[32], ffdir[STRLEN];
     rvec              *x; /* coordinates? */
     int               *nbonds, *cgnr;
     int                bts[] = { 1, 1, 1, 2 };
@@ -543,7 +543,7 @@ int gmx_x2top(int argc, char *argv[])
     /* Read coordinates */
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f", NFILE, fnm), title, top, &epbc, &x, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f", NFILE, fnm), top, &epbc, &x, NULL, box, FALSE);
     t_atoms  *atoms = &top->atoms;
     natoms = atoms->nr;
     if (atoms->pdbinfo == NULL)
index f5118542d1d75ba801fac74d8fb39450096b01c9..549f919b8cd8c54daee2503e318f1c1b688ed7ee 100644 (file)
@@ -118,7 +118,6 @@ void TopologyManager::requestForces()
 
 void TopologyManager::loadTopology(const char *filename)
 {
-    char    title[STRLEN];
     int     ePBC;
     rvec   *xtop = NULL;
     matrix  box;
@@ -126,7 +125,7 @@ void TopologyManager::loadTopology(const char *filename)
     GMX_RELEASE_ASSERT(top_ == NULL, "Topology initialized more than once");
     snew(top_, 1);
     read_tps_conf(gmx::test::TestFileManager::getInputFilePath(filename).c_str(),
-                  title, top_, &ePBC, frame_ != NULL ? &xtop : NULL,
+                  top_, &ePBC, frame_ != NULL ? &xtop : NULL,
                   NULL, box, FALSE);
 
     if (frame_ != NULL)
index 0c34c66cb142f9d418ecef8106a38e07a2d86ab7..a925752e1386b7cf43e9820da5fc1045d4bd6b43 100644 (file)
@@ -411,7 +411,6 @@ void chk_trj(const output_env_t oenv, const char *fn, const char *tpr, real tol)
 void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
 {
     int            natom, i, j, k;
-    char           title[STRLEN];
     t_topology     top;
     int            ePBC;
     t_atoms       *atoms;
@@ -425,7 +424,7 @@ void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
     gmx_atomprop_t aps;
 
     fprintf(stderr, "Checking coordinate file %s\n", fn);
-    read_tps_conf(fn, title, &top, &ePBC, &x, &v, box, TRUE);
+    read_tps_conf(fn, &top, &ePBC, &x, &v, box, TRUE);
     atoms = &top.atoms;
     natom = atoms->nr;
     fprintf(stderr, "%d atoms in file\n", atoms->nr);
index 4483a2949d913e5a3712018764ed60be31b3c851..78dea309dcd83889f3f3b0445c4e52ac15ffb44e 100644 (file)
@@ -315,10 +315,8 @@ TrajectoryAnalysisRunnerCommon::initTopology(SelectionCollection *selections)
     // Load the topology if requested.
     if (!impl_->topfile_.empty())
     {
-        char  title[STRLEN];
-
         snew(impl_->topInfo_.top_, 1);
-        impl_->topInfo_.bTop_ = read_tps_conf(impl_->topfile_.c_str(), title,
+        impl_->topInfo_.bTop_ = read_tps_conf(impl_->topfile_.c_str(),
                                               impl_->topInfo_.top_, &impl_->topInfo_.ePBC_,
                                               &impl_->topInfo_.xtop_, NULL, impl_->topInfo_.boxtop_, TRUE);
         if (hasTrajectory()