Apply re-formatting to C++ in src/ tree.
[alexxy/gromacs.git] / src / gromacs / fileio / g96io.cpp
index e046b03d4dd624bc932ca9ec10d1dfd8db82d62d..cf0bd86cdb79968a2d0303609bf3ecb98d2d9f3f 100644 (file)
@@ -107,8 +107,7 @@ static int read_g96_pos(char line[], t_symtab* symtab, FILE* fp, const char* inf
                 }
                 if ((nwanted != -1) && (natoms >= nwanted))
                 {
-                    gmx_fatal(FARGS, "Found more coordinates (%d) in %s than expected %d\n", natoms,
-                              infile, nwanted);
+                    gmx_fatal(FARGS, "Found more coordinates (%d) in %s than expected %d\n", natoms, infile, nwanted);
                 }
                 if (atoms)
                 {
@@ -133,8 +132,7 @@ static int read_g96_pos(char line[], t_symtab* symtab, FILE* fp, const char* inf
                         newres++;
                         if (newres >= atoms->nr)
                         {
-                            gmx_fatal(FARGS, "More residues than atoms in %s (natoms = %d)", infile,
-                                      atoms->nr);
+                            gmx_fatal(FARGS, "More residues than atoms in %s (natoms = %d)", infile, atoms->nr);
                         }
                         atoms->atom[natoms].resind = newres;
                         if (newres + 1 > atoms->nres)
@@ -159,8 +157,7 @@ static int read_g96_pos(char line[], t_symtab* symtab, FILE* fp, const char* inf
         }
         if ((nwanted != -1) && natoms != nwanted)
         {
-            fprintf(stderr, "Warning: found less coordinates (%d) in %s than expected %d\n", natoms,
-                    infile, nwanted);
+            fprintf(stderr, "Warning: found less coordinates (%d) in %s than expected %d\n", natoms, infile, nwanted);
         }
     }
 
@@ -200,8 +197,7 @@ static int read_g96_vel(char line[], FILE* fp, const char* infile, t_trxframe* f
                 }
                 if ((nwanted != -1) && (natoms >= nwanted))
                 {
-                    gmx_fatal(FARGS, "Found more velocities (%d) in %s than expected %d\n", natoms,
-                              infile, nwanted);
+                    gmx_fatal(FARGS, "Found more velocities (%d) in %s than expected %d\n", natoms, infile, nwanted);
                 }
                 if (fr->v)
                 {
@@ -214,8 +210,7 @@ static int read_g96_vel(char line[], FILE* fp, const char* infile, t_trxframe* f
         }
         if ((nwanted != -1) && (natoms != nwanted))
         {
-            fprintf(stderr, "Warning: found less velocities (%d) in %s than expected %d\n", natoms,
-                    infile, nwanted);
+            fprintf(stderr, "Warning: found less velocities (%d) in %s than expected %d\n", natoms, infile, nwanted);
         }
     }
 
@@ -312,8 +307,17 @@ int read_g96_conf(FILE* fp, const char* infile, char** name, t_trxframe* fr, t_s
                 bEnd = (strncmp(line, "END", 3) == 0);
                 if (!bEnd && (line[0] != '#'))
                 {
-                    nbp = sscanf(line, "%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf", &db1, &db2,
-                                 &db3, &db4, &db5, &db6, &db7, &db8, &db9);
+                    nbp = sscanf(line,
+                                 "%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf",
+                                 &db1,
+                                 &db2,
+                                 &db3,
+                                 &db4,
+                                 &db5,
+                                 &db6,
+                                 &db7,
+                                 &db8,
+                                 &db9);
                     if (nbp < 3)
                     {
                         gmx_fatal(FARGS, "Found a BOX line, but no box in %s", infile);
@@ -378,10 +382,15 @@ void write_g96_conf(FILE* out, const char* title, const t_trxframe* fr, int nind
                 {
                     a = i;
                 }
-                fprintf(out, "%5d %-5s %-5s%7d%15.9f%15.9f%15.9f\n",
+                fprintf(out,
+                        "%5d %-5s %-5s%7d%15.9f%15.9f%15.9f\n",
                         (atoms->resinfo[atoms->atom[a].resind].nr) % 100000,
-                        *atoms->resinfo[atoms->atom[a].resind].name, *atoms->atomname[a],
-                        (i + 1) % 10000000, fr->x[a][XX], fr->x[a][YY], fr->x[a][ZZ]);
+                        *atoms->resinfo[atoms->atom[a].resind].name,
+                        *atoms->atomname[a],
+                        (i + 1) % 10000000,
+                        fr->x[a][XX],
+                        fr->x[a][YY],
+                        fr->x[a][ZZ]);
             }
         }
         else
@@ -417,10 +426,15 @@ void write_g96_conf(FILE* out, const char* title, const t_trxframe* fr, int nind
                 {
                     a = i;
                 }
-                fprintf(out, "%5d %-5s %-5s%7d%15.9f%15.9f%15.9f\n",
+                fprintf(out,
+                        "%5d %-5s %-5s%7d%15.9f%15.9f%15.9f\n",
                         (atoms->resinfo[atoms->atom[a].resind].nr) % 100000,
-                        *atoms->resinfo[atoms->atom[a].resind].name, *atoms->atomname[a],
-                        (i + 1) % 10000000, fr->v[a][XX], fr->v[a][YY], fr->v[a][ZZ]);
+                        *atoms->resinfo[atoms->atom[a].resind].name,
+                        *atoms->atomname[a],
+                        (i + 1) % 10000000,
+                        fr->v[a][XX],
+                        fr->v[a][YY],
+                        fr->v[a][ZZ]);
             }
         }
         else
@@ -448,8 +462,14 @@ void write_g96_conf(FILE* out, const char* title, const t_trxframe* fr, int nind
         if ((fr->box[XX][YY] != 0.0F) || (fr->box[XX][ZZ] != 0.0F) || (fr->box[YY][XX] != 0.0F)
             || (fr->box[YY][ZZ] != 0.0F) || (fr->box[ZZ][XX] != 0.0F) || (fr->box[ZZ][YY] != 0.0F))
         {
-            fprintf(out, "%15.9f%15.9f%15.9f%15.9f%15.9f%15.9f", fr->box[XX][YY], fr->box[XX][ZZ],
-                    fr->box[YY][XX], fr->box[YY][ZZ], fr->box[ZZ][XX], fr->box[ZZ][YY]);
+            fprintf(out,
+                    "%15.9f%15.9f%15.9f%15.9f%15.9f%15.9f",
+                    fr->box[XX][YY],
+                    fr->box[XX][ZZ],
+                    fr->box[YY][XX],
+                    fr->box[YY][ZZ],
+                    fr->box[ZZ][XX],
+                    fr->box[ZZ][YY]);
         }
         fprintf(out, "\n");
         fprintf(out, "END\n");