diff options
-rw-r--r-- | archival/rpm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/archival/rpm.c b/archival/rpm.c index 30cdc93fb..41c6129ad 100644 --- a/archival/rpm.c +++ b/archival/rpm.c | |||
@@ -260,12 +260,16 @@ rpm_index **rpm_gettags(int fd, int *num_tags) | |||
260 | int bsearch_rpmtag(const void *key, const void *item) | 260 | int bsearch_rpmtag(const void *key, const void *item) |
261 | { | 261 | { |
262 | rpm_index **tmp = (rpm_index **) item; | 262 | rpm_index **tmp = (rpm_index **) item; |
263 | /* gcc throws warnings here when sizeof(void*)!=sizeof(int) ... | ||
264 | * it's ok to ignore it because this isn't a 'real' pointer */ | ||
263 | return ((int) key - tmp[0]->tag); | 265 | return ((int) key - tmp[0]->tag); |
264 | } | 266 | } |
265 | 267 | ||
266 | int rpm_getcount(int tag) | 268 | int rpm_getcount(int tag) |
267 | { | 269 | { |
268 | rpm_index **found; | 270 | rpm_index **found; |
271 | /* gcc throws warnings here when sizeof(void*)!=sizeof(int) ... | ||
272 | * it's ok to ignore it because tag won't be used as a pointer */ | ||
269 | found = bsearch((void *) tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag); | 273 | found = bsearch((void *) tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag); |
270 | if (!found) return 0; | 274 | if (!found) return 0; |
271 | else return found[0]->count; | 275 | else return found[0]->count; |
@@ -274,6 +278,8 @@ int rpm_getcount(int tag) | |||
274 | char *rpm_getstring(int tag, int itemindex) | 278 | char *rpm_getstring(int tag, int itemindex) |
275 | { | 279 | { |
276 | rpm_index **found; | 280 | rpm_index **found; |
281 | /* gcc throws warnings here when sizeof(void*)!=sizeof(int) ... | ||
282 | * it's ok to ignore it because tag won't be used as a pointer */ | ||
277 | found = bsearch((void *) tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag); | 283 | found = bsearch((void *) tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag); |
278 | if (!found || itemindex >= found[0]->count) return NULL; | 284 | if (!found || itemindex >= found[0]->count) return NULL; |
279 | if (found[0]->type == RPM_STRING_TYPE || found[0]->type == RPM_I18NSTRING_TYPE || found[0]->type == RPM_STRING_ARRAY_TYPE) { | 285 | if (found[0]->type == RPM_STRING_TYPE || found[0]->type == RPM_I18NSTRING_TYPE || found[0]->type == RPM_STRING_ARRAY_TYPE) { |
@@ -288,6 +294,8 @@ int rpm_getint(int tag, int itemindex) | |||
288 | { | 294 | { |
289 | rpm_index **found; | 295 | rpm_index **found; |
290 | int n, *tmpint; | 296 | int n, *tmpint; |
297 | /* gcc throws warnings here when sizeof(void*)!=sizeof(int) ... | ||
298 | * it's ok to ignore it because tag won't be used as a pointer */ | ||
291 | found = bsearch((void *) tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag); | 299 | found = bsearch((void *) tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag); |
292 | if (!found || itemindex >= found[0]->count) return -1; | 300 | if (!found || itemindex >= found[0]->count) return -1; |
293 | tmpint = (int *) (map + found[0]->offset); | 301 | tmpint = (int *) (map + found[0]->offset); |