summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/error.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-06-24 16:21:58 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-06-24 16:22:31 -0400
commit537b7695c26b9ad83ccc13b68c78a2fb27545d7e (patch)
treea801d360354343b92600df3e3eb255ff87ab8487 /libdimension/dimension/error.h
parent77237a2e22acfc3f8a028cd1a4d63b602cbbf45e (diff)
downloaddimension-537b7695c26b9ad83ccc13b68c78a2fb27545d7e.tar.xz
Fix some warnings found by clang.
Diffstat (limited to 'libdimension/dimension/error.h')
-rw-r--r--libdimension/dimension/error.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/libdimension/dimension/error.h b/libdimension/dimension/error.h
index f07261e..0561b8a 100644
--- a/libdimension/dimension/error.h
+++ b/libdimension/dimension/error.h
@@ -32,18 +32,15 @@
* Report a warning.
* @param[in] str A string to print explaining the warning.
*/
-#define dmnsn_warning(str) \
- dmnsn_report_error(false, DMNSN_FUNC, __FILE__, __LINE__, str)
+#define dmnsn_warning(str) \
+ dmnsn_report_warning(DMNSN_FUNC, __FILE__, __LINE__, str)
/**
* Report an error.
* @param[in] str A string to print explaining the error.
*/
-#define dmnsn_error(str) \
- do { \
- dmnsn_report_error(true, DMNSN_FUNC, __FILE__, __LINE__, str); \
- DMNSN_UNREACHABLE(); \
- } while (0)
+#define dmnsn_error(str) \
+ dmnsn_report_error(DMNSN_FUNC, __FILE__, __LINE__, str)
/**
* @def dmnsn_assert
@@ -75,15 +72,23 @@
/**
* @internal
- * Called by dmnsn_warning() and dmnsn_error(); don't call directly.
- * @param[in] die Whether the error is fatal.
+ * Called by dmnsn_warning(); don't call directly.
* @param[in] func The name of the function where the error originated.
* @param[in] file The file where the error originated.
* @param[in] line The line number where the error originated.
* @param[in] str A string describing the error.
*/
-void dmnsn_report_error(bool die, const char *func, const char *file,
- unsigned int line, const char *str);
+void dmnsn_report_warning(const char *func, const char *file, unsigned int line, const char *str);
+
+/**
+ * @internal
+ * Called by dmnsn_error(); don't call directly.
+ * @param[in] func The name of the function where the error originated.
+ * @param[in] file The file where the error originated.
+ * @param[in] line The line number where the error originated.
+ * @param[in] str A string describing the error.
+ */
+DMNSN_NORETURN dmnsn_report_error(const char *func, const char *file, unsigned int line, const char *str);
/**
* Treat warnings as errors.