From 97e479677f998ed02643804b37bf89e40a56a0cf Mon Sep 17 00:00:00 2001 From: jbj Date: Sun, 12 Nov 2000 10:02:54 +0000 Subject: [PATCH] Sanity. CVS patchset: 4257 CVS date: 2000/11/12 10:02:54 --- build/files.c | 2 +- build/parseSpec.c | 5 ++++- lib/rpmlib.h | 13 ++++++++----- lib/rpmlibprov.c | 23 +++++++++++------------ 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/build/files.c b/build/files.c index f2402f9..424f5c2 100644 --- a/build/files.c +++ b/build/files.c @@ -1411,7 +1411,7 @@ void initSourceHeader(Spec spec) { HeaderIterator hi; int tag, type, count; - void * ptr; + const void * ptr; spec->sourceHeader = headerNew(); /* Only specific tags are added to the source package header */ diff --git a/build/parseSpec.c b/build/parseSpec.c index f9791d0..d0a1da4 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -414,7 +414,7 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU while (parsePart != PART_NONE) { switch (parsePart) { - case PART_PREAMBLE: + case PART_PREAMBLE: parsePart = parsePreamble(spec, initialPackage); initialPackage = 0; break; @@ -448,6 +448,9 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU parsePart = parseFiles(spec); break; + case PART_NONE: /* XXX avoid gcc whining */ + case PART_BUILDARCHITECTURES: + break; } if (parsePart < 0) { diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 8041df5..29b06c2 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -137,7 +137,10 @@ extern const struct headerSprintfExtension rpmHeaderFormats[]; */ typedef enum rpmTag_e { - RPMTAG_HEADERIMAGE = HEADER_IMAGE, /*!< Header allocated image. */ + RPMTAG_HEADERIMAGE = HEADER_IMAGE, /*!< Current image. */ + RPMTAG_HEADERSIGNATURES = HEADER_SIGNATURES, /*!< Signatures. */ + RPMTAG_HEADERIMMUTABLE = HEADER_IMMUTABLE, /*!< Original image. */ + RPMTAG_HEADERREGIONS = HEADER_REGIONS, /*!< Regions. */ RPMTAG_HEADERI18NTABLE = HEADER_I18NTABLE, /*!< I18N string locales. */ @@ -915,8 +918,8 @@ typedef enum rpmtransFlags_e { * @retval address of array of rpmlib internal provide versions * @return no. of entries */ -int rpmGetRpmlibProvides(/*@out@*/ const char ***provNames, - /*@out@*/ int **provFlags, /*@out@*/ const char ***provVersions) +int rpmGetRpmlibProvides(/*@out@*/ const char *** provNames, + /*@out@*/ int ** provFlags, /*@out@*/ const char *** provVersions) /*@ modifies *provNames, *provFlags, *provVersions @*/; /** \ingroup rpmtrans @@ -1386,11 +1389,11 @@ typedef enum rpmVerifySignatureReturn_e { * @param sigTag type of signature * @param sig signature itself * @param count no. of bytes in signature - * @param result detailed text result of signature verification + * @retval result detailed text result of signature verification * @return result of signature verification */ rpmVerifySignatureReturn rpmVerifySignature(const char *file, - int_32 sigTag, void *sig, int count, char *result); + int_32 sigTag, const void * sig, int count, char *result); /** \ingroup signature * Destroy signature header from package. diff --git a/lib/rpmlibprov.c b/lib/rpmlibprov.c index e036df2..ca5a718 100644 --- a/lib/rpmlibprov.c +++ b/lib/rpmlibprov.c @@ -53,30 +53,29 @@ int rpmCheckRpmlibProvides(const char * keyName, const char * keyEVR, return rc; } -int rpmGetRpmlibProvides(const char ***provNames, int **provFlags, - const char ***provVersions) +int rpmGetRpmlibProvides(const char *** provNames, int ** provFlags, + const char *** provVersions) { - char **names, **versions; - int *flags; + const char ** names, ** versions; + int * flags; int n = 0; - while (rpmlibProvides[n++].featureName != NULL) - ; + while (rpmlibProvides[n].featureName != NULL) + n++; - names = xmalloc(sizeof(*names) * n); - versions = xmalloc(sizeof(*versions) * n); - flags = xmalloc(sizeof(*flags) * n); + names = xmalloc(sizeof(*names) * (n+1)); + versions = xmalloc(sizeof(*versions) * (n+1)); + flags = xmalloc(sizeof(*flags) * (n+1)); - n = 0; - while (rpmlibProvides[n].featureName != NULL) { + for (n = 0; rpmlibProvides[n].featureName != NULL; n++) { names[n] = rpmlibProvides[n].featureName; flags[n] = rpmlibProvides[n].featureFlags; versions[n] = rpmlibProvides[n].featureEVR; - n++; } names[n] = NULL; versions[n] = NULL; + flags[n] = -1; *provNames = names; *provFlags = flags; -- 2.7.4