Hi Philippe,
While reviewing Fesapi’s code lately we noticed that the soap_new_T() functions are systematically called with 2nd parameter equal to ‘1’, like in:
resqml2__BinaryContactInterpretationPart* contact = soap_new_resqml2__BinaryContactInterpretationPart(org->soap, 1);
According to gSOAP’s documentation, ‘1’ means an array of one element:
T * soap_new_T(struct soap *soap, int n)
allocates and default-initializes and array of type T
, where n
= -1 allocates a single non-array value.
Even though this does not seem to be causing any issue, do you know why ‘-1’, which is actually the default value for that parameter, is not used instead?
Note: As far as I can see the code that gSOAP itself creates does use the default, like in:
SOAP_FMAC3 std::vector<gmd__MD_USCOREIdentifier_USCOREPropertyType *> * SOAP_FMAC4 soap_in_std__vectorTemplateOfPointerTogmd__MD_USCOREIdentifier_USCOREPropertyType(struct soap *soap, const char *tag, std::vector<gmd__MD_USCOREIdentifier_USCOREPropertyType *> *a, const char type)
{
(void)type; / appease -Wall -Werror */
short soap_flag;
for (soap_flag = 0;; soap_flag = 1)
{
if (tag && *tag != ‘-’)
{ if (soap_element_begin_in(soap, tag, 1, NULL))
break;
soap_revert(soap);
}
if (!a && !(a = soap_new_std__vectorTemplateOfPointerTogmd__MD_USCOREIdentifier_USCOREPropertyType(soap)))