]> thyrsus.com Git - comparator.git/commitdiff
Use standard uint64_t rather than long long.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 12 Oct 2014 20:19:32 +0000 (16:19 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 12 Oct 2014 20:19:32 +0000 (16:19 -0400)
Makefile
NEWS
comparator.spec [deleted file]
hash.c
hash.h

index 4a6ce0333009408de7fafce0958ce7246d656385..b124431ef5074421778bca4f74b98d695c3f6fbd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -103,5 +103,5 @@ comparator-$(VERS).tar.gz: $(SOURCES) comparator.1
 dist: comparator-$(VERS).tar.gz
 
 release: comparator-$(VERS).tar.gz comparator.html
-       shipper -u -m -t; make clean
+       shipper version=$(VERS) | sh -e -x
 
diff --git a/NEWS b/NEWS
index 09a0cfa0bdb95fc40b3a3f0e673d4304a30d100b..152de14e7b950c70fbf77c799ed065cb81465fe0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Repository head:
+  Use standard uint64_t rather than long long.
+
 2.9: 2012-11-24
   Exclude .git/.bzr/.hg repo directories as well as .svn.
 
diff --git a/comparator.spec b/comparator.spec
deleted file mode 100644 (file)
index 9525450..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-Name: comparator
-Summary: fast comparison of large source-code trees
-Version: 2.8
-Release: 1
-License: BSD
-Group: Utilities
-URL: http://www.catb.org/~esr/comparator/
-Source0: %{name}-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-root
-#Destinations: freshmeat
-#Project-Tag-List: source code, comparison, forensics, copyright
-
-%description
-comparator and filterator are a pair of tools for rapidly finding common
-code segments in large source trees.  They can be useful as tools for 
-detecting copyright infringement.
-
-%prep
-%setup -q
-
-%build
-make %{?_smp_mflags} comparator comparator.1
-
-%install
-[ "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
-mkdir -p "$RPM_BUILD_ROOT"%{_bindir}
-mkdir -p "$RPM_BUILD_ROOT"%{_mandir}/man1/
-set -- `ls -d %{_libdir}/python*/site-packages/`
-while [ "$2" ]; do shift; done;
-pylib=$1
-mkdir -p "$RPM_BUILD_ROOT"${pylib}
-cp comparator filterator "$RPM_BUILD_ROOT"%{_bindir}
-cp comparator.1 "$RPM_BUILD_ROOT"%{_mandir}/man1/
-cp comparator.py "$RPM_BUILD_ROOT"${pylib}
-
-%clean
-[ "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
-
-%files
-%defattr(-,root,root,-)
-%doc README COPYING
-%{_bindir}/comparator
-%{_bindir}/filterator
-%{_mandir}/man1/comparator.1*
-%{_libdir}/python*/site-packages/comparator.py
-
-%changelog
-* Tue Oct 19 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.8-1
-- Change license to BSD. Tweak Python to use hashlib rather than
-  the deprecated md5 module.  Suppress some compiler warnings.
-
-* Fri Jan  7 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.7-1
-- Improvements to regression-test machinery.  
-- Document the FAQ about comparing a tree to itself.
-
-* Mon Sep 20 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.6-1
-- Ignore .svn files and and SVN subdirectories.  Typo fixes on manual page.
-
-* Sat Aug  7 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.5-1
-- Alan Burlinson's tweaks to ease porting to SunOS. Emil Sit's 
-  dramatic speedup for SCF-file reads.  Fix incorrect statistics
-  generation with filterator -mfF options -- counts were too high.
-  Documentation fixes.
-
-* Thu Mar 11 2004 Eric S. Raymond <esr@snark.thyrsus.com> 2.4-1
-- Fixed strtok() bug apparently introduced by C library change.
-  Added -n, -f, and -F options to filterator.
-
-* Mon Dec 29 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.3-1
-- Source RPMs no longer depend on myversion symbol.
-- New -N option style supports multiple normalizers.
-- Fix a bug that might have caused a SEGV on really large shreds.
-
-* Wed Dec 24 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.2-1
-- Better error reporting in comparator.py.
-- Fix a packaging error.
-
-* Tue Sep 19 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.1-1
-- Refactored code to make it possible to plug in new feature analyzers.
-- Logic for handling trailing blank lines in files works slightly better.
-
-* Mon Sep 18 2003 Eric S. Raymond <esr@snark.thyrsus.com> 2.0-1
-- Now uses custom 8-byte digest function suggested by Ron Rivest, the inventor
-  of MD5.  The new function is faster and about halves the size of SCF files.
-  This format change is not compatible with 1.x versions.
-- There is a new -m option to set the minimum span size to be output.
-  The filterator -s option has been changed to -m to match it.
-- filterator is now a wrapper around comparator.py, a loadable Python
-  module which can be used to write other report generators.
-- Significance filtering for C and shell is now done within comparator
-  itself, and is accordingly much faster.
-- FreeBSD port patches from Warren Toomey.
-
-* Fri Sep 15 2003 Eric S. Raymond <esr@snark.thyrsus.com> 1.6-1
-- Regression-test production now in place.
-- Second application of qsort trick, for significant speedups on
-  trees with many common matches.
-- New -v option to enable progress messages; they're off by default.
-
-* Fri Sep 12 2003 Eric S. Raymond <esr@snark.thyrsus.com> 1.5-1
-- Fix bug in -r option.
-- Capture trailing braces (as on C functions) in chunks even when they are
-  ignored for comparison purposes.
-- Range reports now include the line length of the file.
-- Documentation improvements.
-
-* Fri Sep 12 2003 Eric S. Raymond <esr@snark.thyrsus.com> 1.4-1
-- Fix brown-paper-bag bug in reduction logic, introduced when I optimized it.
-- SCF-B format now includes codebase size so we can compute percentages.
-- filterator now generates a trailer containing percentage overlaps.
-
-* Fri Sep 12 2003 Eric S. Raymond <esr@snark.thyrsus.com> 1.3-1
-- -C now implies -w.
-- A new -r option strips comments.
-- Code is cleaned up to pass gcc -Wall.
-- filterator can now perform significance checks on shreds from shellscripts.
-- There        is now a progress meter while making SCF files.
-- The logic for merging ranges has been seriously speed-tuned and is 
-  66% faster.  This code is O(n--2) on the number of common shreds and
-  is the bottleneck on large trees.
-
-* Wed Sep 10 2003 Eric S. Raymond <esr@snark.thyrsus.com> 1.2-1
-- Add -C option; -w wasn't good enough to make indent-style difference
-  invisible by itself.
-
-* Tue Sep 09 2003 Eric S. Raymond <esr@snark.thyrsus.com> 1.1-1
-- Fix silly division by zero error. Add COPYING file.
-- Add -s option to filterator and make it ignore form feeds in filtered mode.
-
-* Sun Sep  7 2003 Eric S. Raymond <esr@snark.thyrsus.com> 1.0
-- Initial build.
-
-
-
-
diff --git a/hash.c b/hash.c
index 58737bba257d7f3ac17ff190a41f7f0ff5f0d730..11caf610b2224c99c3cb7fdd2d5f1562f4dfda1b 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -62,6 +62,8 @@ Other good material is at <http://burtleburtle.net/bob/hash/>.
 
 ****************************************************************************/
 
+#include <inttypes.h>
+
 #include "hashtab.h"   /* table T of magic values */
 
 /* following code only relies on hashval_t being an integral type */
@@ -96,7 +98,7 @@ char *hash_dump(hashval_t hash)
 {
     static char buffer[33];
 
-    snprintf(buffer, sizeof(buffer)-1, "%016llx", hash);
+    snprintf(buffer, sizeof(buffer)-1, "%016" PRIx64, hash);
     return(buffer);
 }
 
diff --git a/hash.h b/hash.h
index 5c1c3311c495e991cd94f1b913727318b94204d4..0cb762b38e152df4e6e04c4fee9b16a4a4ae0fbc 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -1,7 +1,9 @@
 /* interface file for comparator hash function */
 
+#include <stdint.h>
+
 #ifndef FORCE_MD5
-typedef unsigned long long     hashval_t;
+typedef uint64_t       hashval_t;
 #define HASHMETHOD     "RXOR"
 #else
 typedef unsigned char  hashval_t[16];