Change g_displayLevel to int and fix DISPLAYUPDATE flush
This commit is contained in:
parent
dfc75f74da
commit
042ba122ae
@ -59,8 +59,6 @@ static int g_displayLevel = 2;
|
|||||||
if ((clock() - g_time > refreshRate) || (displayLevel >= 4)) { \
|
if ((clock() - g_time > refreshRate) || (displayLevel >= 4)) { \
|
||||||
g_time = clock(); \
|
g_time = clock(); \
|
||||||
DISPLAY(__VA_ARGS__); \
|
DISPLAY(__VA_ARGS__); \
|
||||||
if (displayLevel >= 4) \
|
|
||||||
fflush(stdout); \
|
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#define DISPLAYUPDATE(l, ...) LOCALDISPLAYUPDATE(g_displayLevel, l, __VA_ARGS__)
|
#define DISPLAYUPDATE(l, ...) LOCALDISPLAYUPDATE(g_displayLevel, l, __VA_ARGS__)
|
||||||
|
@ -480,7 +480,7 @@ static size_t ZDICT_trainBuffer(dictItem* dictList, U32 dictListSize,
|
|||||||
# define DISPLAYUPDATE(l, ...) if (notificationLevel>=l) { \
|
# define DISPLAYUPDATE(l, ...) if (notificationLevel>=l) { \
|
||||||
if (ZDICT_clockSpan(displayClock) > refreshRate) \
|
if (ZDICT_clockSpan(displayClock) > refreshRate) \
|
||||||
{ displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
{ displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (notificationLevel>=4) fflush(stdout); } }
|
if (notificationLevel>=4) fflush(stderr); } }
|
||||||
|
|
||||||
/* init */
|
/* init */
|
||||||
DISPLAYLEVEL(2, "\r%70s\r", ""); /* clean display line */
|
DISPLAYLEVEL(2, "\r%70s\r", ""); /* clean display line */
|
||||||
|
@ -70,12 +70,12 @@ static U32 g_compressibilityDefault = 50;
|
|||||||
***************************************/
|
***************************************/
|
||||||
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
||||||
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
||||||
static U32 g_displayLevel = 2; /* 0 : no display; 1: errors; 2 : + result + interaction + warnings; 3 : + progression; 4 : + information */
|
static int g_displayLevel = 2; /* 0 : no display; 1: errors; 2 : + result + interaction + warnings; 3 : + progression; 4 : + information */
|
||||||
|
|
||||||
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
||||||
if ((clock() - g_time > refreshRate) || (g_displayLevel>=4)) \
|
if ((clock() - g_time > refreshRate) || (g_displayLevel>=4)) \
|
||||||
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (g_displayLevel>=4) fflush(stdout); } }
|
if (g_displayLevel>=4) fflush(stderr); } }
|
||||||
static const clock_t refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
static const clock_t refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
||||||
static clock_t g_time = 0;
|
static clock_t g_time = 0;
|
||||||
|
|
||||||
|
@ -53,12 +53,12 @@ static const size_t maxMemory = (sizeof(size_t) == 4) ? (2 GB - 64 MB) : ((size_
|
|||||||
***************************************/
|
***************************************/
|
||||||
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
||||||
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
||||||
static unsigned g_displayLevel = 0; /* 0 : no display; 1: errors; 2: default; 4: full information */
|
static int g_displayLevel = 0; /* 0 : no display; 1: errors; 2: default; 4: full information */
|
||||||
|
|
||||||
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
||||||
if ((DIB_clockSpan(g_time) > refreshRate) || (g_displayLevel>=4)) \
|
if ((DIB_clockSpan(g_time) > refreshRate) || (g_displayLevel>=4)) \
|
||||||
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (g_displayLevel>=4) fflush(stdout); } }
|
if (g_displayLevel>=4) fflush(stderr); } }
|
||||||
static const clock_t refreshRate = CLOCKS_PER_SEC * 2 / 10;
|
static const clock_t refreshRate = CLOCKS_PER_SEC * 2 / 10;
|
||||||
static clock_t g_time = 0;
|
static clock_t g_time = 0;
|
||||||
|
|
||||||
|
@ -81,13 +81,13 @@
|
|||||||
***************************************/
|
***************************************/
|
||||||
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
||||||
#define DISPLAYLEVEL(l, ...) { if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } }
|
#define DISPLAYLEVEL(l, ...) { if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } }
|
||||||
static U32 g_displayLevel = 2; /* 0 : no display; 1: errors; 2 : + result + interaction + warnings; 3 : + progression; 4 : + information */
|
static int g_displayLevel = 2; /* 0 : no display; 1: errors; 2 : + result + interaction + warnings; 3 : + progression; 4 : + information */
|
||||||
void FIO_setNotificationLevel(unsigned level) { g_displayLevel=level; }
|
void FIO_setNotificationLevel(unsigned level) { g_displayLevel=level; }
|
||||||
|
|
||||||
#define DISPLAYUPDATE(l, ...) { if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) { if (g_displayLevel>=l) { \
|
||||||
if ((clock() - g_time > refreshRate) || (g_displayLevel>=4)) \
|
if ((clock() - g_time > refreshRate) || (g_displayLevel>=4)) \
|
||||||
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (g_displayLevel>=4) fflush(stdout); } } }
|
if (g_displayLevel>=4) fflush(stderr); } } }
|
||||||
static const clock_t refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
static const clock_t refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
||||||
static clock_t g_time = 0;
|
static clock_t g_time = 0;
|
||||||
|
|
||||||
|
@ -74,10 +74,10 @@ static U32 g_overlapLog = OVERLAP_LOG_DEFAULT;
|
|||||||
/*-************************************
|
/*-************************************
|
||||||
* Display Macros
|
* Display Macros
|
||||||
**************************************/
|
**************************************/
|
||||||
#define DISPLAY(...) fprintf(displayOut, __VA_ARGS__)
|
#define DISPLAY(...) fprintf(g_displayOut, __VA_ARGS__)
|
||||||
#define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
#define DISPLAYLEVEL(l, ...) { if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } }
|
||||||
static FILE* displayOut;
|
static int g_displayLevel = DEFAULT_DISPLAY_LEVEL; /* 0 : no display, 1: errors, 2 : + result + interaction + warnings, 3 : + progression, 4 : + information */
|
||||||
static unsigned displayLevel = DEFAULT_DISPLAY_LEVEL; /* 0 : no display, 1: errors, 2 : + result + interaction + warnings, 3 : + progression, 4 : + information */
|
static FILE* g_displayOut;
|
||||||
|
|
||||||
|
|
||||||
/*-************************************
|
/*-************************************
|
||||||
@ -167,7 +167,7 @@ static int usage_advanced(const char* programName)
|
|||||||
static int badusage(const char* programName)
|
static int badusage(const char* programName)
|
||||||
{
|
{
|
||||||
DISPLAYLEVEL(1, "Incorrect parameters\n");
|
DISPLAYLEVEL(1, "Incorrect parameters\n");
|
||||||
if (displayLevel >= 2) usage(programName);
|
if (g_displayLevel >= 2) usage(programName);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ int main(int argCount, const char* argv[])
|
|||||||
(void)memLimit; /* not used when ZSTD_NODECOMPRESS set */
|
(void)memLimit; /* not used when ZSTD_NODECOMPRESS set */
|
||||||
if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); }
|
if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); }
|
||||||
filenameTable[0] = stdinmark;
|
filenameTable[0] = stdinmark;
|
||||||
displayOut = stderr;
|
g_displayOut = stderr;
|
||||||
/* Pick out program name from path. Don't rely on stdlib because of conflicting behavior */
|
/* Pick out program name from path. Don't rely on stdlib because of conflicting behavior */
|
||||||
{ size_t pos;
|
{ size_t pos;
|
||||||
for (pos = (int)strlen(programName); pos > 0; pos--) { if (programName[pos] == '/') { pos++; break; } }
|
for (pos = (int)strlen(programName); pos > 0; pos--) { if (programName[pos] == '/') { pos++; break; } }
|
||||||
@ -325,10 +325,10 @@ int main(int argCount, const char* argv[])
|
|||||||
|
|
||||||
/* preset behaviors */
|
/* preset behaviors */
|
||||||
if (!strcmp(programName, ZSTD_UNZSTD)) operation=zom_decompress;
|
if (!strcmp(programName, ZSTD_UNZSTD)) operation=zom_decompress;
|
||||||
if (!strcmp(programName, ZSTD_CAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; displayLevel=1; }
|
if (!strcmp(programName, ZSTD_CAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; }
|
||||||
if (!strcmp(programName, ZSTD_GZ)) { suffix = GZ_EXTENSION; FIO_setCompressionType(FIO_gzipCompression); FIO_setRemoveSrcFile(1); } /* behave like gzip */
|
if (!strcmp(programName, ZSTD_GZ)) { suffix = GZ_EXTENSION; FIO_setCompressionType(FIO_gzipCompression); FIO_setRemoveSrcFile(1); } /* behave like gzip */
|
||||||
if (!strcmp(programName, ZSTD_GUNZIP)) { operation=zom_decompress; FIO_setRemoveSrcFile(1); } /* behave like gunzip */
|
if (!strcmp(programName, ZSTD_GUNZIP)) { operation=zom_decompress; FIO_setRemoveSrcFile(1); } /* behave like gunzip */
|
||||||
if (!strcmp(programName, ZSTD_GZCAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; displayLevel=1; } /* behave like gzcat */
|
if (!strcmp(programName, ZSTD_GZCAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; } /* behave like gzcat */
|
||||||
if (!strcmp(programName, ZSTD_LZMA)) { suffix = LZMA_EXTENSION; FIO_setCompressionType(FIO_lzmaCompression); FIO_setRemoveSrcFile(1); } /* behave like lzma */
|
if (!strcmp(programName, ZSTD_LZMA)) { suffix = LZMA_EXTENSION; FIO_setCompressionType(FIO_lzmaCompression); FIO_setRemoveSrcFile(1); } /* behave like lzma */
|
||||||
if (!strcmp(programName, ZSTD_XZ)) { suffix = XZ_EXTENSION; FIO_setCompressionType(FIO_xzCompression); FIO_setRemoveSrcFile(1); } /* behave like xz */
|
if (!strcmp(programName, ZSTD_XZ)) { suffix = XZ_EXTENSION; FIO_setCompressionType(FIO_xzCompression); FIO_setRemoveSrcFile(1); } /* behave like xz */
|
||||||
memset(&compressionParams, 0, sizeof(compressionParams));
|
memset(&compressionParams, 0, sizeof(compressionParams));
|
||||||
@ -344,7 +344,7 @@ int main(int argCount, const char* argv[])
|
|||||||
if (!filenameIdx) {
|
if (!filenameIdx) {
|
||||||
filenameIdx=1, filenameTable[0]=stdinmark;
|
filenameIdx=1, filenameTable[0]=stdinmark;
|
||||||
outFileName=stdoutmark;
|
outFileName=stdoutmark;
|
||||||
displayLevel-=(displayLevel==2);
|
g_displayLevel-=(g_displayLevel==2);
|
||||||
continue;
|
continue;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
@ -358,11 +358,11 @@ int main(int argCount, const char* argv[])
|
|||||||
if (!strcmp(argument, "--decompress")) { operation=zom_decompress; continue; }
|
if (!strcmp(argument, "--decompress")) { operation=zom_decompress; continue; }
|
||||||
if (!strcmp(argument, "--uncompress")) { operation=zom_decompress; continue; }
|
if (!strcmp(argument, "--uncompress")) { operation=zom_decompress; continue; }
|
||||||
if (!strcmp(argument, "--force")) { FIO_overwriteMode(); continue; }
|
if (!strcmp(argument, "--force")) { FIO_overwriteMode(); continue; }
|
||||||
if (!strcmp(argument, "--version")) { displayOut=stdout; DISPLAY(WELCOME_MESSAGE); CLEAN_RETURN(0); }
|
if (!strcmp(argument, "--version")) { g_displayOut=stdout; DISPLAY(WELCOME_MESSAGE); CLEAN_RETURN(0); }
|
||||||
if (!strcmp(argument, "--help")) { displayOut=stdout; CLEAN_RETURN(usage_advanced(programName)); }
|
if (!strcmp(argument, "--help")) { g_displayOut=stdout; CLEAN_RETURN(usage_advanced(programName)); }
|
||||||
if (!strcmp(argument, "--verbose")) { displayLevel++; continue; }
|
if (!strcmp(argument, "--verbose")) { g_displayLevel++; continue; }
|
||||||
if (!strcmp(argument, "--quiet")) { displayLevel--; continue; }
|
if (!strcmp(argument, "--quiet")) { g_displayLevel--; continue; }
|
||||||
if (!strcmp(argument, "--stdout")) { forceStdout=1; outFileName=stdoutmark; displayLevel-=(displayLevel==2); continue; }
|
if (!strcmp(argument, "--stdout")) { forceStdout=1; outFileName=stdoutmark; g_displayLevel-=(g_displayLevel==2); continue; }
|
||||||
if (!strcmp(argument, "--ultra")) { ultra=1; continue; }
|
if (!strcmp(argument, "--ultra")) { ultra=1; continue; }
|
||||||
if (!strcmp(argument, "--check")) { FIO_setChecksumFlag(2); continue; }
|
if (!strcmp(argument, "--check")) { FIO_setChecksumFlag(2); continue; }
|
||||||
if (!strcmp(argument, "--no-check")) { FIO_setChecksumFlag(0); continue; }
|
if (!strcmp(argument, "--no-check")) { FIO_setChecksumFlag(0); continue; }
|
||||||
@ -424,9 +424,9 @@ int main(int argCount, const char* argv[])
|
|||||||
switch(argument[0])
|
switch(argument[0])
|
||||||
{
|
{
|
||||||
/* Display help */
|
/* Display help */
|
||||||
case 'V': displayOut=stdout; DISPLAY(WELCOME_MESSAGE); CLEAN_RETURN(0); /* Version Only */
|
case 'V': g_displayOut=stdout; DISPLAY(WELCOME_MESSAGE); CLEAN_RETURN(0); /* Version Only */
|
||||||
case 'H':
|
case 'H':
|
||||||
case 'h': displayOut=stdout; CLEAN_RETURN(usage_advanced(programName));
|
case 'h': g_displayOut=stdout; CLEAN_RETURN(usage_advanced(programName));
|
||||||
|
|
||||||
/* Compress */
|
/* Compress */
|
||||||
case 'z': operation=zom_compress; argument++; break;
|
case 'z': operation=zom_compress; argument++; break;
|
||||||
@ -448,10 +448,10 @@ int main(int argCount, const char* argv[])
|
|||||||
case 'f': FIO_overwriteMode(); forceStdout=1; argument++; break;
|
case 'f': FIO_overwriteMode(); forceStdout=1; argument++; break;
|
||||||
|
|
||||||
/* Verbose mode */
|
/* Verbose mode */
|
||||||
case 'v': displayLevel++; argument++; break;
|
case 'v': g_displayLevel++; argument++; break;
|
||||||
|
|
||||||
/* Quiet mode */
|
/* Quiet mode */
|
||||||
case 'q': displayLevel--; argument++; break;
|
case 'q': g_displayLevel--; argument++; break;
|
||||||
|
|
||||||
/* keep source file (default); for gzip/xz compatibility */
|
/* keep source file (default); for gzip/xz compatibility */
|
||||||
case 'k': FIO_setRemoveSrcFile(0); argument++; break;
|
case 'k': FIO_setRemoveSrcFile(0); argument++; break;
|
||||||
@ -597,7 +597,7 @@ int main(int argCount, const char* argv[])
|
|||||||
/* Check if benchmark is selected */
|
/* Check if benchmark is selected */
|
||||||
if (operation==zom_bench) {
|
if (operation==zom_bench) {
|
||||||
#ifndef ZSTD_NOBENCH
|
#ifndef ZSTD_NOBENCH
|
||||||
BMK_setNotificationLevel(displayLevel);
|
BMK_setNotificationLevel(g_displayLevel);
|
||||||
BMK_setBlockSize(blockSize);
|
BMK_setBlockSize(blockSize);
|
||||||
BMK_setNbThreads(nbThreads);
|
BMK_setNbThreads(nbThreads);
|
||||||
BMK_setNbSeconds(bench_nbSeconds);
|
BMK_setNbSeconds(bench_nbSeconds);
|
||||||
@ -613,7 +613,7 @@ int main(int argCount, const char* argv[])
|
|||||||
if (cover) {
|
if (cover) {
|
||||||
coverParams.nbThreads = nbThreads;
|
coverParams.nbThreads = nbThreads;
|
||||||
coverParams.compressionLevel = dictCLevel;
|
coverParams.compressionLevel = dictCLevel;
|
||||||
coverParams.notificationLevel = displayLevel;
|
coverParams.notificationLevel = g_displayLevel;
|
||||||
coverParams.dictID = dictID;
|
coverParams.dictID = dictID;
|
||||||
DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, NULL, &coverParams, cover - 1);
|
DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, NULL, &coverParams, cover - 1);
|
||||||
} else {
|
} else {
|
||||||
@ -621,7 +621,7 @@ int main(int argCount, const char* argv[])
|
|||||||
memset(&dictParams, 0, sizeof(dictParams));
|
memset(&dictParams, 0, sizeof(dictParams));
|
||||||
dictParams.compressionLevel = dictCLevel;
|
dictParams.compressionLevel = dictCLevel;
|
||||||
dictParams.selectivityLevel = dictSelect;
|
dictParams.selectivityLevel = dictSelect;
|
||||||
dictParams.notificationLevel = displayLevel;
|
dictParams.notificationLevel = g_displayLevel;
|
||||||
dictParams.dictID = dictID;
|
dictParams.dictID = dictID;
|
||||||
DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, &dictParams, NULL, 0);
|
DiB_trainFromFiles(outFileName, maxDictSize, filenameTable, filenameIdx, &dictParams, NULL, 0);
|
||||||
}
|
}
|
||||||
@ -654,11 +654,11 @@ int main(int argCount, const char* argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* No status message in pipe mode (stdin - stdout) or multi-files mode */
|
/* No status message in pipe mode (stdin - stdout) or multi-files mode */
|
||||||
if (!strcmp(filenameTable[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (displayLevel==2)) displayLevel=1;
|
if (!strcmp(filenameTable[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (g_displayLevel==2)) g_displayLevel=1;
|
||||||
if ((filenameIdx>1) & (displayLevel==2)) displayLevel=1;
|
if ((filenameIdx>1) & (g_displayLevel==2)) g_displayLevel=1;
|
||||||
|
|
||||||
/* IO Stream/File */
|
/* IO Stream/File */
|
||||||
FIO_setNotificationLevel(displayLevel);
|
FIO_setNotificationLevel(g_displayLevel);
|
||||||
if (operation==zom_compress) {
|
if (operation==zom_compress) {
|
||||||
#ifndef ZSTD_NOCOMPRESS
|
#ifndef ZSTD_NOCOMPRESS
|
||||||
FIO_setNbThreads(nbThreads);
|
FIO_setNbThreads(nbThreads);
|
||||||
|
@ -57,7 +57,7 @@ static U32 g_displayLevel = 2;
|
|||||||
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
||||||
if ((FUZ_clockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
|
if ((FUZ_clockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
|
||||||
{ g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
{ g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (g_displayLevel>=4) fflush(stdout); } }
|
if (g_displayLevel>=4) fflush(stderr); } }
|
||||||
static const clock_t g_refreshRate = CLOCKS_PER_SEC / 6;
|
static const clock_t g_refreshRate = CLOCKS_PER_SEC / 6;
|
||||||
static clock_t g_displayClock = 0;
|
static clock_t g_displayClock = 0;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ static U32 g_displayLevel = 2;
|
|||||||
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
||||||
if ((FUZ_GetClockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
|
if ((FUZ_GetClockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
|
||||||
{ g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
{ g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (g_displayLevel>=4) fflush(stdout); } }
|
if (g_displayLevel>=4) fflush(stderr); } }
|
||||||
static const clock_t g_refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
static const clock_t g_refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
||||||
static clock_t g_displayClock = 0;
|
static clock_t g_displayClock = 0;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ static U32 g_displayLevel = 2;
|
|||||||
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
||||||
if ((FUZ_GetClockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
|
if ((FUZ_GetClockSpan(g_displayClock) > g_refreshRate) || (g_displayLevel>=4)) \
|
||||||
{ g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
{ g_displayClock = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (g_displayLevel>=4) fflush(stdout); } }
|
if (g_displayLevel>=4) fflush(stderr); } }
|
||||||
static const clock_t g_refreshRate = CLOCKS_PER_SEC / 6;
|
static const clock_t g_refreshRate = CLOCKS_PER_SEC / 6;
|
||||||
static clock_t g_displayClock = 0;
|
static clock_t g_displayClock = 0;
|
||||||
|
|
||||||
|
@ -73,13 +73,13 @@ static U32 g_compressibilityDefault = 50;
|
|||||||
#define DEFAULT_DISPLAY_LEVEL 2
|
#define DEFAULT_DISPLAY_LEVEL 2
|
||||||
#define DISPLAY(...) fprintf(displayOut, __VA_ARGS__)
|
#define DISPLAY(...) fprintf(displayOut, __VA_ARGS__)
|
||||||
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
||||||
static U32 g_displayLevel = DEFAULT_DISPLAY_LEVEL; /* 0 : no display; 1: errors; 2 : + result + interaction + warnings; 3 : + progression; 4 : + information */
|
static int g_displayLevel = DEFAULT_DISPLAY_LEVEL; /* 0 : no display; 1: errors; 2 : + result + interaction + warnings; 3 : + progression; 4 : + information */
|
||||||
static FILE* displayOut;
|
static FILE* displayOut;
|
||||||
|
|
||||||
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
||||||
if ((clock() - g_time > refreshRate) || (g_displayLevel>=4)) \
|
if ((clock() - g_time > refreshRate) || (g_displayLevel>=4)) \
|
||||||
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
{ g_time = clock(); DISPLAY(__VA_ARGS__); \
|
||||||
if (g_displayLevel>=4) fflush(stdout); } }
|
if (g_displayLevel>=4) fflush(displayOut); } }
|
||||||
static const clock_t refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
static const clock_t refreshRate = CLOCKS_PER_SEC * 15 / 100;
|
||||||
static clock_t g_time = 0;
|
static clock_t g_time = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user