From 537b7695c26b9ad83ccc13b68c78a2fb27545d7e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 24 Jun 2014 16:21:58 -0400 Subject: Fix some warnings found by clang. --- libdimension/dimension/error.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'libdimension/dimension/error.h') 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. -- cgit v1.2.3