Make yet more build tables readonly
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 6 Mar 2008 18:47:17 +0000 (20:47 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 6 Mar 2008 18:47:17 +0000 (20:47 +0200)
- preambleList and partList are modified runtime for silly reasons,
  reminders to fix later..

build/pack.c
build/parsePreamble.c
build/parseSpec.c

index f8c23d3..f7be4b5 100644 (file)
@@ -593,7 +593,7 @@ exit:
     return rc;
 }
 
-static rpmTag copyTags[] = {
+static const rpmTag copyTags[] = {
     RPMTAG_CHANGELOGTIME,
     RPMTAG_CHANGELOGNAME,
     RPMTAG_CHANGELOGTEXT,
index 589da70..656d115 100644 (file)
@@ -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"},
index 68ec848..690166b 100644 (file)
@@ -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;