+2018-05-23 Tom Tromey <tom@tromey.com>
+
+ * complaints.c (struct complaints): Remove.
+ (symfile_complaint_book): Remove.
+ (series): New global.
+ (complaint_internal): Update.
+ (clear_complaints): Update.
+
2018-05-23 Tom Tromey <tom@tromey.com>
* complaints.c (counters): New global.
static std::unordered_map<const char *, int> counters;
-struct complaints
-{
- enum complaint_series series;
-};
+/* How to print the next complaint. */
-static struct complaints symfile_complaint_book = {
- ISOLATED_MESSAGE
-};
+static complaint_series series;
/* How many complaints about a particular thing should be printed
before we stop whining about it? Default is no whining at all,
complaint_internal (const char *fmt, ...)
{
va_list args;
- enum complaint_series series;
if (counters[fmt]++ > stop_whining)
return;
va_start (args, fmt);
- series = symfile_complaint_book.series;
if (deprecated_warning_hook)
(*deprecated_warning_hook) (fmt, args);
counters.clear ();
if (!less_verbose)
- symfile_complaint_book.series = ISOLATED_MESSAGE;
+ series = ISOLATED_MESSAGE;
else
- symfile_complaint_book.series = SHORT_FIRST_MESSAGE;
+ series = SHORT_FIRST_MESSAGE;
}
static void