From bb61fa21e8d93f74a568aec7426e086330d276b9 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 18 Dec 2007 11:56:54 +0200 Subject: [PATCH] Remove bogus const from rpmInstallSource*() parameters - spec and cookie are malloced and need to be freed by caller - unconst various other rpmQVK arguments & friends, no api exists to free them so caller needs to handle anyway --- lib/psm.c | 2 +- lib/rpmcli.h | 10 +++++----- lib/rpminstall.c | 2 +- lib/rpmlib.h | 4 ++-- rpmqv.c | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/psm.c b/lib/psm.c index 90a7abe..f4ce17b 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -243,7 +243,7 @@ static rpmRC markReplacedFiles(const rpmpsm psm) } rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, - const char ** specFilePtr, const char ** cookie) + char ** specFilePtr, char ** cookie) { int scareMem = 1; rpmfi fi = NULL; diff --git a/lib/rpmcli.h b/lib/rpmcli.h index 15a10d3..49cd3b0 100644 --- a/lib/rpmcli.h +++ b/lib/rpmcli.h @@ -241,7 +241,7 @@ struct rpmQVKArguments_s { QVF_t qva_showPackage; /*!< Function to display iterator matches. */ QSpecF_t qva_specQuery; /*!< Function to query spec file. */ int qva_verbose; /*!< (unused) */ - const char * qva_queryFormat;/*!< Format for headerSprintf(). */ + char * qva_queryFormat; /*!< Format for headerSprintf(). */ int sign; /*!< Is a passphrase needed? */ const char * passPhrase; /*!< Pass phrase. */ const char * qva_prefix; /*!< Path to top of install tree. */ @@ -390,10 +390,10 @@ int rpmcliVerify(rpmts ts, QVA_t qva, const char ** argv); struct rpmBuildArguments_s { rpmQueryFlags qva_flags; /*!< Bit(s) to control verification. */ int buildAmount; /*!< Bit(s) to control operation. */ - const char * buildRootOverride; /*!< from --buildroot */ + char * buildRootOverride; /*!< from --buildroot */ char * targets; /*!< Target platform(s), comma separated. */ const char * passPhrase; /*!< Pass phrase. */ - const char * cookie; /*!< NULL for binary, ??? for source, rpm's */ + char * cookie; /*!< NULL for binary, ??? for source, rpm's */ int force; /*!< from --force */ int noBuild; /*!< from --nobuild */ int noDeps; /*!< from --nodeps */ @@ -483,8 +483,8 @@ void * rpmShowProgress(const void * arg, * @return 0 on success */ int rpmInstallSource(rpmts ts, const char * arg, - const char ** specFilePtr, - const char ** cookie); + char ** specFilePtr, + char ** cookie); /** \ingroup rpmcli diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 0fd0eae..7759a33 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -798,7 +798,7 @@ exit: } int rpmInstallSource(rpmts ts, const char * arg, - const char ** specFilePtr, const char ** cookie) + char ** specFilePtr, char ** cookie) { FD_t fd; int rc; diff --git a/lib/rpmlib.h b/lib/rpmlib.h index f2cf38b..a8a330d 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -332,8 +332,8 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, * @return rpmRC return code */ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, - const char ** specFilePtr, - const char ** cookie); + char ** specFilePtr, + char ** cookie); /** \ingroup rpmtrans * Return copy of rpmlib internal provides. diff --git a/rpmqv.c b/rpmqv.c index b1bdf0f..4251b79 100644 --- a/rpmqv.c +++ b/rpmqv.c @@ -636,7 +636,7 @@ int main(int argc, char *argv[]) } while ((pkg = poptGetArg(optCon))) { - const char * specFile = NULL; + char * specFile = NULL; ba->cookie = NULL; ec = rpmInstallSource(ts, pkg, &specFile, &ba->cookie); -- 2.7.4