From: Panu Matilainen Date: Thu, 6 Mar 2008 18:47:17 +0000 (+0200) Subject: Make yet more build tables readonly X-Git-Tag: rpm-4.6.0-rc1~1043 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e7bc88eda21acdee7552980738cbded4831f950;p=platform%2Fupstream%2Frpm.git Make yet more build tables readonly - preambleList and partList are modified runtime for silly reasons, reminders to fix later.. --- diff --git a/build/pack.c b/build/pack.c index f8c23d3..f7be4b5 100644 --- a/build/pack.c +++ b/build/pack.c @@ -593,7 +593,7 @@ exit: return rc; } -static rpmTag copyTags[] = { +static const rpmTag copyTags[] = { RPMTAG_CHANGELOGTIME, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 589da70..656d115 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -107,14 +107,14 @@ static inline int parseYesNo(const char * s) ? 0 : 1); } -typedef struct tokenBits_s { +typedef const struct tokenBits_s { const char * name; rpmsenseFlags bits; } * tokenBits; /** */ -static struct tokenBits_s installScriptBits[] = { +static struct tokenBits_s const installScriptBits[] = { { "interp", RPMSENSE_INTERP }, { "prereq", RPMSENSE_PREREQ }, { "preun", RPMSENSE_SCRIPT_PREUN }, @@ -128,7 +128,7 @@ static struct tokenBits_s installScriptBits[] = { /** */ -static struct tokenBits_s buildScriptBits[] = { +static const struct tokenBits_s const buildScriptBits[] = { { "prep", RPMSENSE_SCRIPT_PREP }, { "build", RPMSENSE_SCRIPT_BUILD }, { "install", RPMSENSE_SCRIPT_INSTALL }, @@ -296,7 +296,7 @@ static int checkForDuplicates(Header h, const char * NVR) static struct optionalTag { rpmTag ot_tag; const char * ot_mac; -} optionalTags[] = { +} const optionalTags[] = { { RPMTAG_VENDOR, "%{vendor}" }, { RPMTAG_PACKAGER, "%{packager}" }, { RPMTAG_DISTRIBUTION, "%{distribution}" }, @@ -308,7 +308,7 @@ static struct optionalTag { */ static void fillOutMainPackage(Header h) { - struct optionalTag *ot; + const struct optionalTag *ot; for (ot = optionalTags; ot->ot_mac != NULL; ot++) { if (!headerIsEntry(h, ot->ot_tag)) { @@ -683,6 +683,7 @@ typedef struct PreambleRec_s { const char * token; } * PreambleRec; +/* XXX FIXME: strlen for these is calculated at runtime, preventing const */ static struct PreambleRec_s preambleList[] = { {RPMTAG_NAME, 0, 0, 0, "name"}, {RPMTAG_VERSION, 0, 0, 0, "version"}, diff --git a/build/parseSpec.c b/build/parseSpec.c index 68ec848..690166b 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -17,8 +17,7 @@ #define SKIPSPACE(s) { while (*(s) && xisspace(*(s))) (s)++; } #define SKIPNONSPACE(s) { while (*(s) && !xisspace(*(s))) (s)++; } -/** - */ +/* XXX FIXME: strlen for these is calculated at runtime, preventing const */ static struct PartRec { int part; size_t len;