Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / fileio / md5.c
index ca27dbb75ae43d3f85bdfcadd5b77bb58af20300..ff74cc68d073b5a4b4c5b73926a7c8424b48e48c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/* This software has been altered by GROMACS for its use, including
+ * the use of GMX_INTEGER_BIG_ENDIAN, and the renaming of the
+ * functions md5_init, md5_append and md5_finish to have a gmx_ prefix
+ * (to avoid name clashes). */
+#include "gmxpre.h"
+
+#include "config.h"
 
 #ifdef GMX_INTEGER_BIG_ENDIAN
 #define ARCH_IS_BIG_ENDIAN 1
@@ -95,6 +99,7 @@
  */
 
 #include "md5.h"
+
 #include <string.h>
 
 #undef BYTE_ORDER   /* 1 = big-endian, -1 = little-endian, 0 = unknown */
@@ -184,7 +189,6 @@ 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
 
@@ -359,7 +363,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
 }
 
 void
-md5_init(md5_state_t *pms)
+gmx_md5_init(md5_state_t *pms)
 {
     pms->count[0] = pms->count[1] = 0;
     pms->abcd[0]  = 0x67452301;
@@ -369,7 +373,7 @@ md5_init(md5_state_t *pms)
 }
 
 void
-md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
+gmx_md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
 {
     const md5_byte_t *p = data;
     int left            = nbytes;
@@ -418,7 +422,7 @@ md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
 }
 
 void
-md5_finish(md5_state_t *pms, md5_byte_t digest[16])
+gmx_md5_finish(md5_state_t *pms, md5_byte_t digest[16])
 {
     static const md5_byte_t pad[64] = {
         0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -435,9 +439,9 @@ md5_finish(md5_state_t *pms, md5_byte_t digest[16])
         data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
     }
     /* Pad to 56 bytes mod 64. */
-    md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
+    gmx_md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
     /* Append the length. */
-    md5_append(pms, data, 8);
+    gmx_md5_append(pms, data, 8);
     for (i = 0; i < 16; ++i)
     {
         digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));