From 519a9d0a8174c67c62bf4fa331cbad7a3cbb04dc Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Tue, 5 Jan 2010 13:43:00 +0100 Subject: [PATCH] Added factored-out 'warning_pre' function. --- src/error.c | 9 ++++++++- src/error.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/error.c b/src/error.c index cbe0ea3..be04a9a 100644 --- a/src/error.c +++ b/src/error.c @@ -96,6 +96,13 @@ error (char *fmt, ...) error_die (); } +//! Warning pre +void +warning_pre (void) +{ + printfstderr ("warning: "); +} + //! Print warning /** * Input is comparable to printf, only end of line is not required. @@ -106,7 +113,7 @@ warning (char *fmt, ...) va_list args; va_start (args, fmt); - printfstderr ("warning: "); + warning_pre (); vprintfstderr (fmt, args); printfstderr ("\n"); va_end (args); diff --git a/src/error.h b/src/error.h index adbb174..1f1f7ea 100644 --- a/src/error.h +++ b/src/error.h @@ -33,6 +33,7 @@ void error_die (void); void error_pre (void); void error_post (char *fmt, ...); void error (char *fmt, ...); +void warning_pre (void); void warning (char *fmt, ...); #endif