RPMTAG_NOT_FOUND being -1 while all the valid data is unsigned causes all manner of headaches throughout the code in the form of type mismatches and potential associated bugs. Zero makes for a much nicer not-found value, shuffle things around a little to make this possible.
The caveat of course is that RPMTAG_NOT_FOUND has been -1 forever and so there may be code testing for < 0 rather than the explicit value. Thoughts? You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/2390 -- Commit Summary -- * Fix some non-functional signed integer references to unsigned * Switch all header entryinfo pointers from int32_t to uint32_t * Switch header index and datalength types from int32_t to uint32_t * Switch header region index and data lengths to unsigned integers * Refactor regionSwab() to return the length through a pointer * Refactor dataLength() to return the length through a pointer * Switch regionSwab() length return type to unsigned, update callers * Refactor strtaglen() to return the length through a pointer * Switch the various header data length arguments to unsigned * Use proper type for copyTagsFromMainDebug * Move RPMTAG_NOT_FOUND out of the rpmTag enum into a macro * Bump RPMDBI_PACKAGES enum from 0 to 1 * Fix rpmTagGetValue() error return documentation * Redefine RPMTAG_NOT_FOUND as 0 now that we can -- File Changes -- M build/files.c (2) M include/rpm/rpmtag.h (7) M lib/header.c (178) M lib/header_internal.h (12) M lib/package.c (2) M lib/query.c (2) -- Patch Links -- https://github.com/rpm-software-management/rpm/pull/2390.patch https://github.com/rpm-software-management/rpm/pull/2390.diff -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2390 You are receiving this because you are subscribed to this thread. Message ID: <rpm-software-management/rpm/pull/2...@github.com>
_______________________________________________ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint