diff options
author | jbj <devnull@localhost> | 1999-01-06 21:05:03 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-01-06 21:05:03 +0000 |
commit | b2f3993b1bd22becd6289445abbb4fe6d8db2bed (patch) | |
tree | 818ceef8a614e1c53e0567fe325c7bdb9c929e95 | |
parent | 95cfbca845f9fd1328ad1d4ee81dcf69c804a1f2 (diff) | |
download | rpm-b2f3993b1bd22becd6289445abbb4fe6d8db2bed.tar.gz rpm-b2f3993b1bd22becd6289445abbb4fe6d8db2bed.tar.bz2 rpm-b2f3993b1bd22becd6289445abbb4fe6d8db2bed.zip |
Eliminate inline functions (the inline, not the function).
EGCS cruft.
CVS patchset: 2667
CVS date: 1999/01/06 21:05:03
-rw-r--r-- | lib/cpio.h | 2 | ||||
-rw-r--r-- | lib/dbindex.c | 20 | ||||
-rw-r--r-- | lib/dbindex.h | 23 | ||||
-rw-r--r-- | lib/hash.c | 4 | ||||
-rw-r--r-- | lib/header.c | 13 | ||||
-rw-r--r-- | lib/rpmio.h | 151 | ||||
-rw-r--r-- | po/rpm.pot | 52 | ||||
-rw-r--r-- | popt/po/popt.pot | 2 |
8 files changed, 78 insertions, 189 deletions
diff --git a/lib/cpio.h b/lib/cpio.h index 4ae3b67a1..4c43d70f5 100644 --- a/lib/cpio.h +++ b/lib/cpio.h @@ -35,7 +35,7 @@ /* Don't think this behaves just like standard cpio. It's pretty close, but it has some behaviors which are more to RPM's liking. I tried to document - them inline in cpio.c, but I may have missed some. */ + them in cpio.c, but I may have missed some. */ #define CPIO_MAP_PATH (1 << 0) #define CPIO_MAP_MODE (1 << 1) diff --git a/lib/dbindex.c b/lib/dbindex.c index 1b64ccf58..87a5cd407 100644 --- a/lib/dbindex.c +++ b/lib/dbindex.c @@ -2,6 +2,26 @@ #include "rpmlib.h" +int dbiIndexSetCount(dbiIndexSet set) { + return set.count; +} + +/* structure return */ +dbiIndexRecord dbiReturnIndexRecordInstance(unsigned int recOffset, unsigned int fileNumber) { + dbiIndexRecord rec; + rec.recOffset = recOffset; + rec.fileNumber = fileNumber; + return rec; +} + +unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno) { + return set.recs[recno].recOffset; +} + +unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno) { + return set.recs[recno].fileNumber; +} + dbiIndex * dbiOpenIndex(char * filename, int flags, int perms, DBTYPE type) { dbiIndex * db; diff --git a/lib/dbindex.h b/lib/dbindex.h index 02adb6315..0fca9101d 100644 --- a/lib/dbindex.h +++ b/lib/dbindex.h @@ -47,29 +47,14 @@ dbiIndexSet dbiCreateIndexRecord(void); void dbiFreeIndexRecord(dbiIndexSet set); int dbiGetFirstKey(dbiIndex * dbi, const char ** key); -extern inline int dbiIndexSetCount(dbiIndexSet set); -extern inline int dbiIndexSetCount(dbiIndexSet set) { - return set.count; -} +extern int dbiIndexSetCount(dbiIndexSet set); /* structure return */ -extern inline dbiIndexRecord dbiReturnIndexRecordInstance(unsigned int recOffset, unsigned int fileNumber); -extern inline dbiIndexRecord dbiReturnIndexRecordInstance(unsigned int recOffset, unsigned int fileNumber) { - dbiIndexRecord rec; - rec.recOffset = recOffset; - rec.fileNumber = fileNumber; - return rec; -} +extern dbiIndexRecord dbiReturnIndexRecordInstance(unsigned int recOffset, unsigned int fileNumber); -extern inline unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno); -extern inline unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno) { - return set.recs[recno].recOffset; -} +extern unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno); -extern inline unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno); -extern inline unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno) { - return set.recs[recno].fileNumber; -} +extern unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno); #ifdef __cplusplus } diff --git a/lib/hash.c b/lib/hash.c index 05a529027..426743502 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -22,7 +22,9 @@ struct hashTable_s { static struct hashBucket * findEntry(hashTable ht, const void * key); int hashEqualityString(const void * key1, const void * key2) { - return strcmp(key1, key2); + char *k1 = (char *)key1; + char *k2 = (char *)key2; + return strcmp(k1, k2); } unsigned int hashFunctionString(const void * string) { diff --git a/lib/header.c b/lib/header.c index c91d162c1..63fa7eb4a 100644 --- a/lib/header.c +++ b/lib/header.c @@ -562,11 +562,9 @@ void *headerUnload(Header h) { void headerDump(Header h, FILE *f, int flags, const struct headerTagTableEntry * tags) { - int i, c, ct; + int i; struct indexEntry *p; const struct headerTagTableEntry * tage; - char *dp; - char ch; char *type, *tag; /* First write out the length of the index (count of index entries) */ @@ -604,10 +602,11 @@ void headerDump(Header h, FILE *f, int flags, p->info.count); if (flags & HEADER_DUMP_INLINE) { + char *dp = p->data; + int c = p->info.count; + int ct = 0; + /* Print the data inline */ - dp = p->data; - c = p->info.count; - ct = 0; switch (p->info.type) { case RPM_INT32_TYPE: while (c--) { @@ -650,7 +649,7 @@ void headerDump(Header h, FILE *f, int flags, break; case RPM_CHAR_TYPE: while (c--) { - ch = (char) *((char *) dp); + char ch = (char) *((char *) dp); fprintf(f, " Data: %.3d 0x%2x %c (%d)\n", ct++, (unsigned)(ch & 0xff), (isprint(ch) ? ch : ' '), diff --git a/lib/rpmio.h b/lib/rpmio.h index 25804b49d..afa52def7 100644 --- a/lib/rpmio.h +++ b/lib/rpmio.h @@ -45,93 +45,23 @@ extern /*@shared@*/ FILE *fdFdopen(/*@owned@*/ FD_t fd, const char *mode); #include <zlib.h> -extern inline gzFile * gzdFileno(FD_t fd); -extern inline gzFile * gzdFileno(FD_t fd) { - return (fd != NULL ? ((gzFile *)fd->fd_gzd) : NULL); -} +extern gzFile * gzdFileno(FD_t fd); -extern inline /*@null@*/ FD_t gzdOpen(const char *pathname, const char *mode); -extern inline /*@null@*/ FD_t gzdOpen(const char *pathname, const char *mode) { - FD_t fd; - gzFile *gzfile;; - if ((gzfile = gzopen(pathname, mode)) == NULL) - return NULL; - fd = fdNew(); - fd->fd_gzd = gzfile; - return fd; -} +extern /*@null@*/ FD_t gzdOpen(const char *pathname, const char *mode); -extern inline /*@shared@*/ FD_t gzdFdopen(FD_t fd, const char *mode); -extern inline /*@shared@*/ FD_t gzdFdopen(FD_t fd, const char *mode) { - gzFile *gzfile = gzdopen(fdFileno(fd), mode); - if (gzfile != NULL) { - fd->fd_fd = -1; - fd->fd_gzd = gzfile; - return fd; - } - return NULL; -} +extern /*@shared@*/ FD_t gzdFdopen(FD_t fd, const char *mode); -extern inline ssize_t gzdRead(FD_t fd, void * buf, size_t count); -extern inline ssize_t gzdRead(FD_t fd, void * buf, size_t count) { - return gzread(gzdFileno(fd), buf, count); -} +extern ssize_t gzdRead(FD_t fd, void * buf, size_t count); -extern inline ssize_t gzdWrite(FD_t fd, const void * buf, size_t count); -extern inline ssize_t gzdWrite(FD_t fd, const void * buf, size_t count) { - return gzwrite(gzdFileno(fd), (void *)buf, count); -} +extern ssize_t gzdWrite(FD_t fd, const void * buf, size_t count); -extern inline off_t gzdLseek(FD_t fd, off_t offset, int whence); -extern inline off_t gzdLseek(FD_t fd, off_t offset, int whence) { - return gzseek(gzdFileno(fd), offset, whence); -} +extern off_t gzdLseek(FD_t fd, off_t offset, int whence); -extern inline int gzdFlush(FD_t fd); -extern inline int gzdFlush(FD_t fd) { - return gzflush(gzdFileno(fd), Z_SYNC_FLUSH); /* XXX W2DO? */ -} +extern int gzdFlush(FD_t fd); -extern inline char * gzdStrerror(FD_t fd); -extern inline char * gzdStrerror(FD_t fd) { - static char *zlib_err [] = { - "OK" - "Errno", - "Stream", - "Data", - "Memory", - "Buffer", - "Version" - }; - - int zerror; - - gzerror(gzdFileno(fd), &zerror); - switch (zerror) { - case Z_ERRNO: - return strerror(errno); - break; - default: - break; - } - return zlib_err[-zerror]; -} +extern char * gzdStrerror(FD_t fd); -extern inline int gzdClose(/*@only@*/ FD_t fd); -extern inline int gzdClose(/*@only@*/ FD_t fd) { - gzFile *gzfile; - int zerror; - - if (fd != NULL && (gzfile = gzdFileno(fd)) != NULL) { - fd->fd_fd = -1; - fd->fd_bzd = NULL; - fd->fd_gzd = NULL; - free(fd); - zerror = gzclose(gzfile); - return 0; - } - return -2; -} +extern int gzdClose(/*@only@*/ FD_t fd); #endif /* HAVE_ZLIB_H */ @@ -142,68 +72,21 @@ extern inline int gzdClose(/*@only@*/ FD_t fd) { #include <bzlib.h> -extern inline BZFILE * bzdFileno(FD_t fd); -extern inline BZFILE * bzdFileno(FD_t fd) { - return (fd != NULL ? ((BZFILE *)fd->fd_bzd) : NULL); -} +extern BZFILE * bzdFileno(FD_t fd); -extern inline /*@null@*/ FD_t bzdOpen(const char *pathname, const char *mode); -extern inline /*@null@*/ FD_t bzdOpen(const char *pathname, const char *mode) { - FD_t fd; - BZFILE *bzfile;; - if ((bzfile = bzopen(pathname, mode)) == NULL) - return NULL; - fd = fdNew(); - fd->fd_bzd = bzfile; - return fd; -} +extern /*@null@*/ FD_t bzdOpen(const char *pathname, const char *mode); -extern inline /*@shared@*/ FD_t bzdFdopen(FD_t fd, const char *mode); -extern inline /*@shared@*/ FD_t bzdFdopen(FD_t fd, const char *mode) { - BZFILE *bzfile = bzdopen(fdFileno(fd), mode); - if (bzfile != NULL) { - fd->fd_fd = -1; - fd->fd_bzd = bzfile; - return fd; - } - return NULL; -} +extern /*@shared@*/ FD_t bzdFdopen(FD_t fd, const char *mode); -extern inline ssize_t bzdRead(FD_t fd, void * buf, size_t count); -extern inline ssize_t bzdRead(FD_t fd, void * buf, size_t count) { - return bzread(bzdFileno(fd), buf, count); -} +extern ssize_t bzdRead(FD_t fd, void * buf, size_t count); -extern inline ssize_t bzdWrite(FD_t fd, const void * buf, size_t count); -extern inline ssize_t bzdWrite(FD_t fd, const void * buf, size_t count) { - return bzwrite(bzdFileno(fd), (void *)buf, count); -} +extern ssize_t bzdWrite(FD_t fd, const void * buf, size_t count); -extern inline int bzdFlush(FD_t fd); -extern inline int bzdFlush(FD_t fd) { - return bzflush(bzdFileno(fd)); -} +extern int bzdFlush(FD_t fd); -extern inline char * bzdStrerror(FD_t fd); -extern inline char * bzdStrerror(FD_t fd) { - int bzerr; - return (char *)bzerror(bzdFileno(fd), &bzerr); -} +extern char * bzdStrerror(FD_t fd); -extern inline int bzdClose(/*@only@*/ FD_t fd); -extern inline int bzdClose(/*@only@*/ FD_t fd) { - BZFILE *bzfile; - - if (fd != NULL && (bzfile = bzdFileno(fd)) != NULL) { - fd->fd_fd = -1; - fd->fd_bzd = NULL; - fd->fd_gzd = NULL; - free(fd); - bzclose(bzfile); - return 0; - } - return -2; -} +extern int bzdClose(/*@only@*/ FD_t fd); #endif /* HAVE_BZLIB_H */ diff --git a/po/rpm.pot b/po/rpm.pot index 7d8a11517..92a40d699 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-01-06 13:15-0500\n" +"POT-Creation-Date: 1999-01-06 15:57-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" @@ -2156,22 +2156,22 @@ msgstr "" msgid " failed - " msgstr "" -#: ../lib/dbindex.c:14 +#: ../lib/dbindex.c:34 #, c-format msgid "cannot open file %s: " msgstr "" -#: ../lib/dbindex.c:59 +#: ../lib/dbindex.c:79 #, c-format msgid "error getting record %s from %s" msgstr "" -#: ../lib/dbindex.c:87 +#: ../lib/dbindex.c:107 #, c-format msgid "error storing record %s into %s" msgstr "" -#: ../lib/dbindex.c:94 +#: ../lib/dbindex.c:114 #, c-format msgid "error removing record %s into %s" msgstr "" @@ -2211,8 +2211,8 @@ msgid "free list corrupt (%u)- contact support@redhat.com\n" msgstr "" #: ../lib/formats.c:97 ../lib/formats.c:114 ../lib/formats.c:134 -#: ../lib/formats.c:166 ../lib/header.c:1972 ../lib/header.c:1988 -#: ../lib/header.c:2008 +#: ../lib/formats.c:166 ../lib/header.c:1971 ../lib/header.c:1987 +#: ../lib/header.c:2007 msgid "(not a number)" msgstr "" @@ -2236,84 +2236,84 @@ msgstr "" msgid "file %s is on an unknown device" msgstr "" -#: ../lib/header.c:671 +#: ../lib/header.c:670 #, c-format msgid "Data type %d not supprted\n" msgstr "" #. This should not be allowed -#: ../lib/header.c:905 +#: ../lib/header.c:904 msgid "grabData() RPM_STRING_TYPE count must be 1.\n" msgstr "" -#: ../lib/header.c:935 +#: ../lib/header.c:934 #, c-format msgid "Data type %d not supported\n" msgstr "" -#: ../lib/header.c:994 +#: ../lib/header.c:993 #, c-format msgid "Bad count for headerAddEntry(): %d\n" msgstr "" -#: ../lib/header.c:1328 +#: ../lib/header.c:1327 msgid "? expected in expression" msgstr "" -#: ../lib/header.c:1335 +#: ../lib/header.c:1334 msgid "{ expected after ? in expression" msgstr "" -#: ../lib/header.c:1345 ../lib/header.c:1377 +#: ../lib/header.c:1344 ../lib/header.c:1376 msgid "} expected in expression" msgstr "" -#: ../lib/header.c:1352 +#: ../lib/header.c:1351 msgid ": expected following ? subexpression" msgstr "" -#: ../lib/header.c:1365 +#: ../lib/header.c:1364 msgid "{ expected after : in expression" msgstr "" -#: ../lib/header.c:1384 +#: ../lib/header.c:1383 msgid "| expected at end of expression" msgstr "" -#: ../lib/header.c:1478 +#: ../lib/header.c:1477 #, c-format msgid "missing { after %" msgstr "" -#: ../lib/header.c:1506 +#: ../lib/header.c:1505 msgid "missing } after %{" msgstr "" -#: ../lib/header.c:1518 +#: ../lib/header.c:1517 msgid "empty tag format" msgstr "" -#: ../lib/header.c:1528 +#: ../lib/header.c:1527 msgid "empty tag name" msgstr "" -#: ../lib/header.c:1543 +#: ../lib/header.c:1542 msgid "unknown tag" msgstr "" -#: ../lib/header.c:1569 +#: ../lib/header.c:1568 msgid "] expected at end of array" msgstr "" -#: ../lib/header.c:1585 +#: ../lib/header.c:1584 msgid "unexpected ]" msgstr "" -#: ../lib/header.c:1587 +#: ../lib/header.c:1586 msgid "unexpected }" msgstr "" -#: ../lib/header.c:1762 +#: ../lib/header.c:1761 msgid "(unknown type)" msgstr "" diff --git a/popt/po/popt.pot b/popt/po/popt.pot index bf4fa47e1..2b1571a78 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-01-06 11:43-0500\n" +"POT-Creation-Date: 1999-01-06 15:53-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" |