From 94ea5ee25f0d341274d204907d35233117e0f671 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 28 Oct 2010 12:01:42 +0300 Subject: [PATCH] Fix the remaining enum abuse over rpmParseState in librpmbuild - rpmParseState uses might actually qualify for a true enum here but changing it would require changing half of librpmbuild and many of them mix the parse states, other error codes and whatnot in their types... just not worth the trouble, so use an int. --- build/parseBuildInstallClean.c | 2 +- build/parseSpec.c | 4 ++-- build/rpmbuild_internal.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c index 5eb8fe6..6386c23 100644 --- a/build/parseBuildInstallClean.c +++ b/build/parseBuildInstallClean.c @@ -9,7 +9,7 @@ #include "debug.h" -int parseBuildInstallClean(rpmSpec spec, rpmParseState parsePart) +int parseBuildInstallClean(rpmSpec spec, int parsePart) { int nextPart, rc, res = PART_ERROR; StringBuf *sbp = NULL; diff --git a/build/parseSpec.c b/build/parseSpec.c index 75e1d9d..3f912dd 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -61,7 +61,7 @@ static const struct PartRec { {0, 0, 0} }; -rpmParseState isPart(const char *line) +int isPart(const char *line) { const struct PartRec *p; @@ -520,7 +520,7 @@ static void addTargets(Package Pkgs) static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, const char *buildRoot, int recursing) { - rpmParseState parsePart = PART_PREAMBLE; + int parsePart = PART_PREAMBLE; int initialPackage = 1; rpmSpec spec; diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h index 3df9f06..1c58870 100644 --- a/build/rpmbuild_internal.h +++ b/build/rpmbuild_internal.h @@ -210,7 +210,7 @@ int readLine(rpmSpec spec, int strip); * @return next parser state */ RPM_GNUC_INTERNAL -rpmParseState isPart(const char * line) ; +int isPart(const char * line) ; /** \ingroup rpmbuild * Parse %%build/%%install/%%clean section(s) of a spec file. @@ -219,7 +219,7 @@ rpmParseState isPart(const char * line) ; * @return >= 0 next rpmParseState, < 0 on error */ RPM_GNUC_INTERNAL -int parseBuildInstallClean(rpmSpec spec, rpmParseState parsePart); +int parseBuildInstallClean(rpmSpec spec, int parsePart); /** \ingroup rpmbuild * Parse %%changelog section of a spec file. -- 2.7.4