fix: missed level of indirection in i18nTag().
authorjbj <devnull@localhost>
Wed, 23 Feb 2000 01:48:51 +0000 (01:48 +0000)
committerjbj <devnull@localhost>
Wed, 23 Feb 2000 01:48:51 +0000 (01:48 +0000)
CVS patchset: 3579
CVS date: 2000/02/23 01:48:51

build/rpmspec.h
lib/formats.c
lib/header.c
po/rpm.pot
scripts/Makefile.am
scripts/Makefile.in

index 2c82f34..57bfa82 100644 (file)
@@ -179,7 +179,7 @@ struct PackageStruct {
 
     /*@only@*/ struct TriggerFileEntry *triggerFiles;
 
-    /*@only@*/ char *fileFile;
+    /*@only@*/ const char *fileFile;
     /*@only@*/ StringBuf fileList; /* If NULL, package will not be written */
 
     /*@dependent@*/ struct PackageStruct *next;
index 18fe85b..3e12af7 100644 (file)
@@ -177,7 +177,7 @@ static int instprefixTag(Header h, /*@out@*/ int_32 * type,
 {
     char ** array;
 
-    if (headerGetEntry(h, RPMTAG_INSTALLPREFIX, type, data, count)) {
+    if (headerGetEntry(h, RPMTAG_INSTALLPREFIX, type, (void **)data, count)) {
        *freeData = 0;
        return 0;
     } else if (headerGetEntry(h, RPMTAG_INSTPREFIXES, NULL, (void **) &array, 
@@ -359,9 +359,9 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
        /*@out@*/ int * freeData)
 {
 #ifdef NOTYET
-    const char * domains = "specs:powertools";
+    const char * rpm_query_domains = "specs:powertools";
 #else
-    const char * domains = NULL;
+    const char * rpm_query_domains = NULL;
 #endif
     int rc;
 
@@ -370,7 +370,7 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
     *count = 0;
     *freeData = 0;
 
-    if (domains) {
+    if (rpm_query_domains) {
        char * dstring, *domain, *de;
        const char * locale;
        char * msgkey;
@@ -384,14 +384,14 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
 
        msgid = NULL;
        locale = setlocale(LC_MESSAGES, "C");
-       dstring = xstrdup(domains);
+       dstring = xstrdup(rpm_query_domains);
        for (domain = dstring; domain != NULL; domain = de) {
            de = strchr(domain, ':');
            if (de) *de++ = '\0';
            msgid = /*@-unrecog@*/ dgettext(domain, msgkey) /*@=unrecog@*/;
            if (msgid != msgkey) break;
        }
-       setlocale(LC_MESSAGES, locale);
+       (void) setlocale(LC_MESSAGES, locale);
 
        if (domain && msgid) {
            *data = xstrdup(/*@-unrecog@*/ dgettext(domain, msgid) /*@=unrecog@*/);
@@ -402,10 +402,10 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
        return (*data ? 0 : 1);
     }
 
-    rc = headerGetEntry(h, tag, type, data, count);
+    rc = headerGetEntry(h, tag, type, (void **)data, count);
 
     if (rc) {
-       data = xstrdup(*data);
+       *data = xstrdup(*data);
        *freeData = 1;
        return 0;
     }
index 3e98ae7..f589d98 100644 (file)
@@ -83,7 +83,7 @@ struct extensionCache {
     int_32 count;
     int avail;
     int freeit;
-    void * data;
+    const void * data;
 };
 
 struct sprintfToken {
@@ -1143,7 +1143,7 @@ static void copyData(int_32 type, /*@out@*/void * dstPtr, const void * srcPtr, i
     }
 }
 
-static void * grabData(int_32 type, /*@out@*/const void * p, int_32 c, int * lengthPtr)
+static void * grabData(int_32 type, const void * p, int_32 c, int * lengthPtr)
 {
     int length;
     void * data;
@@ -1833,9 +1833,9 @@ static int parseExpression(struct sprintfToken * token, char * str,
     return 0;
 }
 
-static int getExtension(Header h, headerTagTagFunction fn, /*@out@*/int_32 * typeptr,
-                       /*@out@*/void ** data, /*@out@*/int_32 * countptr, 
-                       struct extensionCache * ext)
+static int getExtension(Header h, headerTagTagFunction fn,
+       /*@out@*/ int_32 * typeptr, /*@out@*/ const void ** data,
+       /*@out@*/ int_32 * countptr, struct extensionCache * ext)
 {
     if (!ext->avail) {
        if (fn(h, &ext->type, &ext->data, &ext->count, &ext->freeit))
@@ -1857,10 +1857,10 @@ static char * formatValue(struct sprintfTag * tag, Header h,
     int len;
     char buf[20];
     int_32 count, type;
-    void * data;
+    const void * data;
     unsigned int intVal;
     char * val = NULL;
-    char ** strarray;
+    const char ** strarray;
     int mayfree = 0;
     int countBuf;
     headerTagFormatFunction tagtype = NULL;
@@ -1874,7 +1874,7 @@ static char * formatValue(struct sprintfTag * tag, Header h,
            data = "(none)";            /* XXX i18n? NO!, sez; gafton */
        }
     } else {
-       if (!headerGetEntry(h, tag->tag, &type, &data, &count)){
+       if (!headerGetEntry(h, tag->tag, &type, (void **)&data, &count)){
            count = 1;
            type = RPM_STRING_TYPE;     
            data = "(none)";            /* XXX i18n? NO!, sez; gafton */
@@ -1884,7 +1884,7 @@ static char * formatValue(struct sprintfTag * tag, Header h,
     }
 
     if (tag->arrayCount) {
-       if (type == RPM_STRING_ARRAY_TYPE) free(data);
+       if (type == RPM_STRING_ARRAY_TYPE) free((void *)data);
 
        countBuf = count;
        data = &countBuf;
@@ -1913,7 +1913,7 @@ static char * formatValue(struct sprintfTag * tag, Header h,
     
     switch (type) {
       case RPM_STRING_ARRAY_TYPE:
-       strarray = data;
+       strarray = (const char **)data;
 
        if (tagtype) {
            val = tagtype(RPM_STRING_TYPE, strarray[element], buf, tag->pad, 0);
@@ -1927,7 +1927,7 @@ static char * formatValue(struct sprintfTag * tag, Header h,
            sprintf(val, buf, strarray[element]);
        }
 
-       if (mayfree) free(data);
+       if (mayfree) free((void *)data);
 
        break;
 
@@ -1987,7 +1987,6 @@ static char * singleSprintf(Header h, struct sprintfToken * token,
     int i, j;
     int numElements;
     int type;
-    void * data;
     struct sprintfToken * condFormat;
     int condNumFormats;
 
@@ -2045,6 +2044,7 @@ static char * singleSprintf(Header h, struct sprintfToken * token,
                token->u.array.format[i].u.tag.justOne) continue;
 
            if (token->u.array.format[i].u.tag.ext) {
+               const void * data;
                if (getExtension(h, token->u.array.format[i].u.tag.ext,
                                 &type, &data, &numElements, 
                                 extCache + 
@@ -2113,7 +2113,7 @@ static void freeExtensionCache(const struct headerSprintfExtension * extensions,
     int i = 0;
 
     while (ext->type != HEADER_EXT_LAST) {
-       if (cache[i].freeit) free(cache[i].data);
+       if (cache[i].freeit) free((void *)cache[i].data);
 
        i++;
        if (ext->type == HEADER_EXT_MORE)
index ee057c7..1af4559 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-02-22 15:34-0500\n"
+"POT-Creation-Date: 2000-02-22 20:44-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 408d15c..1bb7d41 100644 (file)
@@ -22,8 +22,3 @@ config_SCRIPTS = \
        freshen.sh get_magic.pl getpo.sh http.req magic.prov magic.req \
        perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh \
        vpkg-provides.sh vpkg-provides2.sh
-
-brp-redhat: brp-redhat.in ../config.status
-       cd .. \
-         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
-               $(SHELL) ./config.status
index 0aa4a4a..4c3166d 100644 (file)
@@ -292,11 +292,6 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 all:
 
-brp-redhat: brp-redhat.in ../config.status
-       cd .. \
-         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
-               $(SHELL) ./config.status
-
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT: