diff --git a/.gitignore b/.gitignore index b772d1c..f984a67 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/uthash-*.tar.gz +/v1.9.8.tar.gz +/uthash-1.9.9.tar.gz diff --git a/sources b/sources index b640b01..c6700e7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (uthash-2.3.0.tar.gz) = 3b01f1074790fb242900411cb16eb82c1a9afcf58e3196a0f4611d9d7ef94690ad38c0a500e7783d3efa20328aa8d6ab14f246be63b3b3d385502ba2b6b2a294 +c3ce9197c818dcb7ca85b59912f310a4 uthash-1.9.9.tar.gz diff --git a/uthash-remove-failed-tests.patch b/uthash-remove-failed-tests.patch new file mode 100644 index 0000000..78d7292 --- /dev/null +++ b/uthash-remove-failed-tests.patch @@ -0,0 +1,417 @@ +From c3aef1064b79db79c0982cc92f8f993ace8e3cc6 Mon Sep 17 00:00:00 2001 +From: "Troy D. Hanson" +Date: Mon, 15 Apr 2013 22:36:12 -0400 +Subject: [PATCH] Clean up warnings and rm tests w/32-64 variance + +--- + tests/Makefile | 2 +- + tests/hashscan.c | 1 + + tests/test74.c | 2 +- + tests/test75.c | 2 +- + tests/test76.c | 2 +- + tests/test77.c | 2 +- + tests/test83.ans | 51 --------------------------------------------------- + tests/test83.c | 35 ----------------------------------- + tests/test83.dat | 51 --------------------------------------------------- + tests/test84.ans | 51 --------------------------------------------------- + tests/test84.c | 36 ------------------------------------ + tests/test84.dat | 51 --------------------------------------------------- + 12 files changed, 6 insertions(+), 280 deletions(-) + delete mode 100644 tests/test83.ans + delete mode 100644 tests/test83.c + delete mode 100644 tests/test83.dat + delete mode 100644 tests/test84.ans + delete mode 100644 tests/test84.c + delete mode 100644 tests/test84.dat + +diff --git a/tests/Makefile b/tests/Makefile +index b887c95..1d7cb7e 100644 +--- a/tests/Makefile ++++ b/tests/Makefile +@@ -13,7 +13,7 @@ PROGS = test1 test2 test3 test4 test5 test6 test7 test8 test9 \ + test58 test59 test60 test61 test62 test63 test64 test65 \ + test66 test67 test68 test69 test70 test71 test72 test73 \ + test74 test75 test76 test77 test78 test79 test80 test81 \ +- test82 test83 test84 ++ test82 + CFLAGS = -I$(HASHDIR) + #CFLAGS += -DHASH_BLOOM=16 + #CFLAGS += -O2 +diff --git a/tests/hashscan.c b/tests/hashscan.c +index 65c53ae..ea6c5ff 100644 +--- a/tests/hashscan.c ++++ b/tests/hashscan.c +@@ -86,6 +86,7 @@ int infer_hash_function(char *key, size_t keylen, uint32_t hashv) { + HASH_FNV(key,keylen,num_bkts,ohashv,obkt); if (ohashv == hashv) return FNV; + HASH_OAT(key,keylen,num_bkts,ohashv,obkt); if (ohashv == hashv) return OAT; + HASH_MUR(key,keylen,num_bkts,ohashv,obkt); if (ohashv == hashv) return MUR; ++ obkt++; // this quiets an unused variable warning. yes, this is a ugly hack + return 0; + } + +diff --git a/tests/test74.c b/tests/test74.c +index 549bbb2..4910488 100644 +--- a/tests/test74.c ++++ b/tests/test74.c +@@ -32,7 +32,7 @@ int main() { + V_FindCnt++; + } + } while (V_FindPos >= 0); +- printf("FindCnt=%u\n", V_FindCnt); ++ printf("FindCnt=%u\n", (unsigned)V_FindCnt); + + utstring_free(s); + utstring_free(t); +diff --git a/tests/test75.c b/tests/test75.c +index d486934..d7520f5 100644 +--- a/tests/test75.c ++++ b/tests/test75.c +@@ -32,7 +32,7 @@ int main() { + V_FindCnt++; + } + } while (V_FindPos >= 0); +- printf("FindCnt=%u\n", V_FindCnt); ++ printf("FindCnt=%u\n", (unsigned)V_FindCnt); + + utstring_free(s); + utstring_free(t); +diff --git a/tests/test76.c b/tests/test76.c +index 385046f..d975978 100644 +--- a/tests/test76.c ++++ b/tests/test76.c +@@ -42,7 +42,7 @@ int main() { + } + printf("utstring_find()=%ld\n", V_FindPos); + } while (V_FindPos >= 0); +- printf("FindCnt=%u\n", V_FindCnt); ++ printf("FindCnt=%u\n", (unsigned)V_FindCnt); + + free(V_KMP_Table); + } +diff --git a/tests/test77.c b/tests/test77.c +index 42054b3..5d74942 100644 +--- a/tests/test77.c ++++ b/tests/test77.c +@@ -41,7 +41,7 @@ int main() { + } + printf("utstring_find()=%ld\n", V_FindPos); + } while (V_FindPos >= 0); +- printf("FindCnt=%u\n", V_FindCnt); ++ printf("FindCnt=%u\n", (unsigned)V_FindCnt); + + free(V_KMP_Table); + } +diff --git a/tests/test83.ans b/tests/test83.ans +deleted file mode 100644 +index 666b752..0000000 +--- a/tests/test83.ans ++++ /dev/null +@@ -1,51 +0,0 @@ +-items in hash: 1, overhead: 460 +-items in hash: 2, overhead: 492 +-items in hash: 3, overhead: 524 +-items in hash: 4, overhead: 556 +-items in hash: 5, overhead: 588 +-items in hash: 6, overhead: 620 +-items in hash: 7, overhead: 652 +-items in hash: 8, overhead: 684 +-items in hash: 9, overhead: 716 +-items in hash: 10, overhead: 748 +-items in hash: 11, overhead: 780 +-items in hash: 12, overhead: 812 +-items in hash: 13, overhead: 844 +-items in hash: 14, overhead: 876 +-items in hash: 15, overhead: 908 +-items in hash: 16, overhead: 940 +-items in hash: 17, overhead: 972 +-items in hash: 18, overhead: 1004 +-items in hash: 19, overhead: 1036 +-items in hash: 20, overhead: 1068 +-items in hash: 21, overhead: 1100 +-items in hash: 22, overhead: 1132 +-items in hash: 23, overhead: 1164 +-items in hash: 24, overhead: 1196 +-items in hash: 25, overhead: 1228 +-items in hash: 26, overhead: 1260 +-items in hash: 27, overhead: 1292 +-items in hash: 28, overhead: 1324 +-items in hash: 29, overhead: 1356 +-items in hash: 30, overhead: 1388 +-items in hash: 31, overhead: 1420 +-items in hash: 32, overhead: 1452 +-items in hash: 33, overhead: 1484 +-items in hash: 34, overhead: 1516 +-items in hash: 35, overhead: 1548 +-items in hash: 36, overhead: 1580 +-items in hash: 37, overhead: 1612 +-items in hash: 38, overhead: 1644 +-items in hash: 39, overhead: 1676 +-items in hash: 40, overhead: 1708 +-items in hash: 41, overhead: 1740 +-items in hash: 42, overhead: 1772 +-items in hash: 43, overhead: 1804 +-items in hash: 44, overhead: 1836 +-items in hash: 45, overhead: 1868 +-items in hash: 46, overhead: 1900 +-items in hash: 47, overhead: 1932 +-items in hash: 48, overhead: 1964 +-items in hash: 49, overhead: 1996 +-items in hash: 50, overhead: 2028 +-items in hash: 51, overhead: 2060 +diff --git a/tests/test83.c b/tests/test83.c +deleted file mode 100644 +index 5d458e2..0000000 +--- a/tests/test83.c ++++ /dev/null +@@ -1,35 +0,0 @@ +-#include "uthash.h" +-#include /* malloc */ +-#include /* perror */ +-#include /* printf */ +- +-#define BUFLEN 20 +- +-typedef struct name_rec { +- char boy_name[BUFLEN]; +- UT_hash_handle hh; +-} name_rec; +- +-int main(int argc,char *argv[]) { +- name_rec *name, *names=NULL; +- char linebuf[BUFLEN]; +- FILE *file; +- +- if ( (file = fopen( "test83.dat", "r" )) == NULL ) { +- perror("can't open: "); +- exit(-1); +- } +- +- while (fgets(linebuf,BUFLEN,file) != NULL) { +- if ( (name = (name_rec*)malloc(sizeof(name_rec))) == NULL) exit(-1); +- strncpy(name->boy_name,linebuf,BUFLEN); +- HASH_ADD_STR(names,boy_name,name); +- printf("items in hash: %u, overhead: %u\n",(unsigned)HASH_COUNT(names), +- (unsigned)HASH_OVERHEAD(hh,names)); +- } +- +- fclose(file); +- +- return 0; +-} +- +diff --git a/tests/test83.dat b/tests/test83.dat +deleted file mode 100644 +index bb6051b..0000000 +--- a/tests/test83.dat ++++ /dev/null +@@ -1,51 +0,0 @@ +-JOHN +-WILLIAM +-WALTER +-DOUGLAS +-GERALD +-FREDERICK +-WARREN +-SHANE +-LESTER +-RON +-HARVEY +-ADRIAN +-CODY +-NELSON +-CLIFTON +-WILLARD +-DOUG +-ORLANDO +-REX +-OMAR +-DAMON +-LOWELL +-IRVING +-CARROLL +-LAURENCE +-ROLANDO +-CARY +-XAVIER +-ISAIAH +-GUS +-JARVIS +-WINFRED +-RAYMUNDO +-LINCOLN +-CORNELL +-NIGEL +-NORMAND +-FRITZ +-DONN +-TRINIDAD +-ODIS +-DANNIE +-DARIO +-KENTON +-CHONG +-NEVILLE +-TONEY +-WARNER +-WES +-COLTON +-ARNOLDO +diff --git a/tests/test84.ans b/tests/test84.ans +deleted file mode 100644 +index 7b3cc1e..0000000 +--- a/tests/test84.ans ++++ /dev/null +@@ -1,51 +0,0 @@ +-items in hash: 1, overhead: 8664 +-items in hash: 2, overhead: 8696 +-items in hash: 3, overhead: 8728 +-items in hash: 4, overhead: 8760 +-items in hash: 5, overhead: 8792 +-items in hash: 6, overhead: 8824 +-items in hash: 7, overhead: 8856 +-items in hash: 8, overhead: 8888 +-items in hash: 9, overhead: 8920 +-items in hash: 10, overhead: 8952 +-items in hash: 11, overhead: 8984 +-items in hash: 12, overhead: 9016 +-items in hash: 13, overhead: 9048 +-items in hash: 14, overhead: 9080 +-items in hash: 15, overhead: 9112 +-items in hash: 16, overhead: 9144 +-items in hash: 17, overhead: 9176 +-items in hash: 18, overhead: 9208 +-items in hash: 19, overhead: 9240 +-items in hash: 20, overhead: 9272 +-items in hash: 21, overhead: 9304 +-items in hash: 22, overhead: 9336 +-items in hash: 23, overhead: 9368 +-items in hash: 24, overhead: 9400 +-items in hash: 25, overhead: 9432 +-items in hash: 26, overhead: 9464 +-items in hash: 27, overhead: 9496 +-items in hash: 28, overhead: 9528 +-items in hash: 29, overhead: 9560 +-items in hash: 30, overhead: 9592 +-items in hash: 31, overhead: 9624 +-items in hash: 32, overhead: 9656 +-items in hash: 33, overhead: 9688 +-items in hash: 34, overhead: 9720 +-items in hash: 35, overhead: 9752 +-items in hash: 36, overhead: 9784 +-items in hash: 37, overhead: 9816 +-items in hash: 38, overhead: 9848 +-items in hash: 39, overhead: 9880 +-items in hash: 40, overhead: 9912 +-items in hash: 41, overhead: 9944 +-items in hash: 42, overhead: 9976 +-items in hash: 43, overhead: 10008 +-items in hash: 44, overhead: 10040 +-items in hash: 45, overhead: 10072 +-items in hash: 46, overhead: 10104 +-items in hash: 47, overhead: 10136 +-items in hash: 48, overhead: 10168 +-items in hash: 49, overhead: 10200 +-items in hash: 50, overhead: 10232 +-items in hash: 51, overhead: 10264 +diff --git a/tests/test84.c b/tests/test84.c +deleted file mode 100644 +index 92f0749..0000000 +--- a/tests/test84.c ++++ /dev/null +@@ -1,36 +0,0 @@ +-#define HASH_BLOOM 16 +-#include "uthash.h" +-#include /* malloc */ +-#include /* perror */ +-#include /* printf */ +- +-#define BUFLEN 20 +- +-typedef struct name_rec { +- char boy_name[BUFLEN]; +- UT_hash_handle hh; +-} name_rec; +- +-int main(int argc,char *argv[]) { +- name_rec *name, *names=NULL; +- char linebuf[BUFLEN]; +- FILE *file; +- +- if ( (file = fopen( "test84.dat", "r" )) == NULL ) { +- perror("can't open: "); +- exit(-1); +- } +- +- while (fgets(linebuf,BUFLEN,file) != NULL) { +- if ( (name = (name_rec*)malloc(sizeof(name_rec))) == NULL) exit(-1); +- strncpy(name->boy_name,linebuf,BUFLEN); +- HASH_ADD_STR(names,boy_name,name); +- printf("items in hash: %u, overhead: %u\n",(unsigned)HASH_COUNT(names), +- (unsigned)HASH_OVERHEAD(hh,names)); +- } +- +- fclose(file); +- +- return 0; +-} +- +diff --git a/tests/test84.dat b/tests/test84.dat +deleted file mode 100644 +index bb6051b..0000000 +--- a/tests/test84.dat ++++ /dev/null +@@ -1,51 +0,0 @@ +-JOHN +-WILLIAM +-WALTER +-DOUGLAS +-GERALD +-FREDERICK +-WARREN +-SHANE +-LESTER +-RON +-HARVEY +-ADRIAN +-CODY +-NELSON +-CLIFTON +-WILLARD +-DOUG +-ORLANDO +-REX +-OMAR +-DAMON +-LOWELL +-IRVING +-CARROLL +-LAURENCE +-ROLANDO +-CARY +-XAVIER +-ISAIAH +-GUS +-JARVIS +-WINFRED +-RAYMUNDO +-LINCOLN +-CORNELL +-NIGEL +-NORMAND +-FRITZ +-DONN +-TRINIDAD +-ODIS +-DANNIE +-DARIO +-KENTON +-CHONG +-NEVILLE +-TONEY +-WARNER +-WES +-COLTON +-ARNOLDO +-- +1.8.1.6 + diff --git a/uthash.spec b/uthash.spec index 7bf0b2a..c4cdafc 100644 --- a/uthash.spec +++ b/uthash.spec @@ -1,214 +1,50 @@ +# This package builds a header-only lib, but has some testsuite to check +# the headers' function. For this reason the main-pkg is build arched and +# produces a noarched subpkg, only. There is no binary-compiled bits and +# therefore no debuginfo generated. +%global debug_package %{nil} + Name: uthash -Version: 2.3.0 -Release: 12%{?dist} +Version: 1.9.9 +Release: 9%{?dist} Summary: A hash table for C structures - -License: BSD-1-Clause -URL: http://troydhanson.github.io/%{name} -Source0: https://github.com/troydhanson/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz - -BuildRequires: asciidoc -BuildRequires: gcc -BuildRequires: make -BuildRequires: perl-interpreter -BuildRequires: perl(strict) -BuildRequires: perl(warnings) +License: BSD +URL: http://troydhanson.github.io/uthash +Source0: https://github.com/troydhanson/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz %description -Any C structure can be stored in a hash table using uthash. Just -add a UT_hash_handle to the structure and choose one or more fields -in your structure to act as the key. Then use these macros to store, -retrieve or delete items from the hash table. +Any C structure can be stored in a hash table using uthash. Just add a +UT_hash_handle to the structure and choose one or more fields in your +structure to act as the key. Then use these macros to store, retrieve or +delete items from the hash table. - -%package devel -Summary: A hash table for C structures (headers only) - -# c-compiled libraries have been dropped upstream. -Obsoletes: libut < 2.3.0 -Obsoletes: libut-devel < 2.3.0 - -Provides: %{name} = %{version}-%{release} +%package devel +Summary: Development files for %{name} Provides: %{name}-static = %{version}-%{release} -Provides: libut = %{version}-%{release} -Provides: libut-devel = %{version}-%{release} - BuildArch: noarch -%description devel -Any C structure can be stored in a hash table using uthash. Just -add a UT_hash_handle to the structure and choose one or more fields -in your structure to act as the key. Then use these macros to store, -retrieve or delete items from the hash table. - - -%package tools -Summary: Command-line utilities for %{name} -Requires: %{name} = %{version}-%{release} - -%description tools -This package provides the hashscan and keystats utility programs -for %{name}. - -The hashscan program examines a running process and reports on the -uthash tables that it finds in that program’s memory. It can also -save the keys from each table in a format that can be fed into keystats. - -The keystats program is able to analyze which hash function has the best -characteristics on the set of keys reported by the hashscan program. - - -%package doc -Summary: Documentation-files for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - -%description doc -This package contains the documentation-files for %{name}. - +%description devel +This package contains libraries and header files for +developing applications that use %{name}. %prep -%autosetup -p1 - +%setup -q %build -%set_build_flags -%make_build -C doc -%make_build -C tests -%make_build -C tests/threads - +# This is a header only package. %install -mkdir -p %{buildroot}{%{_bindir},%{_includedir},%{_pkgdocdir}/html} -install -pm 0755 tests/{hashscan,keystats} %{buildroot}%{_bindir} -install -pm 0644 src/*.h %{buildroot}%{_includedir} -# Install doc. -install -pm 0644 doc/*.txt tests/example.c %{buildroot}%{_pkgdocdir} -install -pm 0644 doc/*.html doc/*.css doc/*.png %{buildroot}%{_pkgdocdir}/html -rm -f %{buildroot}%{_pkgdocdir}/html/google*.html +install -d %{buildroot}%{_includedir} +install -pm0644 src/*.h %{buildroot}%{_includedir}/ +%check +make %{?_smp_mflags} -C tests/ %files devel -%license LICENSE -%doc %dir %{_pkgdocdir} -%doc %{_pkgdocdir}/ChangeLog.txt -%{_includedir}/*.h - - -%files tools -%{_bindir}/* - - -%files doc -%doc %{_pkgdocdir} - +%doc LICENSE doc/*.txt +%{_includedir}/ut*.h %changelog -* Fri Jul 17 2026 Fedora Release Engineering - 2.3.0-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Tue Jan 20 2026 Fedora Release Engineering - 2.3.0-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Fri Jul 25 2025 Fedora Release Engineering - 2.3.0-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Sun Jan 19 2025 Fedora Release Engineering - 2.3.0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Sat Jul 20 2024 Fedora Release Engineering - 2.3.0-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat Jan 27 2024 Fedora Release Engineering - 2.3.0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sat Jul 22 2023 Fedora Release Engineering - 2.3.0-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Jun 27 2023 Björn Esser - 2.3.0-5 -- Add tools package -- Add explicit perl BRs -- Add example program to doc package -- Drop google site-verification file from doc package -- Require main package in doc package to avoid file conflicts - -* Sat Jan 21 2023 Fedora Release Engineering - 2.3.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 2.3.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Jan 22 2022 Fedora Release Engineering - 2.3.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Thu Dec 23 2021 Björn Esser - 2.3.0-1 -- Update to 2.3.0 -- Obsolete libut as it has been dropped upstream - -* Fri Jul 23 2021 Fedora Release Engineering - 2.0.2-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Jan 27 2021 Fedora Release Engineering - 2.0.2-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 2.0.2-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Fri Jan 31 2020 Fedora Release Engineering - 2.0.2-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sat Jul 27 2019 Fedora Release Engineering - 2.0.2-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sun Feb 03 2019 Fedora Release Engineering - 2.0.2-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sat Jul 14 2018 Fedora Release Engineering - 2.0.2-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Feb 09 2018 Fedora Release Engineering - 2.0.2-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Aug 03 2017 Fedora Release Engineering - 2.0.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 2.0.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Mar 04 2017 Björn Esser - 2.0.2-1 -- New upstream release (rhbz#1429106) - -* Sat Feb 11 2017 Fedora Release Engineering - 2.0.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Fri Dec 30 2016 Björn Esser - 2.0.1-6 -- Fix dir-ownership in %%doc - -* Fri Dec 30 2016 Björn Esser - 2.0.1-5 -- Introduce doc-subpackage -- Use unified %%_pkgdocdir -- Updated Patch0 and use on el <= 6, only -- Rename Patch0 --> Patch 1000 -- Clean-up indentation - - -* Thu Dec 29 2016 Björn Esser - 2.0.1-4 -- Include plain ascii-docs, too - -* Thu Dec 29 2016 Björn Esser - 2.0.1-3 -- Properly build the documentation - -* Sun Dec 18 2016 Björn Esser - 2.0.1-2 -- Run testsuite with threads, too - -* Sat Dec 17 2016 Björn Esser - 2.0.1-1 -- Update to new upstream release v2.0.1 -- Introduce libut / libvector -- Add BR: perl - -* Fri Feb 05 2016 Fedora Release Engineering - 1.9.9-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - * Fri Jun 19 2015 Fedora Release Engineering - 1.9.9-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild