<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Would this be okay?<br>
<br>
CLAM_ENFORCE(infile->samplerate() == sampleRate) << "All the
input audio files have to have the same sample rate";<br>
<br>
And remove the exit(1)'s from the code ...<br>
<br>
I can add Assert.hxx to Enforce.hxx, so instead of doing it's own
thing, it could <br>
- set it's own AssertFailedHandlerType<br>
- call ExecuteAssertFailedHandler<br>
<br>
A backtrace might be usefull, but then I need to make the DumpBacktrace
public.<br>
<br>
D<br>
<br>
<br>
<br>
<br>
<blockquote cite="mid:200906091216.53429.dgarcia@iua.upf.edu"
type="cite">
<pre wrap="">A Dimarts, 9 de juny de 2009 10:09:17, dirk.griffioen va escriure:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">But, of course, if this implies a change in the user code, in something
that is as ubiquitous as CLAM_ASSERT, that's not a solution unless it
pays the price.
</pre>
</blockquote>
<pre wrap="">What if I rename ENFORCE to CLAM_ASSERT_MSG?
You get lines like:
CLAM_ASSERT_MSG(jack_client_close(jackClient) == 0) ("JACK_ERROR: cannot
close client");
</pre>
</blockquote>
<pre wrap=""><!---->
It would be a nice addition. I would prefer the insertion operator than the
call operator. This way we can easily turn regular traces into assertions.
</pre>
<blockquote type="cite">
<pre wrap="">Or should there be a tighter fit to the current CLAM_ASSERT?
</pre>
</blockquote>
<pre wrap=""><!---->
I guess that the behaviour regarding aborting, throwing, callbacks... should
be the same of the CLAM_ASSERT just to keep consistency on the handling.
Maybe that is not the behaviour you want for the network players. In those
case we should create a diagnosis protocol for the backends: typed exceptions,
diagnosis methods or return values, whatever it fits the better in the usage.
</pre>
<blockquote type="cite">
<pre wrap="">(For the record, I am not proposing to redo all, just start small by using
this where applicable).
</pre>
</blockquote>
<pre wrap=""><!---->
Perfect then.
</pre>
</blockquote>
<br>
</body>
</html>