[Libvirt-cim] [PATCH 1 of 2] [CU] Add embedded object parse functionality to std_invokemethod
Dan Smith
danms at us.ibm.com
Tue Jan 29 16:09:18 UTC 2008
KR> +static int parse_eo_array(CMPIArray *strings_in,
KR> + CMPIArray **instances_out,
KR> + const CMPIBroker *broker,
KR> + const char *ns,
KR> + CMPIStatus *s)
KR> +{
KR> + int i;
KR> + int ret;
KR> + int count;
KR> +
KR> + if (CMIsNullObject(strings_in)) {
KR> + CMSetStatus(s, CMPI_RC_ERR_INVALID_PARAMETER);
KR> + CU_DEBUG("Method parameter is NULL");
KR> + return 0;
KR> + }
KR> +
KR> + count = CMGetArrayCount(strings_in, NULL);
If you're not going to allocate the CMPIArray in here, then you don't
need a double pointer for it :). I'd say either allocate it here, or
change it to a single pointer.
I think in my previous example I had used a double-pointer to match
the call and behavior of the single-instance case, since it allocates
the instance at the next level up.
Either way is fine, but both require a change :)
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms at us.ibm.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-cim/attachments/20080129/efdf4c7e/attachment.sig>
More information about the Libvirt-cim
mailing list