Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / fileio / gmxfio_asc.c
index e44dffed2cad170d4f3bbe922aba9caf25920ee7..153e345726ea88667aa6d80022eea5efd1e6160c 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#include "gmxpre.h"
 
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
+
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
 
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio_int.h"
+#include "gromacs/fileio/md5.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/futil.h"
-#include "filenm.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gmxfio.h"
-#include "md5.h"
-
-#include "gmxfio_int.h"
+#include "gromacs/utility/smalloc.h"
 
 
 /* This is the part that reads dummy and ascii files.  */
@@ -104,7 +102,7 @@ static void encode_string(int maxlen, char dst[], const char src[])
 {
     int i;
 
-    for (i = 0; (src[i] != '\0') && (i < maxlen - 1); i++)
+    for (i = 0; (i < maxlen - 1) && (src[i] != '\0'); i++)
     {
         if ((src[i] == ' ') || (src[i] == '\t'))
         {
@@ -127,7 +125,7 @@ static void decode_string(int maxlen, char dst[], const char src[])
 {
     int i;
 
-    for (i = 0; (src[i] != '\0') && (i < maxlen - 1); i++)
+    for (i = 0; (i < maxlen - 1) && (src[i] != '\0'); i++)
     {
         if (src[i] == '_')
         {