From e9d044d4b9b71200a96adfa280848858c0f468c9 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 13 Nov 2021 13:10:00 +0000 Subject: gentoo resync : 13.11.2021 --- dev-db/cdb/Manifest | 9 +- dev-db/cdb/cdb-0.75-r4.ebuild | 41 ++-- dev-db/cdb/files/cdb-0.75-errno.diff | 11 - dev-db/cdb/files/cdb-0.75-stdint.diff | 419 ---------------------------------- dev-db/cdb/files/cdb-errno.patch | 11 + dev-db/cdb/files/cdb-inline.patch | 11 + dev-db/cdb/files/cdb-stdint.patch | 419 ++++++++++++++++++++++++++++++++++ dev-db/cdb/metadata.xml | 5 +- 8 files changed, 473 insertions(+), 453 deletions(-) delete mode 100644 dev-db/cdb/files/cdb-0.75-errno.diff delete mode 100644 dev-db/cdb/files/cdb-0.75-stdint.diff create mode 100644 dev-db/cdb/files/cdb-errno.patch create mode 100644 dev-db/cdb/files/cdb-inline.patch create mode 100644 dev-db/cdb/files/cdb-stdint.patch (limited to 'dev-db/cdb') diff --git a/dev-db/cdb/Manifest b/dev-db/cdb/Manifest index 2c53a2c1bff6..0da6a6f9ffeb 100644 --- a/dev-db/cdb/Manifest +++ b/dev-db/cdb/Manifest @@ -1,5 +1,6 @@ -AUX cdb-0.75-errno.diff 170 BLAKE2B 806a8f0b83fef34796705596f7e4c2896d3ef56d0209a5a181d46dbaa87268620a2d1cf4ee3ae1fa8890886d8f9db2b8c417cb51a4b9dc11802ed33f1b14c4f7 SHA512 00b39bf8cda478a3e3e5851eb7e2dd154bd547d6fdf73d3de5ca6f6ac565aca7a275b67bbde988249f4daabddbcee4ba5509cc079c2533f42268cfa5b39984cb -AUX cdb-0.75-stdint.diff 8956 BLAKE2B af2815290b395a23cb58a48b49361aa648d461ca247f6cba5fec7dfb0634be4fa1c09e4fc11536ff22dd5c221024cd0391d714fbb7fb160b91343111cebc37ca SHA512 2589722307e4b8c9e6e010a0a452a987bf5190bbaf20ece85b54666dd6633f30c85b443bddc31e70ea4024912a3999cd7197a0ac06cf86dbaf00c8b82551ae36 +AUX cdb-errno.patch 170 BLAKE2B 806a8f0b83fef34796705596f7e4c2896d3ef56d0209a5a181d46dbaa87268620a2d1cf4ee3ae1fa8890886d8f9db2b8c417cb51a4b9dc11802ed33f1b14c4f7 SHA512 00b39bf8cda478a3e3e5851eb7e2dd154bd547d6fdf73d3de5ca6f6ac565aca7a275b67bbde988249f4daabddbcee4ba5509cc079c2533f42268cfa5b39984cb +AUX cdb-inline.patch 251 BLAKE2B 16c4dd5cc00f243a51196977988fcae53365bab4b1a0034d44e24b5c5c0b3c6b819dfa00f6fd7ce583722f97847cba7e6b24b53596639a7df1fd0da42910c35c SHA512 c8d4cf0772b7373160c600ba1494f4933c62c9e1df929695c754c4e51ebaec4387d5f8e8739c88e0b82463bc26e8bd0c2060c43dffcfdb79431d2038f100a617 +AUX cdb-stdint.patch 8956 BLAKE2B af2815290b395a23cb58a48b49361aa648d461ca247f6cba5fec7dfb0634be4fa1c09e4fc11536ff22dd5c221024cd0391d714fbb7fb160b91343111cebc37ca SHA512 2589722307e4b8c9e6e010a0a452a987bf5190bbaf20ece85b54666dd6633f30c85b443bddc31e70ea4024912a3999cd7197a0ac06cf86dbaf00c8b82551ae36 DIST cdb-0.75.tar.gz 54162 BLAKE2B 7b488bf330b2aac88a1cca82a6a49e24d0fd953c77935231a31bd72cc0936a37628736b5b22ea0d58aaa77cd118976ab8aa82ccc080f99e190e3f1db5d51b622 SHA512 6faeab91a77457348b58f685e81000b83fb609691317198a06284c5c62dee1e4d6138f90be1e727021f279d740169c175a21b23c96adb39a654e3f7fafdf36c0 -EBUILD cdb-0.75-r4.ebuild 1378 BLAKE2B ca18aac66d31e06c6db4e7361dade8e8a827926cf4a6525939488d93ad4b7eae176e35f2f37e25f83be2443f365409acb17e828741bb7b8f15cdeff5da09de54 SHA512 662bfbef457bf45421c29f3be534f83357b54d54155d15c8002b0b370d6295870356500801d45f462895ccbb3f8b88b1c0230a3a8aeb16398497992d99101f9b -MISC metadata.xml 167 BLAKE2B 868e3b584722eaacf68273db062bb773d8c7e5d7ab2b81ca7e8397643bf7cc106c3a1033594401c99c54f667bb45d6b73f9048fc335580bbd44b4589ad26a832 SHA512 30caadd1496c3b9969136038239a1d8e01f236726b4022c2d7e19ca7575f25f735e556835e581afbf44fbd3e4104c40f2b5ef5fa70118d75c881fdf871962d0a +EBUILD cdb-0.75-r4.ebuild 1478 BLAKE2B 5e0d38757d8db7afac61ec175cdc7022443a6c22c42613feaeca2e208314595cdb27248e79075fe571e541172a58e2777a93c3a5a40608e5967e7a3f61ea002e SHA512 d665984fb16810f4da7efdbe2720775b007bba22ce23c357939d4896a3cc704a48d9555e51ebce014b1fe7309a261fd267a5c9c3de05fda1b739292831c833e6 +MISC metadata.xml 249 BLAKE2B a37da98d387308dab889eab2665b67e4176707f3c115a7a69cb7f4b19f9864b96bc2fe70efa105e627c4b57a7d626f6b23dc2709a225a9debada3356f3cf32a0 SHA512 a5095fb01e05f24583a962e36131b2f02cf2d1dd7a97051200e465ad97db014721de7c1857f5eb736cb0290682e8de833cb4c735f7de8d98cdfae1aed6d3d549 diff --git a/dev-db/cdb/cdb-0.75-r4.ebuild b/dev-db/cdb/cdb-0.75-r4.ebuild index 73ca328b0351..6f6e1be87205 100644 --- a/dev-db/cdb/cdb-0.75-r4.ebuild +++ b/dev-db/cdb/cdb-0.75-r4.ebuild @@ -1,54 +1,59 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI="8" inherit toolchain-funcs DESCRIPTION="Fast, reliable, simple package for creating and reading constant databases" -HOMEPAGE="http://cr.yp.to/cdb.html" -SRC_URI="http://cr.yp.to/cdb/${P}.tar.gz" +HOMEPAGE="https://cr.yp.to/cdb.html" +SRC_URI="https://cr.yp.to/${PN}/${P}.tar.gz" LICENSE="public-domain" SLOT="0" KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="" -DEPEND="!dev-db/tinycdb" -RDEPEND="${DEPEND}" +RDEPEND="!dev-db/tinycdb" +DEPEND="${RDEPEND}" PATCHES=( - "${FILESDIR}"/${P}-errno.diff - "${FILESDIR}"/${P}-stdint.diff + "${FILESDIR}"/${PN}-errno.patch + "${FILESDIR}"/${PN}-inline.patch + "${FILESDIR}"/${PN}-stdint.patch ) +DOCS=( CHANGES README TODO VERSION ) src_prepare() { default - sed -i -e 's/head -1/head -n 1/g' Makefile \ - || die "sed Makefile failed" + sed -i \ + -e "s/head -1/head -n 1/g" \ + -e "s/ar /$(tc-getAR) /" \ + -e "s/ranlib /$(tc-getRANLIB) /" \ + Makefile } src_configure() { - echo "$(tc-getCC) ${CFLAGS} -fPIC" > conf-cc || die - echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die - echo "${EPREFIX}/usr" > conf-home || die + echo "$(tc-getCC) ${CFLAGS} -fPIC" >conf-cc || die + echo "$(tc-getCC) ${LDFLAGS}" >conf-ld || die + echo "${EPREFIX}/usr" >conf-home || die } src_install() { - dobin cdbdump cdbget cdbmake cdbmake-12 cdbmake-sv cdbstats cdbtest + dobin ${PN}{dump,get,make{,-12,-sv},stats,test} # ok so ... first off, some automakes fail at finding # cdb.a, so install that now dolib.a *.a - # then do this pretty little symlinking to solve the somewhat # cosmetic library issue at hand - dosym cdb.a /usr/$(get_libdir)/libcdb.a + dosym ${PN}.a /usr/$(get_libdir)/lib${PN}.a # uint32.h needs installation too, otherwise compiles depending # on it will fail - insinto /usr/include/cdb - doins cdb*.h buffer.h alloc.h uint32.h + insinto /usr/include/${PN} + doins ${PN}*.h {alloc,buffer,uint32}.h - dodoc CHANGES FILES README SYSDEPS TODO VERSION + einstalldocs } diff --git a/dev-db/cdb/files/cdb-0.75-errno.diff b/dev-db/cdb/files/cdb-0.75-errno.diff deleted file mode 100644 index e037ded7aac0..000000000000 --- a/dev-db/cdb/files/cdb-0.75-errno.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- a/error.h -+++ b/error.h -@@ -1,7 +1,7 @@ - #ifndef ERROR_H - #define ERROR_H - --extern int errno; -+#include - - extern int error_intr; - extern int error_nomem; diff --git a/dev-db/cdb/files/cdb-0.75-stdint.diff b/dev-db/cdb/files/cdb-0.75-stdint.diff deleted file mode 100644 index 1775fd84f906..000000000000 --- a/dev-db/cdb/files/cdb-0.75-stdint.diff +++ /dev/null @@ -1,419 +0,0 @@ ---- a/cdb.c -+++ b/cdb.c -@@ -41,7 +41,7 @@ - } - } - --int cdb_read(struct cdb *c,char *buf,unsigned int len,uint32 pos) -+int cdb_read(struct cdb *c,char *buf,unsigned int len,uint32_t pos) - { - if (c->map) { - if ((pos > c->size) || (c->size - pos < len)) goto FORMAT; -@@ -67,7 +67,7 @@ - return -1; - } - --static int match(struct cdb *c,char *key,unsigned int len,uint32 pos) -+static int match(struct cdb *c,char *key,unsigned int len,uint32_t pos) - { - char buf[32]; - int n; -@@ -87,8 +87,8 @@ - int cdb_findnext(struct cdb *c,char *key,unsigned int len) - { - char buf[8]; -- uint32 pos; -- uint32 u; -+ uint32_t pos; -+ uint32_t u; - - if (!c->loop) { - u = cdb_hash(key,len); ---- a/cdbdump.c -+++ b/cdbdump.c -@@ -18,7 +18,7 @@ - if (buffer_flush(buffer_1) == -1) die_write(); - } - --uint32 pos = 0; -+uint32_t pos = 0; - - void get(char *buf,unsigned int len) - { -@@ -37,7 +37,7 @@ - - char buf[512]; - --void copy(uint32 len) -+void copy(uint32_t len) - { - unsigned int x; - -@@ -50,7 +50,7 @@ - } - } - --void getnum(uint32 *num) -+void getnum(uint32_t *num) - { - get(buf,4); - uint32_unpack(buf,num); -@@ -60,9 +60,9 @@ - - main() - { -- uint32 eod; -- uint32 klen; -- uint32 dlen; -+ uint32_t eod; -+ uint32_t klen; -+ uint32_t dlen; - - getnum(&eod); - while (pos < 2048) getnum(&dlen); ---- a/cdbget.c -+++ b/cdbget.c -@@ -27,8 +27,8 @@ - { - char *key; - int r; -- uint32 pos; -- uint32 len; -+ uint32_t pos; -+ uint32_t len; - unsigned long u = 0; - - if (!*argv) die_usage(); ---- a/cdb.h -+++ b/cdb.h -@@ -6,26 +6,26 @@ - #include "uint32.h" - - #define CDB_HASHSTART 5381 --extern uint32 cdb_hashadd(uint32,unsigned char); --extern uint32 cdb_hash(char *,unsigned int); -+extern uint32_t cdb_hashadd(uint32_t,unsigned char); -+extern uint32_t cdb_hash(char *,unsigned int); - - struct cdb { - char *map; /* 0 if no map is available */ - int fd; -- uint32 size; /* initialized if map is nonzero */ -- uint32 loop; /* number of hash slots searched under this key */ -- uint32 khash; /* initialized if loop is nonzero */ -- uint32 kpos; /* initialized if loop is nonzero */ -- uint32 hpos; /* initialized if loop is nonzero */ -- uint32 hslots; /* initialized if loop is nonzero */ -- uint32 dpos; /* initialized if cdb_findnext() returns 1 */ -- uint32 dlen; /* initialized if cdb_findnext() returns 1 */ -+ uint32_t size; /* initialized if map is nonzero */ -+ uint32_t loop; /* number of hash slots searched under this key */ -+ uint32_t khash; /* initialized if loop is nonzero */ -+ uint32_t kpos; /* initialized if loop is nonzero */ -+ uint32_t hpos; /* initialized if loop is nonzero */ -+ uint32_t hslots; /* initialized if loop is nonzero */ -+ uint32_t dpos; /* initialized if cdb_findnext() returns 1 */ -+ uint32_t dlen; /* initialized if cdb_findnext() returns 1 */ - } ; - - extern void cdb_free(struct cdb *); - extern void cdb_init(struct cdb *,int fd); - --extern int cdb_read(struct cdb *,char *,unsigned int,uint32); -+extern int cdb_read(struct cdb *,char *,unsigned int,uint32_t); - - extern void cdb_findstart(struct cdb *); - extern int cdb_findnext(struct cdb *,char *,unsigned int); ---- a/cdb_hash.c -+++ b/cdb_hash.c -@@ -2,15 +2,15 @@ - - #include "cdb.h" - --uint32 cdb_hashadd(uint32 h,unsigned char c) -+uint32_t cdb_hashadd(uint32_t h,unsigned char c) - { - h += (h << 5); - return h ^ c; - } - --uint32 cdb_hash(char *buf,unsigned int len) -+uint32_t cdb_hash(char *buf,unsigned int len) - { -- uint32 h; -+ uint32_t h; - - h = CDB_HASHSTART; - while (len) { ---- a/cdb_make.c -+++ b/cdb_make.c -@@ -19,15 +19,15 @@ - return seek_set(fd,c->pos); - } - --static int posplus(struct cdb_make *c,uint32 len) -+static int posplus(struct cdb_make *c,uint32_t len) - { -- uint32 newpos = c->pos + len; -+ uint32_t newpos = c->pos + len; - if (newpos < len) { errno = error_nomem; return -1; } - c->pos = newpos; - return 0; - } - --int cdb_make_addend(struct cdb_make *c,unsigned int keylen,unsigned int datalen,uint32 h) -+int cdb_make_addend(struct cdb_make *c,unsigned int keylen,unsigned int datalen,uint32_t h) - { - struct cdb_hplist *head; - -@@ -74,11 +74,11 @@ - { - char buf[8]; - int i; -- uint32 len; -- uint32 u; -- uint32 memsize; -- uint32 count; -- uint32 where; -+ uint32_t len; -+ uint32_t u; -+ uint32_t memsize; -+ uint32_t count; -+ uint32_t where; - struct cdb_hplist *x; - struct cdb_hp *hp; - -@@ -99,7 +99,7 @@ - } - - memsize += c->numentries; /* no overflow possible up to now */ -- u = (uint32) 0 - (uint32) 1; -+ u = UINT32_MAX; - u /= sizeof(struct cdb_hp); - if (memsize > u) { errno = error_nomem; return -1; } - ---- a/cdbmake.c -+++ b/cdbmake.c -@@ -41,7 +41,7 @@ - unsigned int klen; - unsigned int dlen; - unsigned int i; -- uint32 h; -+ uint32_t h; - int fd; - char ch; - ---- a/cdb_make.h -+++ b/cdb_make.h -@@ -8,7 +8,7 @@ - - #define CDB_HPLIST 1000 - --struct cdb_hp { uint32 h; uint32 p; } ; -+struct cdb_hp { uint32_t h; uint32_t p; } ; - - struct cdb_hplist { - struct cdb_hp hp[CDB_HPLIST]; -@@ -19,20 +19,20 @@ - struct cdb_make { - char bspace[8192]; - char final[2048]; -- uint32 count[256]; -- uint32 start[256]; -+ uint32_t count[256]; -+ uint32_t start[256]; - struct cdb_hplist *head; - struct cdb_hp *split; /* includes space for hash */ - struct cdb_hp *hash; -- uint32 numentries; -+ uint32_t numentries; - buffer b; -- uint32 pos; -+ uint32_t pos; - int fd; - } ; - - extern int cdb_make_start(struct cdb_make *,int); - extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int); --extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32); -+extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32_t); - extern int cdb_make_add(struct cdb_make *,char *,unsigned int,char *,unsigned int); - extern int cdb_make_finish(struct cdb_make *); - ---- a/cdbstats.c -+++ b/cdbstats.c -@@ -28,7 +28,7 @@ - if (buffer_flush(buffer_1small) == -1) die_write(); - } - --uint32 pos = 0; -+uint32_t pos = 0; - - void get(char *buf,unsigned int len) - { -@@ -43,7 +43,7 @@ - } - } - --void getnum(uint32 *num) -+void getnum(uint32_t *num) - { - char buf[4]; - get(buf,4); -@@ -70,9 +70,9 @@ - - main() - { -- uint32 eod; -- uint32 klen; -- uint32 dlen; -+ uint32_t eod; -+ uint32_t klen; -+ uint32_t dlen; - seek_pos rest; - int r; - ---- a/cdbtest.c -+++ b/cdbtest.c -@@ -24,7 +24,7 @@ - if (buffer_flush(buffer_1small) == -1) die_write(); - } - --uint32 pos = 0; -+uint32_t pos = 0; - - void get(char *buf,unsigned int len) - { -@@ -40,7 +40,7 @@ - } - } - --void getnum(uint32 *num) -+void getnum(uint32_t *num) - { - char buf[4]; - get(buf,4); -@@ -68,9 +68,9 @@ - - main() - { -- uint32 eod; -- uint32 klen; -- uint32 dlen; -+ uint32_t eod; -+ uint32_t klen; -+ uint32_t dlen; - seek_pos rest; - int r; - ---- a/Makefile -+++ b/Makefile -@@ -298,13 +298,6 @@ - uint32.h - ./compile testzero.c - --uint32.h: \ --tryulong32.c compile load uint32.h1 uint32.h2 -- ( ( ./compile tryulong32.c && ./load tryulong32 && \ -- ./tryulong32 ) >/dev/null 2>&1 \ -- && cat uint32.h2 || cat uint32.h1 ) > uint32.h -- rm -f tryulong32.o tryulong32 -- - uint32_pack.o: \ - compile uint32_pack.c uint32.h - ./compile uint32_pack.c ---- a/TARGETS -+++ b/TARGETS -@@ -1,6 +1,5 @@ - load - compile --uint32.h - cdbget.o - systype - makelib ---- a/uint32.h -+++ b/uint32.h -@@ -0,0 +1,11 @@ -+#ifndef UINT32_H -+#define UINT32_H -+ -+#include -+ -+extern void uint32_pack(char *,uint32_t); -+extern void uint32_pack_big(char *,uint32_t); -+extern void uint32_unpack(char *,uint32_t *); -+extern void uint32_unpack_big(char *,uint32_t *); -+ -+#endif ---- a/uint32.h1 -+++ b/uint32.h1 -@@ -1,11 +0,0 @@ --#ifndef UINT32_H --#define UINT32_H -- --typedef unsigned int uint32; -- --extern void uint32_pack(char *,uint32); --extern void uint32_pack_big(char *,uint32); --extern void uint32_unpack(char *,uint32 *); --extern void uint32_unpack_big(char *,uint32 *); -- --#endif ---- a/uint32.h2 -+++ b/uint32.h2 -@@ -1,11 +0,0 @@ --#ifndef UINT32_H --#define UINT32_H -- --typedef unsigned long uint32; -- --extern void uint32_pack(char *,uint32); --extern void uint32_pack_big(char *,uint32); --extern void uint32_unpack(char *,uint32 *); --extern void uint32_unpack_big(char *,uint32 *); -- --#endif ---- a/uint32_pack.c -+++ b/uint32_pack.c -@@ -1,6 +1,6 @@ - #include "uint32.h" - --void uint32_pack(char s[4],uint32 u) -+void uint32_pack(char s[4],uint32_t u) - { - s[0] = u & 255; - u >>= 8; -@@ -10,7 +10,7 @@ - s[3] = u >> 8; - } - --void uint32_pack_big(char s[4],uint32 u) -+void uint32_pack_big(char s[4],uint32_t u) - { - s[3] = u & 255; - u >>= 8; ---- a/uint32_unpack.c -+++ b/uint32_unpack.c -@@ -1,8 +1,8 @@ - #include "uint32.h" - --void uint32_unpack(char s[4],uint32 *u) -+void uint32_unpack(char s[4],uint32_t *u) - { -- uint32 result; -+ uint32_t result; - - result = (unsigned char) s[3]; - result <<= 8; -@@ -15,9 +15,9 @@ - *u = result; - } - --void uint32_unpack_big(char s[4],uint32 *u) -+void uint32_unpack_big(char s[4],uint32_t *u) - { -- uint32 result; -+ uint32_t result; - - result = (unsigned char) s[0]; - result <<= 8; diff --git a/dev-db/cdb/files/cdb-errno.patch b/dev-db/cdb/files/cdb-errno.patch new file mode 100644 index 000000000000..e037ded7aac0 --- /dev/null +++ b/dev-db/cdb/files/cdb-errno.patch @@ -0,0 +1,11 @@ +--- a/error.h ++++ b/error.h +@@ -1,7 +1,7 @@ + #ifndef ERROR_H + #define ERROR_H + +-extern int errno; ++#include + + extern int error_intr; + extern int error_nomem; diff --git a/dev-db/cdb/files/cdb-inline.patch b/dev-db/cdb/files/cdb-inline.patch new file mode 100644 index 000000000000..2d297dc62a41 --- /dev/null +++ b/dev-db/cdb/files/cdb-inline.patch @@ -0,0 +1,11 @@ +--- a/cdbmake.c ++++ b/cdbmake.c +@@ -26,7 +26,7 @@ + strerr_die2x(111,FATAL,"unable to read input: bad format"); + } + +-inline void get(char *ch) ++static inline void get(char *ch) + { + switch(buffer_GETC(buffer_0,ch)) { + case 0: die_readformat(); diff --git a/dev-db/cdb/files/cdb-stdint.patch b/dev-db/cdb/files/cdb-stdint.patch new file mode 100644 index 000000000000..1775fd84f906 --- /dev/null +++ b/dev-db/cdb/files/cdb-stdint.patch @@ -0,0 +1,419 @@ +--- a/cdb.c ++++ b/cdb.c +@@ -41,7 +41,7 @@ + } + } + +-int cdb_read(struct cdb *c,char *buf,unsigned int len,uint32 pos) ++int cdb_read(struct cdb *c,char *buf,unsigned int len,uint32_t pos) + { + if (c->map) { + if ((pos > c->size) || (c->size - pos < len)) goto FORMAT; +@@ -67,7 +67,7 @@ + return -1; + } + +-static int match(struct cdb *c,char *key,unsigned int len,uint32 pos) ++static int match(struct cdb *c,char *key,unsigned int len,uint32_t pos) + { + char buf[32]; + int n; +@@ -87,8 +87,8 @@ + int cdb_findnext(struct cdb *c,char *key,unsigned int len) + { + char buf[8]; +- uint32 pos; +- uint32 u; ++ uint32_t pos; ++ uint32_t u; + + if (!c->loop) { + u = cdb_hash(key,len); +--- a/cdbdump.c ++++ b/cdbdump.c +@@ -18,7 +18,7 @@ + if (buffer_flush(buffer_1) == -1) die_write(); + } + +-uint32 pos = 0; ++uint32_t pos = 0; + + void get(char *buf,unsigned int len) + { +@@ -37,7 +37,7 @@ + + char buf[512]; + +-void copy(uint32 len) ++void copy(uint32_t len) + { + unsigned int x; + +@@ -50,7 +50,7 @@ + } + } + +-void getnum(uint32 *num) ++void getnum(uint32_t *num) + { + get(buf,4); + uint32_unpack(buf,num); +@@ -60,9 +60,9 @@ + + main() + { +- uint32 eod; +- uint32 klen; +- uint32 dlen; ++ uint32_t eod; ++ uint32_t klen; ++ uint32_t dlen; + + getnum(&eod); + while (pos < 2048) getnum(&dlen); +--- a/cdbget.c ++++ b/cdbget.c +@@ -27,8 +27,8 @@ + { + char *key; + int r; +- uint32 pos; +- uint32 len; ++ uint32_t pos; ++ uint32_t len; + unsigned long u = 0; + + if (!*argv) die_usage(); +--- a/cdb.h ++++ b/cdb.h +@@ -6,26 +6,26 @@ + #include "uint32.h" + + #define CDB_HASHSTART 5381 +-extern uint32 cdb_hashadd(uint32,unsigned char); +-extern uint32 cdb_hash(char *,unsigned int); ++extern uint32_t cdb_hashadd(uint32_t,unsigned char); ++extern uint32_t cdb_hash(char *,unsigned int); + + struct cdb { + char *map; /* 0 if no map is available */ + int fd; +- uint32 size; /* initialized if map is nonzero */ +- uint32 loop; /* number of hash slots searched under this key */ +- uint32 khash; /* initialized if loop is nonzero */ +- uint32 kpos; /* initialized if loop is nonzero */ +- uint32 hpos; /* initialized if loop is nonzero */ +- uint32 hslots; /* initialized if loop is nonzero */ +- uint32 dpos; /* initialized if cdb_findnext() returns 1 */ +- uint32 dlen; /* initialized if cdb_findnext() returns 1 */ ++ uint32_t size; /* initialized if map is nonzero */ ++ uint32_t loop; /* number of hash slots searched under this key */ ++ uint32_t khash; /* initialized if loop is nonzero */ ++ uint32_t kpos; /* initialized if loop is nonzero */ ++ uint32_t hpos; /* initialized if loop is nonzero */ ++ uint32_t hslots; /* initialized if loop is nonzero */ ++ uint32_t dpos; /* initialized if cdb_findnext() returns 1 */ ++ uint32_t dlen; /* initialized if cdb_findnext() returns 1 */ + } ; + + extern void cdb_free(struct cdb *); + extern void cdb_init(struct cdb *,int fd); + +-extern int cdb_read(struct cdb *,char *,unsigned int,uint32); ++extern int cdb_read(struct cdb *,char *,unsigned int,uint32_t); + + extern void cdb_findstart(struct cdb *); + extern int cdb_findnext(struct cdb *,char *,unsigned int); +--- a/cdb_hash.c ++++ b/cdb_hash.c +@@ -2,15 +2,15 @@ + + #include "cdb.h" + +-uint32 cdb_hashadd(uint32 h,unsigned char c) ++uint32_t cdb_hashadd(uint32_t h,unsigned char c) + { + h += (h << 5); + return h ^ c; + } + +-uint32 cdb_hash(char *buf,unsigned int len) ++uint32_t cdb_hash(char *buf,unsigned int len) + { +- uint32 h; ++ uint32_t h; + + h = CDB_HASHSTART; + while (len) { +--- a/cdb_make.c ++++ b/cdb_make.c +@@ -19,15 +19,15 @@ + return seek_set(fd,c->pos); + } + +-static int posplus(struct cdb_make *c,uint32 len) ++static int posplus(struct cdb_make *c,uint32_t len) + { +- uint32 newpos = c->pos + len; ++ uint32_t newpos = c->pos + len; + if (newpos < len) { errno = error_nomem; return -1; } + c->pos = newpos; + return 0; + } + +-int cdb_make_addend(struct cdb_make *c,unsigned int keylen,unsigned int datalen,uint32 h) ++int cdb_make_addend(struct cdb_make *c,unsigned int keylen,unsigned int datalen,uint32_t h) + { + struct cdb_hplist *head; + +@@ -74,11 +74,11 @@ + { + char buf[8]; + int i; +- uint32 len; +- uint32 u; +- uint32 memsize; +- uint32 count; +- uint32 where; ++ uint32_t len; ++ uint32_t u; ++ uint32_t memsize; ++ uint32_t count; ++ uint32_t where; + struct cdb_hplist *x; + struct cdb_hp *hp; + +@@ -99,7 +99,7 @@ + } + + memsize += c->numentries; /* no overflow possible up to now */ +- u = (uint32) 0 - (uint32) 1; ++ u = UINT32_MAX; + u /= sizeof(struct cdb_hp); + if (memsize > u) { errno = error_nomem; return -1; } + +--- a/cdbmake.c ++++ b/cdbmake.c +@@ -41,7 +41,7 @@ + unsigned int klen; + unsigned int dlen; + unsigned int i; +- uint32 h; ++ uint32_t h; + int fd; + char ch; + +--- a/cdb_make.h ++++ b/cdb_make.h +@@ -8,7 +8,7 @@ + + #define CDB_HPLIST 1000 + +-struct cdb_hp { uint32 h; uint32 p; } ; ++struct cdb_hp { uint32_t h; uint32_t p; } ; + + struct cdb_hplist { + struct cdb_hp hp[CDB_HPLIST]; +@@ -19,20 +19,20 @@ + struct cdb_make { + char bspace[8192]; + char final[2048]; +- uint32 count[256]; +- uint32 start[256]; ++ uint32_t count[256]; ++ uint32_t start[256]; + struct cdb_hplist *head; + struct cdb_hp *split; /* includes space for hash */ + struct cdb_hp *hash; +- uint32 numentries; ++ uint32_t numentries; + buffer b; +- uint32 pos; ++ uint32_t pos; + int fd; + } ; + + extern int cdb_make_start(struct cdb_make *,int); + extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int); +-extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32); ++extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32_t); + extern int cdb_make_add(struct cdb_make *,char *,unsigned int,char *,unsigned int); + extern int cdb_make_finish(struct cdb_make *); + +--- a/cdbstats.c ++++ b/cdbstats.c +@@ -28,7 +28,7 @@ + if (buffer_flush(buffer_1small) == -1) die_write(); + } + +-uint32 pos = 0; ++uint32_t pos = 0; + + void get(char *buf,unsigned int len) + { +@@ -43,7 +43,7 @@ + } + } + +-void getnum(uint32 *num) ++void getnum(uint32_t *num) + { + char buf[4]; + get(buf,4); +@@ -70,9 +70,9 @@ + + main() + { +- uint32 eod; +- uint32 klen; +- uint32 dlen; ++ uint32_t eod; ++ uint32_t klen; ++ uint32_t dlen; + seek_pos rest; + int r; + +--- a/cdbtest.c ++++ b/cdbtest.c +@@ -24,7 +24,7 @@ + if (buffer_flush(buffer_1small) == -1) die_write(); + } + +-uint32 pos = 0; ++uint32_t pos = 0; + + void get(char *buf,unsigned int len) + { +@@ -40,7 +40,7 @@ + } + } + +-void getnum(uint32 *num) ++void getnum(uint32_t *num) + { + char buf[4]; + get(buf,4); +@@ -68,9 +68,9 @@ + + main() + { +- uint32 eod; +- uint32 klen; +- uint32 dlen; ++ uint32_t eod; ++ uint32_t klen; ++ uint32_t dlen; + seek_pos rest; + int r; + +--- a/Makefile ++++ b/Makefile +@@ -298,13 +298,6 @@ + uint32.h + ./compile testzero.c + +-uint32.h: \ +-tryulong32.c compile load uint32.h1 uint32.h2 +- ( ( ./compile tryulong32.c && ./load tryulong32 && \ +- ./tryulong32 ) >/dev/null 2>&1 \ +- && cat uint32.h2 || cat uint32.h1 ) > uint32.h +- rm -f tryulong32.o tryulong32 +- + uint32_pack.o: \ + compile uint32_pack.c uint32.h + ./compile uint32_pack.c +--- a/TARGETS ++++ b/TARGETS +@@ -1,6 +1,5 @@ + load + compile +-uint32.h + cdbget.o + systype + makelib +--- a/uint32.h ++++ b/uint32.h +@@ -0,0 +1,11 @@ ++#ifndef UINT32_H ++#define UINT32_H ++ ++#include ++ ++extern void uint32_pack(char *,uint32_t); ++extern void uint32_pack_big(char *,uint32_t); ++extern void uint32_unpack(char *,uint32_t *); ++extern void uint32_unpack_big(char *,uint32_t *); ++ ++#endif +--- a/uint32.h1 ++++ b/uint32.h1 +@@ -1,11 +0,0 @@ +-#ifndef UINT32_H +-#define UINT32_H +- +-typedef unsigned int uint32; +- +-extern void uint32_pack(char *,uint32); +-extern void uint32_pack_big(char *,uint32); +-extern void uint32_unpack(char *,uint32 *); +-extern void uint32_unpack_big(char *,uint32 *); +- +-#endif +--- a/uint32.h2 ++++ b/uint32.h2 +@@ -1,11 +0,0 @@ +-#ifndef UINT32_H +-#define UINT32_H +- +-typedef unsigned long uint32; +- +-extern void uint32_pack(char *,uint32); +-extern void uint32_pack_big(char *,uint32); +-extern void uint32_unpack(char *,uint32 *); +-extern void uint32_unpack_big(char *,uint32 *); +- +-#endif +--- a/uint32_pack.c ++++ b/uint32_pack.c +@@ -1,6 +1,6 @@ + #include "uint32.h" + +-void uint32_pack(char s[4],uint32 u) ++void uint32_pack(char s[4],uint32_t u) + { + s[0] = u & 255; + u >>= 8; +@@ -10,7 +10,7 @@ + s[3] = u >> 8; + } + +-void uint32_pack_big(char s[4],uint32 u) ++void uint32_pack_big(char s[4],uint32_t u) + { + s[3] = u & 255; + u >>= 8; +--- a/uint32_unpack.c ++++ b/uint32_unpack.c +@@ -1,8 +1,8 @@ + #include "uint32.h" + +-void uint32_unpack(char s[4],uint32 *u) ++void uint32_unpack(char s[4],uint32_t *u) + { +- uint32 result; ++ uint32_t result; + + result = (unsigned char) s[3]; + result <<= 8; +@@ -15,9 +15,9 @@ + *u = result; + } + +-void uint32_unpack_big(char s[4],uint32 *u) ++void uint32_unpack_big(char s[4],uint32_t *u) + { +- uint32 result; ++ uint32_t result; + + result = (unsigned char) s[0]; + result <<= 8; diff --git a/dev-db/cdb/metadata.xml b/dev-db/cdb/metadata.xml index 85e4ed814fa2..987ce1bc2ed6 100644 --- a/dev-db/cdb/metadata.xml +++ b/dev-db/cdb/metadata.xml @@ -1,5 +1,8 @@ - + + hattya@gentoo.org + Akinori Hattori + -- cgit v1.2.3