]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
ordering of #include
authorinikep <inikep@gmail.com>
Thu, 28 Apr 2016 12:40:45 +0000 (14:40 +0200)
committerinikep <inikep@gmail.com>
Thu, 28 Apr 2016 12:40:45 +0000 (14:40 +0200)
lib/common/util.h
lib/dictBuilder/zdict.c
programs/bench.c
programs/dibio.c
programs/fileio.c
programs/fullbench.c
programs/paramgrill.c

index b85c4f9e4aa10245e94e0d90e8ee52892c8f7b0c..3eef4b1d0ae40157174c87be520978bf32776124 100644 (file)
@@ -42,7 +42,11 @@ extern "C" {
 /*-****************************************
 *  Dependencies
 ******************************************/
-#include <time.h>        /* clock_t, nanosleep, clock, CLOCKS_PER_SEC */
+#define _POSIX_C_SOURCE 199309L   /* before <time.h> - needed for nanosleep() */
+#include <time.h>       /* clock_t, nanosleep, clock, CLOCKS_PER_SEC */
+#include <sys/types.h>  /* stat */
+#include <sys/stat.h>   /* stat */
+#include "mem.h"        /* U32, U64 */
 
 
 /*-****************************************
@@ -99,8 +103,8 @@ extern "C" {
 UTIL_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart, UTIL_time_t ticksPerSecond )
 {
     UTIL_time_t clockEnd;
-
     (void)ticksPerSecond;
+
     UTIL_getTime(clockEnd);
     return UTIL_getSpanTimeMicro(ticksPerSecond, clockStart, clockEnd);
 }
@@ -109,9 +113,12 @@ UTIL_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart, UTIL_time_t ticksPe
 UTIL_STATIC void UTIL_waitForNextTick(UTIL_time_t ticksPerSecond)
 {
     UTIL_time_t clockStart, clockEnd;
+    (void)ticksPerSecond;
+
     UTIL_getTime(clockStart);
-    do { UTIL_getTime(clockEnd); }
-    while (UTIL_getSpanTimeNano(ticksPerSecond, clockStart, clockEnd) == 0);
+    do { 
+        UTIL_getTime(clockEnd); 
+    } while (UTIL_getSpanTimeNano(ticksPerSecond, clockStart, clockEnd) == 0);
 }
 
 
index 74d5f36a9774b4d47ddb4a57f60594009dfc7caf..95d291f40966bdaa54c6d974d7d571d20cc9f528 100644 (file)
@@ -54,8 +54,6 @@
 #include <stdlib.h>        /* malloc, free */
 #include <string.h>        /* memset */
 #include <stdio.h>         /* fprintf, fopen, ftello64 */
-#include <sys/types.h>     /* stat64 */
-#include <sys/stat.h>      /* stat64 */
 #include <time.h>          /* clock */
 
 #include "mem.h"           /* read */
index a7a4c579cd1590d7dc1ab6fcf97675f376ca76fd..831cc27ef722202a7c5b124ab6c704e9d670f751 100644 (file)
 /* *************************************
 *  Includes
 ***************************************/
-#define _POSIX_C_SOURCE 199309L   /* before <time.h> - needed for nanosleep() */
 #include <stdlib.h>      /* malloc, free */
 #include <string.h>      /* memset */
 #include <stdio.h>       /* fprintf, fopen, ftello64 */
-#include <sys/types.h>   /* stat64 */
-#include <sys/stat.h>    /* stat64 */
 
+#include "util.h"        /* UTIL_GetFileSize */
 #include "mem.h"
 #include "zstd_static.h"
 #include "datagen.h"     /* RDG_genBuffer */
 #include "xxhash.h"
-#include "util.h"        /* UTIL_GetFileSize */
 
 
 /* *************************************
index 0e83241037e7e8bf6b0aee736d2905fe83117856..c06d186bed089c30a699e3132c5c195dfe808575 100644 (file)
 #include <stdlib.h>         /* malloc, free */
 #include <string.h>         /* memset */
 #include <stdio.h>          /* fprintf, fopen, ftello64 */
-#include <sys/types.h>      /* stat64 */
-#include <sys/stat.h>       /* stat64 */
-#include <time.h>           /* clock */
 
+#include "util.h"           /* UTIL_GetFileSize */
 #include "mem.h"            /* read */
 #include "error_private.h"
 #include "dibio.h"
-#include "util.h"           /* UTIL_GetFileSize */
 
 
 /*-*************************************
index b69a0cb778e67f915aa7b7de2e5a77e2eb158395..964fc31fff45f26965da1f2784a973af5b3e1030 100644 (file)
 #include <string.h>     /* strcmp, strlen */
 #include <time.h>       /* clock */
 #include <errno.h>      /* errno */
-#include <sys/types.h>  /* stat64 */
-#include <sys/stat.h>   /* stat64 */
-#include "mem.h"
+
 #include "util.h"        /* UTIL_GetFileSize */
+#include "mem.h"
 #include "fileio.h"
 #include "zstd_static.h"   /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */
 #include "zbuff_static.h"
index 08ff8973f3b107b824afa487d9946308bf73bfce..3188c0f246190774ede25807e1b12620ac09900b 100644 (file)
 **************************************/
 #include <stdlib.h>       /* malloc */
 #include <stdio.h>        /* fprintf, fopen, ftello64 */
-#include <sys/types.h>    /* stat64 */
-#include <sys/stat.h>     /* stat64 */
 #include <string.h>       /* strcmp */
 #include <time.h>         /* clock_t, clock, CLOCKS_PER_SEC */
 
+#include "util.h"        /* UTIL_GetFileSize */
 #include "mem.h"
 #include "zstd_static.h"
 #include "fse_static.h"
 #include "zbuff.h"
 #include "datagen.h"
-#include "util.h"        /* UTIL_GetFileSize */
 
 
 /*_************************************
index 21f6952404b0ee5d3c850b3c2581296cca05d90e..a904726a13ad6a237e668fa7f5f6ed98885aafa6 100644 (file)
@@ -52,8 +52,6 @@
 **************************************/
 #include <stdlib.h>       /* malloc */
 #include <stdio.h>        /* fprintf, fopen, ftello64 */
-#include <sys/types.h>    /* stat64 */
-#include <sys/stat.h>     /* stat64 */
 #include <string.h>       /* strcmp */
 #include <math.h>         /* log */
 
 #  include <sys/time.h>   /* gettimeofday */
 #endif
 
+#include "util.h"        /* UTIL_GetFileSize */
 #include "mem.h"
 #include "zstd_static.h"
 #include "datagen.h"
 #include "xxhash.h"
-#include "util.h"        /* UTIL_GetFileSize */
 
 
 /*-************************************
 *  Constants
 **************************************/
-#define PROGRAM_DESCRIPTION "ZSTD_HC parameters tester"
+#define PROGRAM_DESCRIPTION "ZSTD parameters tester"
 #ifndef ZSTD_VERSION
 #  define ZSTD_VERSION ""
 #endif