From 8dfb93f84f7862cb820b89718c8b2dcc3bba4fe2 Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 8 Apr 1999 20:53:45 +0000 Subject: [PATCH] non-linux, non-gcc portability fixes (Tim Mooney). CVS patchset: 2973 CVS date: 1999/04/08 20:53:45 --- CHANGES | 1 + lib/cpio.h | 2 +- lib/macro.c | 14 ++++----- lib/rpmlib.h | 2 +- po/rpm.pot | 74 +++++++++++++++++++++++++-------------------- popt/po/popt.pot | 2 +- rpmio/macro.c | 14 ++++----- scripts/Makefile.in | 2 +- tools/rpmgettext.c | 4 +-- url.h | 2 +- 10 files changed, 64 insertions(+), 53 deletions(-) diff --git a/CHANGES b/CHANGES index 5ce93d651..5f4030974 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ - fix: segfault while parsing target string. - fix: os was not initialized with "--target i586". - fix: --prefix resurrected. + - non-linux, non-gcc portability fixes (Tim Mooney). 2.92 -> 2.93 - eliminate old rpmrc configuration syntax. diff --git a/lib/cpio.h b/lib/cpio.h index 4c43d70f5..503a680d3 100644 --- a/lib/cpio.h +++ b/lib/cpio.h @@ -74,7 +74,7 @@ typedef struct CFD { cpioIoTypeDebug, cpioIoTypeFd, cpioIoTypeFp, - cpioIoTypeGzFd, + cpioIoTypeGzFd } cpioIoType; } CFD_t; diff --git a/lib/macro.c b/lib/macro.c index 69bb641c4..a6e7f310b 100644 --- a/lib/macro.c +++ b/lib/macro.c @@ -5,7 +5,7 @@ #define isblank(_c) ((_c) == ' ' || (_c) == '\t') #define STREQ(_t, _f, _fn) ((_fn) == (sizeof(_t)-1) && !strncmp((_t), (_f), (_fn))) -#define FREE(_x) { if (_x) free(_x); ((void *)(_x)) = NULL; } +#define FREE(_x) { if (_x) free((void *)_x); (_x) = NULL; } #ifdef DEBUG_MACROS #define rpmError fprintf @@ -530,9 +530,9 @@ popMacro(MacroEntry **mep) if (me) { /* XXX cast to workaround const */ if ((*mep = me->prev) == NULL) - FREE((char *)me->name); - FREE((char *)me->opts); - FREE((char *)me->body); + FREE(me->name); + FREE(me->opts); + FREE(me->body); FREE(me); } } @@ -1224,9 +1224,9 @@ freeMacros(MacroContext *mc) while ((me = mc->macroTable[i]) != NULL) { /* XXX cast to workaround const */ if ((mc->macroTable[i] = me->prev) == NULL) - FREE((char *)me->name); - FREE((char *)me->opts); - FREE((char *)me->body); + FREE(me->name); + FREE(me->opts); + FREE(me->body); FREE(me); } } diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 167659ea8..d0b566e1b 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -388,7 +388,7 @@ typedef enum rpmProblemType_e { RPMPROB_BADARCH, RPMPROB_NEW_FILE_CONFLICT, RPMPROB_FILE_CONFLICT, RPMPROB_OLDPACKAGE, - RPMPROB_DISKSPACE, + RPMPROB_DISKSPACE } rpmProblemType; typedef struct rpmProblem_s { diff --git a/po/rpm.pot b/po/rpm.pot index f7c8b18b0..a14a9db0a 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-04-06 15:06-0400\n" +"POT-Creation-Date: 1999-04-08 16:19-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -297,7 +297,7 @@ msgstr "" msgid "retrieved %d packages\n" msgstr "" -#: ../install.c:192 ../install.c:319 +#: ../install.c:192 ../install.c:329 #, c-format msgid "cannot open file %s\n" msgstr "" @@ -307,12 +307,12 @@ msgstr "" msgid "%s does not appear to be a RPM package\n" msgstr "" -#: ../install.c:208 ../install.c:456 +#: ../install.c:208 ../install.c:466 #, c-format msgid "%s cannot be installed\n" msgstr "" -#: ../install.c:223 ../install.c:369 +#: ../install.c:223 ../install.c:379 #, c-format msgid "cannot open %s/packages.rpm\n" msgstr "" @@ -322,54 +322,64 @@ msgstr "" msgid "package %s is not relocateable\n" msgstr "" -#: ../install.c:264 +#: ../install.c:256 +#, c-format +msgid "error reading from file %s\n" +msgstr "" + +#: ../install.c:259 +#, c-format +msgid "file %s requires a newer version of RPM\n" +msgstr "" + +#: ../install.c:274 #, c-format msgid "found %d source and %d binary packages\n" msgstr "" -#: ../install.c:274 +#: ../install.c:284 msgid "failed dependencies:\n" msgstr "" -#: ../install.c:292 +#: ../install.c:302 msgid "installing binary packages\n" msgstr "" -#: ../install.c:380 ../lib/query.c:685 ../verify.c:243 +#: ../install.c:390 ../lib/query.c:685 ../verify.c:243 #, c-format msgid "package %s is not installed\n" msgstr "" -#: ../install.c:384 +#: ../install.c:394 #, c-format msgid "searching for package %s\n" msgstr "" -#: ../install.c:393 +#: ../install.c:403 #, c-format msgid "\"%s\" specifies multiple packages\n" msgstr "" -#: ../install.c:419 +#: ../install.c:429 msgid "removing these packages would break dependencies:\n" msgstr "" -#: ../install.c:446 +#: ../install.c:456 #, c-format msgid "cannot open %s\n" msgstr "" -#: ../install.c:451 +#: ../install.c:461 #, c-format msgid "Installing %s\n" msgstr "" -#: ../install.c:495 +#: ../install.c:505 #, c-format msgid " is needed by %s-%s-%s\n" msgstr "" -#: ../install.c:498 +#: ../install.c:508 #, c-format msgid " conflicts with %s-%s-%s\n" msgstr "" @@ -2291,31 +2301,31 @@ msgstr "" msgid "error removing record %s into %s" msgstr "" -#: ../lib/depends.c:412 ../lib/depends.c:571 +#: ../lib/depends.c:429 ../lib/depends.c:588 #, c-format msgid "cannot read header at %d for dependency check" msgstr "" -#: ../lib/depends.c:477 +#: ../lib/depends.c:494 #, c-format msgid "dependencies: looking for %s\n" msgstr "" -#: ../lib/depends.c:665 +#: ../lib/depends.c:682 #, c-format msgid "package %s require not satisfied: %s\n" msgstr "" -#: ../lib/depends.c:708 +#: ../lib/depends.c:725 #, c-format msgid "package %s conflicts: %s\n" msgstr "" -#: ../lib/depends.c:808 +#: ../lib/depends.c:825 msgid "dbrecMatchesDepFlags() failed to read header" msgstr "" -#: ../lib/depends.c:860 +#: ../lib/depends.c:877 #, c-format msgid "loop in prerequisite chain: %s" msgstr "" @@ -2331,22 +2341,22 @@ msgstr "" msgid "(not a number)" msgstr "" -#: ../lib/fs.c:40 +#: ../lib/fs.c:41 #, c-format msgid "mntctl() failed to return fugger size: %s" msgstr "" -#: ../lib/fs.c:75 ../lib/fs.c:237 +#: ../lib/fs.c:76 ../lib/fs.c:246 #, c-format msgid "failed to stat %s: %s" msgstr "" -#: ../lib/fs.c:116 +#: ../lib/fs.c:117 #, c-format msgid "failed to open %s: %s" msgstr "" -#: ../lib/fs.c:258 +#: ../lib/fs.c:267 #, c-format msgid "file %s is on an unknown device" msgstr "" @@ -2478,7 +2488,7 @@ msgstr "" msgid "warning: %s saved as %s" msgstr "" -#: ../lib/install.c:440 ../lib/install.c:804 ../lib/uninstall.c:337 +#: ../lib/install.c:440 ../lib/install.c:808 ../lib/uninstall.c:337 #, c-format msgid "rename of %s to %s failed: %s" msgstr "" @@ -2522,11 +2532,11 @@ msgstr "" msgid "spec file in: %s\n" msgstr "" -#: ../lib/install.c:749 ../lib/install.c:781 +#: ../lib/install.c:749 ../lib/install.c:785 msgid "source package contains no .spec file" msgstr "" -#: ../lib/install.c:802 +#: ../lib/install.c:806 #, c-format msgid "renaming %s to %s\n" msgstr "" @@ -2596,7 +2606,7 @@ msgid "Unterminated %c: %s" msgstr "" #: ../lib/macro.c:905 -msgid "Empty token" +msgid "A %% is followed by an unparseable macro" msgstr "" #: ../lib/macro.c:1027 @@ -3193,17 +3203,17 @@ msgstr "" msgid "Invalid %%_signature spec in macro file" msgstr "" -#: ../lib/transaction.c:741 +#: ../lib/transaction.c:736 #, c-format msgid "relocating %s to %s\n" msgstr "" -#: ../lib/transaction.c:747 +#: ../lib/transaction.c:742 #, c-format msgid "excluding %s\n" msgstr "" -#: ../lib/transaction.c:835 +#: ../lib/transaction.c:830 #, c-format msgid "%s skipped due to missingok flag\n" msgstr "" diff --git a/popt/po/popt.pot b/popt/po/popt.pot index 7dc7a0b96..394907102 100644 --- a/popt/po/popt.pot +++ b/popt/po/popt.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-04-05 11:38-0400\n" +"POT-Creation-Date: 1999-04-08 16:15-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/rpmio/macro.c b/rpmio/macro.c index 69bb641c4..a6e7f310b 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -5,7 +5,7 @@ #define isblank(_c) ((_c) == ' ' || (_c) == '\t') #define STREQ(_t, _f, _fn) ((_fn) == (sizeof(_t)-1) && !strncmp((_t), (_f), (_fn))) -#define FREE(_x) { if (_x) free(_x); ((void *)(_x)) = NULL; } +#define FREE(_x) { if (_x) free((void *)_x); (_x) = NULL; } #ifdef DEBUG_MACROS #define rpmError fprintf @@ -530,9 +530,9 @@ popMacro(MacroEntry **mep) if (me) { /* XXX cast to workaround const */ if ((*mep = me->prev) == NULL) - FREE((char *)me->name); - FREE((char *)me->opts); - FREE((char *)me->body); + FREE(me->name); + FREE(me->opts); + FREE(me->body); FREE(me); } } @@ -1224,9 +1224,9 @@ freeMacros(MacroContext *mc) while ((me = mc->macroTable[i]) != NULL) { /* XXX cast to workaround const */ if ((mc->macroTable[i] = me->prev) == NULL) - FREE((char *)me->name); - FREE((char *)me->opts); - FREE((char *)me->body); + FREE(me->name); + FREE(me->opts); + FREE(me->body); FREE(me); } } diff --git a/scripts/Makefile.in b/scripts/Makefile.in index fdc8bfb86..176c7e2d9 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -69,7 +69,7 @@ target_triplet = @target@ AR = @AR@ AS = @AS@ AWK = @AWK@ -BUILD_RPM_CONVERT = @BUILD_RPM_CONVERT@ +BUILD_RPMCONVERT = @BUILD_RPMCONVERT@ BZIP2BIN = @BZIP2BIN@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ diff --git a/tools/rpmgettext.c b/tools/rpmgettext.c index 264bc4e3c..e527c1258 100644 --- a/tools/rpmgettext.c +++ b/tools/rpmgettext.c @@ -372,7 +372,7 @@ gettextfile(FD_t fd, const char *file, FILE *fp, int *poTags) FREE(s) } - FREE((char *)sourcerpm); + FREE(sourcerpm); FREE(langs); return 0; @@ -637,7 +637,7 @@ DPRINTF(100, ("\n")); } while (c == '"'); if (!strcmp(kw->name, "msgid")) { - FREE(((char *)mp->msgid)); + FREE(mp->msgid); mp->msgid = xstrdup(tbuf); } else if (!strcmp(kw->name, "msgstr")) { static lex_pos_ty pos = { __FILE__, __LINE__ }; diff --git a/url.h b/url.h index a6227cf14..6a911553f 100644 --- a/url.h +++ b/url.h @@ -6,7 +6,7 @@ typedef enum { URL_IS_DASH = 1, URL_IS_PATH = 2, URL_IS_FTP = 3, - URL_IS_HTTP = 4, + URL_IS_HTTP = 4 } urltype; typedef struct urlinfo {