Frank Schönheit - Sun Microsystems Germany wrote:
Hi Kay,
Sorry for the (may be stupid) question, but why not just change
OSL_VERIFY to emit nothing, in case OSL_DEBUG_LEVEL == 0? I would expect
that only weird code would relay on the evaluation in case of a zero
debug level.
Why "weird"? The alternative is something like
#if OSL_DEBUG_LEVEL > 0
bool result =
#endif
callSomeFooWhichSignalsSuccess( bar );
OSL_ENSURE( result, "this was expected to succeed!" );
I definately think that
OSL_VERIFY( callSomeFooWhichSignalsSuccess( bar ) );
is the better (non-weird) alternative here.
And these case can probably easily be changed to something
with "assert" (or ensure).
OK, my fault. This (again) would lead to discuss error handling. Which I
really don't want to do know. So, please forget what I said.
Please show me the easy (!) replacement of the above OSL_VERIFY :)
Or did I completely misunderstand you and you only suggested to replace
the occurences of OSL_VERIFY( a == b )?
Obviously these cases should be replaced with an assert/ensure,
shouldn't they? But you are right, they are probably rare.
And when we are on it, what are the differences / purposes between
- OSL_VERIFY
- OSL_ENSURE
- OSL_ASSERT
? Couldn't we consolidate to just _one_ macro. E.g. OSL_ENSURE because
of the passed message?
Oh, while we're at it, let me throw in one of my favourites: Shouldn't
we consolidate the DBG_* and OSL_* diagnostics macros?
YES, YES, YES. May be you have some time the next weeks, to dive into
more details?
Ciao
Frank
Kay
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]