Permalink
Browse files

Merge pull request #55 from wltrimbl/updatesparsehash

Updates sparsehash to 2.0.3 dating from 2015-10-12
  • Loading branch information...
2 parents a3eb7c1 + 848a290 commit ae1bb523f1e2ef80fcf6b3c494f543c617b9d41a @ExpressionAnalysis committed on GitHub May 9, 2017
Showing with 4,075 additions and 1,174 deletions.
  1. +4 −4 clipper/Makefile
  2. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/AUTHORS
  3. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/COPYING
  4. +5 −0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/ChangeLog
  5. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/INSTALL
  6. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/Makefile.am
  7. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/Makefile.in
  8. +6 −1 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/NEWS
  9. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/README
  10. +25 −25 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/README_windows.txt
  11. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/TODO
  12. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/aclocal.m4
  13. +23 −0 clipper/sparsehash-2.0.3/autogen.sh
  14. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/config.guess
  15. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/config.sub
  16. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/configure
  17. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/configure.ac
  18. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/depcomp
  19. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/dense_hash_map.html
  20. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/dense_hash_set.html
  21. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/designstyle.css
  22. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/implementation.html
  23. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/index.html
  24. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/performance.html
  25. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/sparse_hash_map.html
  26. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/sparse_hash_set.html
  27. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/sparsetable.html
  28. +9 −0 clipper/sparsehash-2.0.3/experimental/Makefile
  29. +14 −0 clipper/sparsehash-2.0.3/experimental/README
  30. +55 −0 clipper/sparsehash-2.0.3/experimental/example.c
  31. +1,538 −0 clipper/sparsehash-2.0.3/experimental/libchash.c
  32. +253 −0 clipper/sparsehash-2.0.3/experimental/libchash.h
  33. +71 −0 clipper/sparsehash-2.0.3/google-sparsehash.sln
  34. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/install-sh
  35. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/acx_pthread.m4
  36. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/google_namespace.m4
  37. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/namespaces.m4
  38. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/stl_hash.m4
  39. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/stl_hash_fun.m4
  40. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/missing
  41. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/packages/deb.sh
  42. +7 −0 clipper/sparsehash-2.0.3/packages/deb/README
  43. +173 −0 clipper/sparsehash-2.0.3/packages/deb/changelog
  44. +1 −0 clipper/sparsehash-2.0.3/packages/deb/compat
  45. +17 −0 clipper/sparsehash-2.0.3/packages/deb/control
  46. +36 −0 clipper/sparsehash-2.0.3/packages/deb/copyright
  47. +16 −0 clipper/sparsehash-2.0.3/packages/deb/docs
  48. +117 −0 clipper/sparsehash-2.0.3/packages/deb/rules
  49. +5 −0 clipper/sparsehash-2.0.3/packages/deb/sparsehash.dirs
  50. +6 −0 clipper/sparsehash-2.0.3/packages/deb/sparsehash.install
  51. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/packages/rpm.sh
  52. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/packages/rpm/rpm.spec
  53. +63 −63 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/sparsehash.sln
  54. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/config.h.in
  55. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/config.h.include
  56. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/dense_hash_map
  57. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/dense_hash_set
  58. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparse_hash_map
  59. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparse_hash_set
  60. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/densehashtable.h
  61. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/hashtable-common.h
  62. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/libc_allocator_with_realloc.h
  63. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/sparsehashtable.h
  64. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsetable
  65. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/template_util.h
  66. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/type_traits.h
  67. +3 −3 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/hash_test_interface.h
  68. +3 −3 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/hashtable_test.cc
  69. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/libc_allocator_with_realloc_test.cc
  70. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/simple_compat_test.cc
  71. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/simple_test.cc
  72. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/dense_hash_map
  73. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/dense_hash_set
  74. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/densehashtable.h
  75. +1 −1 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/hashtable-common.h
  76. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/libc_allocator_with_realloc.h
  77. +3 −3 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/sparsehashtable.h
  78. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/sparse_hash_map
  79. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/sparse_hash_set
  80. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/sparsetable
  81. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/template_util.h
  82. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/type_traits.h
  83. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsetable_unittest.cc
  84. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/template_util_unittest.cc
  85. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/testutil.h
  86. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/time_hash_map.cc
  87. 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/type_traits_unittest.cc
  88. +149 −0 clipper/sparsehash-2.0.3/src/windows/config.h
  89. +49 −0 clipper/sparsehash-2.0.3/src/windows/google/sparsehash/sparseconfig.h
  90. +64 −0 clipper/sparsehash-2.0.3/src/windows/port.cc
  91. +72 −0 clipper/sparsehash-2.0.3/src/windows/port.h
  92. +49 −0 clipper/sparsehash-2.0.3/src/windows/sparsehash/internal/sparseconfig.h
  93. +197 −197 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/hashtable_test/hashtable_test.vcproj
  94. +161 −161 ...sehash-2.0.3}/vsprojects/libc_allocator_with_realloc_test/libc_allocator_with_realloc_test.vcproj
  95. +188 −188 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/simple_test/simple_test.vcproj
  96. +170 −170 ...{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/sparsetable_unittest/sparsetable_unittest.vcproj
  97. +167 −0 clipper/sparsehash-2.0.3/vsprojects/template_util_unittest/template_util_unittest.vcproj
  98. +188 −188 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/time_hash_map/time_hash_map.vcproj
  99. +167 −167 ...{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/type_traits_unittest/type_traits_unittest.vcproj
View
@@ -42,7 +42,7 @@ getrel:
$(PKG).spec:
perl -pe 's/%RELEASE%/${REL}/' $(PKG).spex > $(PKG).spec
-$(PKG).tar.gz: Makefile $(TOOLS) $(SRC) $(PKG).spec fastq-lib.cpp fastq-lib.h sam-stats.cpp fastq-stats.cpp gcModel.cpp gcModel.h varcall.cpp utils.h README CHANGES sparsehash-2.0.2 samtools/*.c t
+$(PKG).tar.gz: Makefile $(TOOLS) $(SRC) $(PKG).spec fastq-lib.cpp fastq-lib.h sam-stats.cpp fastq-stats.cpp gcModel.cpp gcModel.h varcall.cpp utils.h README CHANGES sparsehash-2.0.3 samtools/*.c t
rm -rf $(PKG).${VER}-${REL}
mkdir $(PKG).${VER}-${REL}
mkdir $(PKG).${VER}-${REL}/tidx
@@ -68,10 +68,10 @@ $(PKG).${VER}-${REL}.tar.gz: $(PKG).tar.gz
%: %.cpp fastq-lib.cpp fastq-lib.h sparsehash
$(CC) $(CFLAGS) $< fastq-lib.cpp -o $@
-sparsehash: sparsehash-2.0.2
- cd sparsehash-2.0.2; ./configure; make
+sparsehash: sparsehash-2.0.3
+ cd sparsehash-2.0.3; ./configure; make
mkdir sparsehash
- cp -r sparsehash-2.0.2/src/sparsehash/* sparsehash/
+ cp -r sparsehash-2.0.3/src/sparsehash/* sparsehash/
# why the libbam.a doesn't work? not sure... *.o works
sam-stats: sam-stats.cpp samtools/libbam.a samtools/bam.h fastq-lib.h sparsehash
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,8 @@
+Mon Oct 12 21:00:00 2015 Google Inc. <google-sparsehash@googlegroups.com>
+
+ * sparsehash: version 2.0.3
+ * Fix compilation on modern compilers and operating systems
+
Thu Feb 23 23:47:18 2012 Google Inc. <google-sparsehash@googlegroups.com>
* sparsehash: version 2.0.2
File renamed without changes.
@@ -1,4 +1,9 @@
-== 23 Ferbruary 2012 ==
+== 12 October 2015 ==
+
+Various small fixes to ensure compilation on modern compilers and operating
+systems. Tagged as 2.0.3
+
+== 23 February 2012 ==
A backwards incompatibility arose from flattening the include headers
structure for the <google> folder.
File renamed without changes.
@@ -1,25 +1,25 @@
-This project has been ported to Windows. A working solution file
-exists in this directory:
- sparsehash.sln
-
-You can load this solution file into either VC++ 7.1 (Visual Studio
-2003) or VC++ 8.0 (Visual Studio 2005) -- in the latter case, it will
-automatically convert the files to the latest format for you.
-
-When you build the solution, it will create a number of
-unittests,which you can run by hand (or, more easily, under the Visual
-Studio debugger) to make sure everything is working properly on your
-system. The binaries will end up in a directory called "debug" or
-"release" in the top-level directory (next to the .sln file).
-
-Note that these systems are set to build in Debug mode by default.
-You may want to change them to Release mode.
-
-I have little experience with Windows programming, so there may be
-better ways to set this up than I've done! If you run across any
-problems, please post to the google-sparsehash Google Group, or report
-them on the sparsehash Google Code site:
- http://groups.google.com/group/google-sparsehash
- http://code.google.com/p/sparsehash/issues/list
-
--- craig
+This project has been ported to Windows. A working solution file
+exists in this directory:
+ sparsehash.sln
+
+You can load this solution file into either VC++ 7.1 (Visual Studio
+2003) or VC++ 8.0 (Visual Studio 2005) -- in the latter case, it will
+automatically convert the files to the latest format for you.
+
+When you build the solution, it will create a number of
+unittests,which you can run by hand (or, more easily, under the Visual
+Studio debugger) to make sure everything is working properly on your
+system. The binaries will end up in a directory called "debug" or
+"release" in the top-level directory (next to the .sln file).
+
+Note that these systems are set to build in Debug mode by default.
+You may want to change them to Release mode.
+
+I have little experience with Windows programming, so there may be
+better ways to set this up than I've done! If you run across any
+problems, please post to the google-sparsehash Google Group, or report
+them on the sparsehash Google Code site:
+ http://groups.google.com/group/google-sparsehash
+ http://code.google.com/p/sparsehash/issues/list
+
+-- craig
File renamed without changes.
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Before using, you should figure out all the .m4 macros that your
+# configure.m4 script needs and make sure they exist in the m4/
+# directory.
+#
+# These are the files that this script might edit:
+# aclocal.m4 configure Makefile.in src/config.h.in \
+# compile config.guess config.sub depcomp install-sh missing mkinstalldirs
+#
+# Here's a command you can run to see what files aclocal will import:
+# aclocal -I ../autoconf --output=- | sed -n 's/^m4_include..\([^]]*\).*/\1/p'
+
+set -ex
+rm -rf autom4te.cache
+
+aclocal --force -I m4
+autoconf -f -W all,no-obsolete
+autoheader -f -W all
+automake -a -c -f -W all
+
+rm -rf autom4te.cache
+exit 0
File renamed without changes.
@@ -0,0 +1,9 @@
+example: example.o libchash.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+.SUFFIXES: .c .o .h
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+example.o: example.c libchash.h
+libchash.o: libchash.c libchash.h
@@ -0,0 +1,14 @@
+This is a C version of sparsehash (and also, maybe, densehash) that I
+wrote way back when, and served as the inspiration for the C++
+version. The API for the C version is much uglier than the C++,
+because of the lack of template support. I believe the class works,
+but I'm not convinced it's really flexible or easy enough to use.
+
+It would be nice to rework this C class to follow the C++ API as
+closely as possible (eg have a set_deleted_key() instead of using a
+#define like this code does now). I believe the code compiles and
+runs, if anybody is interested in using it now, but it's subject to
+major change in the future, as people work on it.
+
+Craig Silverstein
+20 March 2005
@@ -0,0 +1,55 @@
+#include <sparsehash/internal/sparseconfig.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+#include "libchash.h"
+
+static void TestInsert() {
+ struct HashTable* ht;
+ HTItem* bck;
+
+ ht = AllocateHashTable(1, 0); /* value is 1 byte, 0: don't copy keys */
+
+ HashInsert(ht, PTR_KEY(ht, "January"), 31); /* 0: don't overwrite old val */
+ bck = HashInsert(ht, PTR_KEY(ht, "February"), 28);
+ bck = HashInsert(ht, PTR_KEY(ht, "March"), 31);
+
+ bck = HashFind(ht, PTR_KEY(ht, "February"));
+ assert(bck);
+ assert(bck->data == 28);
+
+ FreeHashTable(ht);
+}
+
+static void TestFindOrInsert() {
+ struct HashTable* ht;
+ int i;
+ int iterations = 1000000;
+ int range = 30; /* random number between 1 and 30 */
+
+ ht = AllocateHashTable(4, 0); /* value is 4 bytes, 0: don't copy keys */
+
+ /* We'll test how good rand() is as a random number generator */
+ for (i = 0; i < iterations; ++i) {
+ int key = rand() % range;
+ HTItem* bck = HashFindOrInsert(ht, key, 0); /* initialize to 0 */
+ bck->data++; /* found one more of them */
+ }
+
+ for (i = 0; i < range; ++i) {
+ HTItem* bck = HashFind(ht, i);
+ if (bck) {
+ printf("%3d: %d\n", bck->key, bck->data);
+ } else {
+ printf("%3d: 0\n", i);
+ }
+ }
+
+ FreeHashTable(ht);
+}
+
+int main(int argc, char** argv) {
+ TestInsert();
+ TestFindOrInsert();
+ return 0;
+}
Oops, something went wrong.

0 comments on commit ae1bb52

Please sign in to comment.