Skip to content

Commit

Permalink
Fix tidy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jun 24, 2024
1 parent bbf9249 commit fb3909f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Checks: "clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,-mo
WarningsAsErrors: true
HeaderFilterRegex: ""
FormatStyle: google
ExtraArgsBefore: ["--std=c11"]
14 changes: 9 additions & 5 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@
#define unused_attr
#endif

#ifndef fprintf_s
#define fprintf_s fprintf // NOLINT
#endif

#ifdef DEBUG_PRINT
#define dbg_print(...) \
do { \
fprintf_s(stderr, " \033[96;1mparse: \033[0m"); \
fprintf_s(stderr, __VA_ARGS__); \
fprintf_s(stderr, " \033[96;1mparse: \033[0m"); \
fprintf_s(stderr, __VA_ARGS__); \
} while (0)
#else
#define dbg_print(...)
#endif

#define panic(...) \
do { \
fprintf_s(stderr, "panic at %s:%d: ", __FILE_NAME__, __LINE__); \
fprintf_s(stderr, __VA_ARGS__); \
fprintf_s(stderr, "\n"); \
fprintf_s(stderr, "panic at %s:%d: ", __FILE_NAME__, __LINE__); \
fprintf_s(stderr, __VA_ARGS__); \
fprintf_s(stderr, "\n"); \
exit(1); \
} while (0);

Expand Down

0 comments on commit fb3909f

Please sign in to comment.