Skip to content

Commit

Permalink
kram - remove fflush use from ext code
Browse files Browse the repository at this point in the history
  • Loading branch information
alecazam committed Dec 13, 2024
1 parent 1ac83d8 commit b304ede
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions libkram/simdjson/simdjson.h
Original file line number Diff line number Diff line change
Expand Up @@ -27249,7 +27249,7 @@ inline void log_headers() noexcept {
printf("|%.*s", 5+2, DASHES);
printf("|--------");
printf("|\n");
fflush(stdout);
// fflush(stdout);
}
}

Expand Down Expand Up @@ -27287,7 +27287,7 @@ inline void log_line(const json_iterator &iter, token_position index, depth_t de
printf("| %5i ", depth);
printf("| %.*s ", int(detail.size()), detail.data());
printf("|\n");
fflush(stdout);
// fflush(stdout);
}
}

Expand Down
27 changes: 15 additions & 12 deletions libkram/zstd/zstd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35865,11 +35865,12 @@ void COVER_dictSelectionFree(COVER_dictSelection_t selection);
static int g_displayLevel = 2;
#endif
#undef DISPLAY
#define DISPLAY(...) \
{ \
fprintf(stderr, __VA_ARGS__); \
fflush(stderr); \
}
#define DISPLAY(fmt, ...) KLOGI("zstd", fmt, ##__VA_ARGS__)
//#define DISPLAY(...) \
// { \
// fprintf(stderr, __VA_ARGS__); \
// fflush(stderr); \
// }
#undef LOCALDISPLAYLEVEL
#define LOCALDISPLAYLEVEL(displayLevel, l, ...) \
if (displayLevel >= l) { \
Expand Down Expand Up @@ -39095,11 +39096,12 @@ divbwt(const unsigned char *T, unsigned char *U, int *A, int n, unsigned char *
static int g_displayLevel = 2;
#endif
#undef DISPLAY
#define DISPLAY(...) \
{ \
fprintf(stderr, __VA_ARGS__); \
fflush(stderr); \
}
#define DISPLAY(fmt, ...) KLOGI("zstd", fmt, ##__VA_ARGS__)
//#define DISPLAY(...) \
// { \
// fprintf(stderr, __VA_ARGS__); \
// fflush(stderr); \
// }
#undef LOCALDISPLAYLEVEL
#define LOCALDISPLAYLEVEL(displayLevel, l, ...) \
if (displayLevel >= l) { \
Expand Down Expand Up @@ -39883,7 +39885,8 @@ static const U32 g_selectivity_default = 9;
* Console display
***************************************/
#undef DISPLAY
#define DISPLAY(...) { fprintf(stderr, __VA_ARGS__); fflush( stderr ); }
#define DISPLAY(fmt, ...) KLOGI("zstd", fmt, ##__VA_ARGS__)
// #define DISPLAY(...) { fprintf(stderr, __VA_ARGS__); fflush( stderr ); }
#undef DISPLAYLEVEL
#define DISPLAYLEVEL(l, ...) if (notificationLevel>=l) { DISPLAY(__VA_ARGS__); } /* 0 : no display; 1: errors; 2: default; 3: details; 4: debug */

Expand Down Expand Up @@ -40348,7 +40351,7 @@ static size_t ZDICT_trainBuffer_legacy(dictItem* dictList, U32 dictListSize,
# define DISPLAYUPDATE(l, ...) if (notificationLevel>=l) { \
if (ZDICT_clockSpan(displayClock) > refreshRate) \
{ displayClock = clock(); DISPLAY(__VA_ARGS__); \
if (notificationLevel>=4) fflush(stderr); } }
} }

/* init */
DISPLAYLEVEL(2, "\r%70s\r", ""); /* clean display line */
Expand Down

0 comments on commit b304ede

Please sign in to comment.