summaryrefslogtreecommitdiff
path: root/src/common/nullpo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/nullpo.c')
-rw-r--r--src/common/nullpo.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/common/nullpo.c b/src/common/nullpo.c
index f0fc2c7ab..20180dd3b 100644
--- a/src/common/nullpo.c
+++ b/src/common/nullpo.c
@@ -4,20 +4,26 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
-#include "nullpo.h"
+#include "../common/nullpo.h"
#include "../common/showmsg.h"
/**
- * Reports NULL pointer information
+ * Reports failed assertions or NULL pointers
+ *
+ * @param file Source file where the error was detected
+ * @param line Line
+ * @param func Function
+ * @param targetname Name of the checked symbol
+ * @param title Message title to display (i.e. failed assertion or nullpo info)
*/
-void nullpo_info(const char *file, int line, const char *func, const char *targetname) {
+void assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
if (file == NULL)
file = "??";
if (func == NULL || *func == '\0')
func = "unknown";
- ShowMessage("--- nullpo info --------------------------------------------\n");
- ShowMessage("%s:%d: target '%s' in func `%s'\n", file, line, targetname, func);
- ShowMessage("--- end nullpo info ----------------------------------------\n");
+ ShowError("--- %s --------------------------------------------\n", title);
+ ShowError("%s:%d: '%s' in function `%s'\n", file, line, targetname, func);
+ ShowError("--- end %s ----------------------------------------\n", title);
}