diff options
author | Pixel <pixel@nobis-crew.org> | 2011-12-04 01:19:09 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-12-04 01:20:10 -0800 |
commit | d440c3f50a918a932293ad98bcec96eaa4683222 (patch) | |
tree | 33e8e42a8e4506ae9da70cdb44dd133bde7f7219 /includes/Printer.h | |
parent | e5577eb7a643ce7885e5d14660a6d24254161622 (diff) |
Reworked some things in the architecture, mainly exceptions and asserts.
-) Removed Assert()
-) Added AAssert(), IAssert(), RAssert(), TAssert() and Failure()
-) Reworked all asserts in the code, and added meaningful messages to them.
-) Changed the way the startup code is generated; BALAU_STARTUP is no longer necessary.
Diffstat (limited to 'includes/Printer.h')
-rw-r--r-- | includes/Printer.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/Printer.h b/includes/Printer.h index e321557..b4001f1 100644 --- a/includes/Printer.h +++ b/includes/Printer.h @@ -56,14 +56,14 @@ class Printer { static Printer * getPrinter(); static void log(uint32_t level, const String & fmt, ...) { va_list ap; va_start(ap, fmt); vlog(level, fmt.to_charp(), ap); va_end(ap); } - static void log(uint32_t level, const char * fmt, ...) { va_list ap; va_start(ap, fmt); vlog(level, fmt, ap); va_end(ap); } - static void vlog(uint32_t level, const char * fmt, va_list ap) { getPrinter()->_log(level, fmt, ap); } + static void log(uint32_t level, const char * fmt, ...) __attribute__((format(printf, 2, 3))) { va_list ap; va_start(ap, fmt); vlog(level, fmt, ap); va_end(ap); } + static void vlog(uint32_t level, const char * fmt, va_list ap) __attribute__((format(printf, 2, 0))) { getPrinter()->_log(level, fmt, ap); } static void print(const String & fmt, ...) { va_list ap; va_start(ap, fmt); vprint(fmt.to_charp(), ap); va_end(ap); } - static void print(const char * fmt, ...) { va_list ap; va_start(ap, fmt); vprint(fmt, ap); va_end(ap); } - static void vprint(const char * fmt, va_list ap) { getPrinter()->_print(fmt, ap); } + static void print(const char * fmt, ...) __attribute__((format(printf, 1, 2))) { va_list ap; va_start(ap, fmt); vprint(fmt, ap); va_end(ap); } + static void vprint(const char * fmt, va_list ap) __attribute__((format(printf, 1, 0))) { getPrinter()->_print(fmt, ap); } #ifdef DEBUG - static void elog(uint32_t engine, const char * fmt, ...) { va_list ap; va_start(ap, fmt); getPrinter()->_log(M_ENGINE_DEBUG, fmt, ap); } + static void elog(uint32_t engine, const char * fmt, ...) __attribute__((format(printf, 2, 3))) { va_list ap; va_start(ap, fmt); getPrinter()->_log(M_ENGINE_DEBUG, fmt, ap); } #else static void elog(uint32_t engine, const char * fmt, ...) { } #endif |