Hi Patrick,
On Jun 24, 2009, at 16:57 , Patrick Ohly wrote:
Regarding the code patches (attached for review), do
MAKETEXTWITHPROFILE() and PARSETEXTWITHPROFILE() really have an
*optional* mode parameter as the comment implies? I bet it will
crash if
the parameter is not passed because getLocalVar() returns NULL for
it.
getLocalVar() does not return NULL for it. The optional parameters are
always instantiated but have their default value (0 for integers,
empty string, etc.), and they have the isAssigned()==false status when
they are not passed in a call.
I noticed that I must update the parameter definition, otherwise I got
undefined behavior (reading past the end of the param array). I see
that
the "mode" parameter is really defined as optional. Does that mean
that
the source code doesn't have to check for NULL as return code of
getLocalVar()?
Yes. It will get a unassigned integer field, which returns a value of
0 when asked for getAsInteger().
Best Regards,
Lukas Zeller ([email protected])
-
Synthesis AG, SyncML Solutions & Sustainable Software Concepts
[email protected], http://www.synthesis.ch
_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis