ordering of #include

This commit is contained in:
inikep 2016-04-28 14:40:45 +02:00
parent 83c76b4594
commit d5ff2c3d9a
7 changed files with 18 additions and 24 deletions

View File

@ -42,7 +42,11 @@ extern "C" {
/*-**************************************** /*-****************************************
* Dependencies * 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_STATIC U64 UTIL_clockSpanMicro( UTIL_time_t clockStart, UTIL_time_t ticksPerSecond )
{ {
UTIL_time_t clockEnd; UTIL_time_t clockEnd;
(void)ticksPerSecond; (void)ticksPerSecond;
UTIL_getTime(clockEnd); UTIL_getTime(clockEnd);
return UTIL_getSpanTimeMicro(ticksPerSecond, clockStart, 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_STATIC void UTIL_waitForNextTick(UTIL_time_t ticksPerSecond)
{ {
UTIL_time_t clockStart, clockEnd; UTIL_time_t clockStart, clockEnd;
(void)ticksPerSecond;
UTIL_getTime(clockStart); UTIL_getTime(clockStart);
do { UTIL_getTime(clockEnd); } do {
while (UTIL_getSpanTimeNano(ticksPerSecond, clockStart, clockEnd) == 0); UTIL_getTime(clockEnd);
} while (UTIL_getSpanTimeNano(ticksPerSecond, clockStart, clockEnd) == 0);
} }

View File

@ -54,8 +54,6 @@
#include <stdlib.h> /* malloc, free */ #include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */ #include <string.h> /* memset */
#include <stdio.h> /* fprintf, fopen, ftello64 */ #include <stdio.h> /* fprintf, fopen, ftello64 */
#include <sys/types.h> /* stat64 */
#include <sys/stat.h> /* stat64 */
#include <time.h> /* clock */ #include <time.h> /* clock */
#include "mem.h" /* read */ #include "mem.h" /* read */

View File

@ -44,18 +44,15 @@
/* ************************************* /* *************************************
* Includes * Includes
***************************************/ ***************************************/
#define _POSIX_C_SOURCE 199309L /* before <time.h> - needed for nanosleep() */
#include <stdlib.h> /* malloc, free */ #include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */ #include <string.h> /* memset */
#include <stdio.h> /* fprintf, fopen, ftello64 */ #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 "mem.h"
#include "zstd_static.h" #include "zstd_static.h"
#include "datagen.h" /* RDG_genBuffer */ #include "datagen.h" /* RDG_genBuffer */
#include "xxhash.h" #include "xxhash.h"
#include "util.h" /* UTIL_GetFileSize */
/* ************************************* /* *************************************

View File

@ -46,14 +46,11 @@
#include <stdlib.h> /* malloc, free */ #include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */ #include <string.h> /* memset */
#include <stdio.h> /* fprintf, fopen, ftello64 */ #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 "mem.h" /* read */
#include "error_private.h" #include "error_private.h"
#include "dibio.h" #include "dibio.h"
#include "util.h" /* UTIL_GetFileSize */
/*-************************************* /*-*************************************

View File

@ -60,10 +60,9 @@
#include <string.h> /* strcmp, strlen */ #include <string.h> /* strcmp, strlen */
#include <time.h> /* clock */ #include <time.h> /* clock */
#include <errno.h> /* errno */ #include <errno.h> /* errno */
#include <sys/types.h> /* stat64 */
#include <sys/stat.h> /* stat64 */
#include "mem.h"
#include "util.h" /* UTIL_GetFileSize */ #include "util.h" /* UTIL_GetFileSize */
#include "mem.h"
#include "fileio.h" #include "fileio.h"
#include "zstd_static.h" /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */ #include "zstd_static.h" /* ZSTD_magicNumber, ZSTD_frameHeaderSize_max */
#include "zbuff_static.h" #include "zbuff_static.h"

View File

@ -43,17 +43,15 @@
**************************************/ **************************************/
#include <stdlib.h> /* malloc */ #include <stdlib.h> /* malloc */
#include <stdio.h> /* fprintf, fopen, ftello64 */ #include <stdio.h> /* fprintf, fopen, ftello64 */
#include <sys/types.h> /* stat64 */
#include <sys/stat.h> /* stat64 */
#include <string.h> /* strcmp */ #include <string.h> /* strcmp */
#include <time.h> /* clock_t, clock, CLOCKS_PER_SEC */ #include <time.h> /* clock_t, clock, CLOCKS_PER_SEC */
#include "util.h" /* UTIL_GetFileSize */
#include "mem.h" #include "mem.h"
#include "zstd_static.h" #include "zstd_static.h"
#include "fse_static.h" #include "fse_static.h"
#include "zbuff.h" #include "zbuff.h"
#include "datagen.h" #include "datagen.h"
#include "util.h" /* UTIL_GetFileSize */
/*_************************************ /*_************************************

View File

@ -52,8 +52,6 @@
**************************************/ **************************************/
#include <stdlib.h> /* malloc */ #include <stdlib.h> /* malloc */
#include <stdio.h> /* fprintf, fopen, ftello64 */ #include <stdio.h> /* fprintf, fopen, ftello64 */
#include <sys/types.h> /* stat64 */
#include <sys/stat.h> /* stat64 */
#include <string.h> /* strcmp */ #include <string.h> /* strcmp */
#include <math.h> /* log */ #include <math.h> /* log */
@ -64,17 +62,17 @@
# include <sys/time.h> /* gettimeofday */ # include <sys/time.h> /* gettimeofday */
#endif #endif
#include "util.h" /* UTIL_GetFileSize */
#include "mem.h" #include "mem.h"
#include "zstd_static.h" #include "zstd_static.h"
#include "datagen.h" #include "datagen.h"
#include "xxhash.h" #include "xxhash.h"
#include "util.h" /* UTIL_GetFileSize */
/*-************************************ /*-************************************
* Constants * Constants
**************************************/ **************************************/
#define PROGRAM_DESCRIPTION "ZSTD_HC parameters tester" #define PROGRAM_DESCRIPTION "ZSTD parameters tester"
#ifndef ZSTD_VERSION #ifndef ZSTD_VERSION
# define ZSTD_VERSION "" # define ZSTD_VERSION ""
#endif #endif