This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1570/ |
Apart from those minor issues it looks good to me.
src/software-dbus/LMI_MemberOfSoftwareCollectionProvider.c (Diff revision 3) | |||
---|---|---|---|
static CMPIStatus LMI_MemberOfSoftwareCollectionEnumInstances( |
|||
46 | _cb, mi, cc, cr, cop, properties); |
137 | LMI_MemberOfSoftwareCollection_InitFromObjectPath(&w, _cb, cop); |
cop should be checked for validity. Referred SoftwareIdentity and SystemSoftwareCollection instances have to exist.
src/software-dbus/sw-utils.c (Diff revision 3) | |||
---|---|---|---|
311 | if (array2) { |
||
312 | for (k = 0; k < array2->len; k++) { |
||
313 | pk_det = g_ptr_array_index(array2, k); |
||
314 | if (strcmp(pk_package_get_id(pk_pkg), |
||
315 | pk_details_get_package_id(pk_det)) == 0) { |
||
316 | found = 1; |
||
317 | break; |
||
318 | } |
||
319 | } |
||
320 | if (!found) { |
||
321 | pk_det = NULL; |
||
322 | } |
||
323 | } |
I don't see a reason for sorting the array while it the end it's iterated from the beginning until corresponding details are found. What about having index (a2i = 0) initialized outside of the loop and incrementing by one for each array1 package: if (array2) { do { pk_det = g_ptr_array_index(array2, a2i); cmpres = strcmp(pk_package_get_id(pk_pkg), pk_details_get_package_id(pk_det)); if (cmpres > 0) { // this should not happen - we have spare unmatched package details ++a2i; } else if (cmpres < 0) { // no matching package details for current pk_pkg pk_det = NULL; } } while (cmpres > 0); ++a2i; }
- Michal Minar
On April 3rd, 2014, 4:33 p.m. UTC, Peter Schiffer wrote:
Review request for OpenLMI Developers.
By Peter Schiffer.
Updated April 3, 2014, 4:33 p.m.
Repository:
openlmi-providers
Description
Diffs
|