#define ABORT_TRACE() \
fprintf (stderr, "Aborting in source file %s, line %u\n", __FILE__, __LINE__); \
- abort (); \
+ abort ();
#define CHECK_COLORS_RANDOM(color1, color2) \
streq (color_names[color1]->name, "random") \
&& (streq (color_names[color2]->name, "none") \
- || streq (color_names[color2]->name, "default")) \
+ || streq (color_names[color2]->name, "default"))
#define ALLOC_COMPLETE_PART_LINE 8
vfprintf_fail (formats[FMT_GENERIC], "--clean and --clean-all switch are mutually exclusive");
if (arg_cnt > 1)
{
- const char *format = "%s %s";
- const char *message = "switch cannot be used with more than one file";
+ const char *const format = "%s %s";
+ const char *const message = "switch cannot be used with more than one file";
if (clean)
vfprintf_fail (format, "--clean", message);
else if (clean_all)
#define PRINT_HELP_EXIT() \
print_help (); \
- exit (EXIT_SUCCESS); \
+ exit (EXIT_SUCCESS);
#define PRINT_VERSION_EXIT() \
print_version (); \
- exit (EXIT_SUCCESS); \
+ exit (EXIT_SUCCESS);
extern char *optarg;
int ret;
char *p;
struct stat sb;
- struct color_name *color_names[3] = { NULL, NULL, NULL };
+ struct color_name *color_names[3] = {
+ NULL, /* foreground */
+ NULL, /* background */
+ NULL, /* sentinel value */
+ };
const char *color_string = arg_cnt >= 1 ? arg_strings[0] : NULL;
const char *file_string = arg_cnt == 2 ? arg_strings[1] : NULL;
}
else if (*eol == '\n')
flags |= LF;
- else
+ else /* never reached */
vfprintf_fail (formats[FMT_FILE], file, "unrecognized line ending");
p = eol + SKIP_LINE_ENDINGS (flags);
*eol = '\0';
va_start (ap, fmt); \
vfprintf (stderr, fmt, ap); \
va_end (ap); \
- fprintf (stderr, "\n"); \
+ fprintf (stderr, "\n");
static void
vfprintf_diag (const char *fmt, ...)