Added factored-out 'warning_pre' function.

This commit is contained in:
Cas Cremers 2010-01-05 13:43:00 +01:00
parent a7f68bcb40
commit 519a9d0a81
2 changed files with 9 additions and 1 deletions

View File

@ -96,6 +96,13 @@ error (char *fmt, ...)
error_die (); error_die ();
} }
//! Warning pre
void
warning_pre (void)
{
printfstderr ("warning: ");
}
//! Print warning //! Print warning
/** /**
* Input is comparable to printf, only end of line is not required. * Input is comparable to printf, only end of line is not required.
@ -106,7 +113,7 @@ warning (char *fmt, ...)
va_list args; va_list args;
va_start (args, fmt); va_start (args, fmt);
printfstderr ("warning: "); warning_pre ();
vprintfstderr (fmt, args); vprintfstderr (fmt, args);
printfstderr ("\n"); printfstderr ("\n");
va_end (args); va_end (args);

View File

@ -33,6 +33,7 @@ void error_die (void);
void error_pre (void); void error_pre (void);
void error_post (char *fmt, ...); void error_post (char *fmt, ...);
void error (char *fmt, ...); void error (char *fmt, ...);
void warning_pre (void);
void warning (char *fmt, ...); void warning (char *fmt, ...);
#endif #endif