RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 25-Mar-2012 18:55:11 Branch: rpm-5_4 Handle: 2012032516551100 Modified files: (Branch: rpm-5_4) rpm/rpmio .cvsignore Makefile.am set.c Log: - set: achieve SELF_TEST compilation. Summary: Revision Changes Path 1.41.2.3 +1 -0 rpm/rpmio/.cvsignore 1.293.2.12 +5 -1 rpm/rpmio/Makefile.am 1.1.2.2 +15 -22 rpm/rpmio/set.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/rpmio/.cvsignore ============================================================================ $ cvs diff -u -r1.41.2.2 -r1.41.2.3 .cvsignore --- rpm/rpmio/.cvsignore 17 Mar 2012 19:25:03 -0000 1.41.2.2 +++ rpm/rpmio/.cvsignore 25 Mar 2012 16:55:11 -0000 1.41.2.3 @@ -54,6 +54,7 @@ tring trpmio truby +tset tsexp tsvn tsw @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/Makefile.am ============================================================================ $ cvs diff -u -r1.293.2.11 -r1.293.2.12 Makefile.am --- rpm/rpmio/Makefile.am 25 Mar 2012 16:37:24 -0000 1.293.2.11 +++ rpm/rpmio/Makefile.am 25 Mar 2012 16:55:11 -0000 1.293.2.12 @@ -20,7 +20,7 @@ rpmgenbasedir rpmgenpkglist rpmgensrclist rpmgpg \ rpmpbzip2 rpmpigz rpmtar rpmz \ tasn tdir tfts tget tglob thkp thtml tinv tkey tmacro tmagic \ - tmire todbc tperl tpython tput tpw trpmio tsexp tsvn tsw ttcl \ + tmire todbc tperl tpython tput tpw trpmio tset tsexp tsvn tsw ttcl \ dumpasn1 lookup3 noinst_PROGRAMS = @@ -393,6 +393,10 @@ trpmio_SOURCES = trpmio.c trpmio_LDADD = $(RPMIO_LDADD_COMMON) +tset_SOURCES = set.c +tset_CFLAGS = $(CFLAGS) -DSELF_TEST -Wmissing-field-initializers +tset_LDFLAGS = $(RPMIO_LDADD_COMMON) + tsexp_SOURCES = tsexp.c tsexp_LDFLAGS = $(RPMIO_LDADD_COMMON) @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/set.c ============================================================================ $ cvs diff -u -r1.1.2.1 -r1.1.2.2 set.c --- rpm/rpmio/set.c 25 Mar 2012 16:37:24 -0000 1.1.2.1 +++ rpm/rpmio/set.c 25 Mar 2012 16:55:11 -0000 1.1.2.2 @@ -6,14 +6,13 @@ * License: GPLv2+ or LGPL, see RPM COPYING */ -#ifdef SELF_TEST -#undef NDEBUG -#include <stdio.h> -#endif +#include "system.h" + +#include <rpmiotypes.h> +#define _SET_INTERNAL +#include "set.h" -#include <string.h> -#include <stdlib.h> -#include <assert.h> +#include "debug.h" /* * Base62 routines - encode bits with alnum characters. @@ -187,7 +186,7 @@ #ifdef SELF_TEST static -void test_base62() +void test_base62(void) { const char rnd_bitv[] = { 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, @@ -352,7 +351,7 @@ #ifdef SELF_TEST static -void test_golomb() +void test_golomb(void) { const unsigned rnd_v[] = { // do re mi fa sol la si @@ -417,7 +416,6 @@ }; // Combine two characters into array index (with respect to endianness). -#include <sys/types.h> #if BYTE_ORDER && BYTE_ORDER == LITTLE_ENDIAN #define CCI(c1, c2) ((c1) | ((c2) << 8)) #elif BYTE_ORDER && BYTE_ORDER == BIG_ENDIAN @@ -707,7 +705,7 @@ #ifdef SELF_TEST static -void test_word_table() +void test_word_table(void) { int i, j; for (i = 0; i < 256; i++) @@ -724,7 +722,7 @@ } static -void test_base62_golomb() +void test_base62_golomb(void) { const char str[] = "set:hdf7q2P5VZwtLGr9TKxhrEM1"; const char *base62 = str + 4 + 2; @@ -776,7 +774,7 @@ #ifdef SELF_TEST static -void test_delta() +void test_delta(void) { unsigned v[] = { 1, 3, 7, 0 @@ -1042,7 +1040,7 @@ #ifdef SELF_TEST static -void test_set() +void test_set(void) { unsigned rnd_v[] = { 0x020a, 0x07e5, 0x3305, 0x35f5, @@ -1086,8 +1084,6 @@ * API routines start here. */ -#include "set.h" - // main API routine int rpmsetcmp(const char *str1, const char *str2) { @@ -1231,9 +1227,6 @@ * Simple API for creating set-versions. */ -#include "system.h" -#include "rpmlib.h" - // Internally, "struct set" is just a bag of strings and their hash values. struct set { int c; @@ -1243,7 +1236,7 @@ } *sv; }; -struct set *set_new() +struct set *set_new(void) { struct set *set = xmalloc(sizeof *set); set->c = 0; @@ -1346,7 +1339,7 @@ #ifdef SELF_TEST static -void test_api() +void test_api(void) { struct set *set1 = set_new(); set_add(set1, "mama"); @@ -1393,7 +1386,7 @@ #endif #ifdef SELF_TEST -int main() +int main(int argc, char *argv[]) { test_base62(); test_golomb(); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org