On Fri, 14 Feb 2014 06:25:38 -0500, Hugh McMaster wrote:
- Silent handling: Many times, it refers Silent variable before
calling output_write function. How about moving the check to the function?
Do you mean that I should add the Silent boolean value as a variable in the function call?
No. I meant:
[Existing code] static int some_function(void) { /* ... */ if (Silent) { output_write(STRING_FOO); output_write(STRING_BAR); } /* ... */ }
[My idea] static int some_function(void) { /* ... */ output_write(STRING_FOO); output_write(STRING_BAR); /* ... */ }
static void __cdecl output_write(UINT id, ...) { /* variable declarations */
if (Silent) return; /* do nothing */
/* then, LoadString, FormatMessage, etc. */ }
Does this work for you?