Add .gitignore, tidy up function prototypes (improves compiler warnings)
authorNick Downing <nick@ndcode.org>
Mon, 5 Nov 2018 22:52:25 +0000 (09:52 +1100)
committerNick Downing <nick@ndcode.org>
Tue, 6 Nov 2018 00:08:37 +0000 (11:08 +1100)
18 files changed:
.gitignore [new file with mode: 0644]
src/include/btbucket.h
src/include/crc.h
src/include/error.h
src/include/mem.h
src/include/metric.h
src/include/objalloc.h
src/include/poolalloc.h
src/include/rbtree.h
src/include/reposset.h
src/include/staticalloc.h
src/include/storagep.h
src/include/str.h
src/include/stream.h
src/include/testutils.h
src/include/trec_eval.h
src/poolalloc.c
src/test/rbtree_1.c

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..c05aeaa
--- /dev/null
@@ -0,0 +1,63 @@
+*.a
+*.la
+*.lo
+*.o
+.libs
+/Makefile
+/btree
+/build
+/chash.test
+/config.log
+/config.status
+/hashtime
+/lcrand.test
+/libtool
+/mime.test
+/mlparse.test
+/mlparse_wrap.test
+/objalloc.test
+/poolalloc.test
+/psettings_gen
+/psettings_gen.test
+/setup.py
+/src/.deps
+/src/.dirstamp
+/src/.libs
+/src/include/config.h
+/src/include/stamp-h1
+/src/libtextcodec/.deps
+/src/libtextcodec/.dirstamp
+/src/libtextcodec/.libs
+/src/test/.deps
+/src/test/.dirstamp
+/src/test/binsearch_1
+/src/test/bit_1
+/src/test/bucket_1
+/src/test/docmap_1
+/src/test/freemap_1
+/src/test/getlongopt_1
+/src/test/heap_1
+/src/test/iobtree_1
+/src/test/mem_1
+/src/test/mlparse_1
+/src/test/poolalloc_1
+/src/test/rbtree_1
+/src/test/stack_1
+/src/test/stop_1
+/src/test/str_1
+/src/pyzet/index.map.0
+/src/pyzet/index.param.0
+/src/pyzet/index.v.0
+/src/pyzet/index.vocab.0
+/staticalloc.test
+/stem.test
+/stop_gen
+/tools/.deps
+/tools/.dirstamp
+/zet
+/zet_cat
+/zet_dict
+/zet_diff
+/zet_file
+/zet_impactify
+/zet_trec
index 98d2e9e..edbcfe1 100644 (file)
@@ -58,7 +58,7 @@ int btbucket_set_prefix(void *btbucket, unsigned int bucketsize,
   void *prefix, unsigned int *prefix_size);
 
 /* size of a btbucket internal node entry */
-unsigned int btbucket_entry_size();
+unsigned int btbucket_entry_size(void);
 
 /* decodes a btbucket internal node entry (entry must be of size
  * btbucket_entry_size) */
index ae6a901..dbc643e 100644 (file)
@@ -13,7 +13,7 @@
 struct crc;
 
 /* create a new CRC object */
-struct crc *crc_new();
+struct crc *crc_new(void);
 
 /* reinitialise the CRC object, to restart the checksumming */
 void crc_reinit(struct crc *crc);
index 0edc61e..19aac7e 100644 (file)
 /*
  *  Is there an error to report?.
  */
-int error_has_msg();
+int error_has_msg(void);
 
 /*
  *  Get the last error message as set by error_loc()/ERROR().
  */
-const char * error_last_msg();
+const char * error_last_msg(void);
 
 /*
  *  Get the last error code as set by error_loc()/ERROR().
  */
-int error_last_code();
+int error_last_code(void);
 
 /*
  *  Set the stream that errors are logged to.
index 6f239d1..cc9cad4 100644 (file)
@@ -46,16 +46,16 @@ void *mem_set(void *b, int c, unsigned int len);
 /* alignment stuff */
 
 /* get alignments of basic types */
-unsigned int mem_align_char();
-unsigned int mem_align_short();
-unsigned int mem_align_int();
-unsigned int mem_align_long();
-unsigned int mem_align_float();
-unsigned int mem_align_double();
-unsigned int mem_align_ptr();
+unsigned int mem_align_char(void);
+unsigned int mem_align_short(void);
+unsigned int mem_align_int(void);
+unsigned int mem_align_long(void);
+unsigned int mem_align_float(void);
+unsigned int mem_align_double(void);
+unsigned int mem_align_ptr(void);
 
 /* return the maximum alignment (probably) for this platform */
-unsigned int mem_align_max();
+unsigned int mem_align_max(void);
 
 /* return the next point in the buffer that conforms to the given alignment.
  * align is assumed to be a power of two. */
index 8896d13..83b4649 100644 (file)
 #define METRIC_H
 
 /* okapi metric */
-const struct search_metric *okapi_k3();
+const struct search_metric *okapi_k3(void);
 
 /* dirichlet metric */
-const struct search_metric *dirichlet();
+const struct search_metric *dirichlet(void);
 
 /* pivoted cosine metric */
-const struct search_metric *pcosine();
+const struct search_metric *pcosine(void);
 
 /* (incredibly simple) cosine metric */
-const struct search_metric *cosine();
+const struct search_metric *cosine(void);
 
 /* Dave Hawking's AF1 metric */
-const struct search_metric *hawkapi();
+const struct search_metric *hawkapi(void);
 
 #endif
 
index e736f58..8649415 100644 (file)
@@ -78,13 +78,13 @@ int objalloc_is_managed(struct objalloc *alloc, void *ptr);
 unsigned int objalloc_objsize(struct objalloc *obj);
 
 /* overhead on first block allocated */
-unsigned int objalloc_overhead_first();
+unsigned int objalloc_overhead_first(void);
 
 /* overhead on blocks after first allocated */
-unsigned int objalloc_overhead();
+unsigned int objalloc_overhead(void);
 
 /* returns the amount of memory held by the allocator */
-unsigned int objalloc_memsize();
+unsigned int objalloc_memsize(struct objalloc *obj, void *ptr);
 
 #ifdef __cplusplus
 }
index c3538a7..c573228 100644 (file)
@@ -70,8 +70,8 @@ unsigned int poolalloc_allocated(struct poolalloc *pool);
 int poolalloc_is_managed(struct poolalloc *pool, void *ptr);
 
 /* memory overhead of the first and subsequent chunks allocated */
-unsigned int poolalloc_overhead_first();
-unsigned int poolalloc_overhead();
+unsigned int poolalloc_overhead_first(void);
+unsigned int poolalloc_overhead(void);
 
 #ifdef __cplusplus
 }
index 3648a9d..0268cc3 100644 (file)
@@ -51,7 +51,7 @@ struct rbtree *rbtree_ptr_new(int (*cmp)(const void *key1, const void *key2));
 
 /* create a new red-black tree that will have unsigned long ints as keys, with
  * natural ordering.  Returns NULL on failure. */
-struct rbtree *rbtree_luint_new();
+struct rbtree *rbtree_luint_new(void);
 
 /* delete a red-black tree.  This operation can fail (as traversing the tree to
  * free the contained nodes requires dynamic memory), but operates on a best
index c31b079..1e1141e 100644 (file)
@@ -28,7 +28,7 @@ enum reposset_ret {
 
 struct reposset;
 
-struct reposset *reposset_new();
+struct reposset *reposset_new(void);
 void reposset_delete(struct reposset *rset);
 
 /* add a new repository.  reposno will contain the number assigned to this
index 847b75a..1d2a93c 100644 (file)
@@ -45,7 +45,7 @@ unsigned int staticalloc_allocated(struct staticalloc *alloc);
  * otherwise. */
 int staticalloc_is_managed(struct staticalloc *alloc, void *ptr);
 
-unsigned int staticalloc_overhead();
+unsigned int staticalloc_overhead(void);
 
 /* STATICALLOC_DECL is a macro to make it convenient to allocate space 
  * on the stack.  Provide the variable name and a constant number of bytes 
index 0efb746..4307a10 100644 (file)
@@ -34,7 +34,7 @@ struct storagep {
 };
 
 /* return the space needed to store a set of storage parameters */
-unsigned int storagep_size();
+unsigned int storagep_size(void);
 
 /* read a set of storage parameters from memory (where memory is at least
  * storagep_size bytes long) */
index c5aa2aa..6feaf0e 100644 (file)
@@ -161,7 +161,7 @@ unsigned int str_strip(char *str);
 
 /* indicates whether characters are signed or not by default (1 if they are, 0
  * if they are not) */
-int str_signed_char();
+int str_signed_char(void);
 #define STR_SIGNED_CHAR (((int) ((char) 255)) == -1)     /* macro version */
 
 /* get an integer value from a character, forcing character values into [0,255]
index f3f5226..dcdad97 100644 (file)
@@ -154,7 +154,7 @@ struct stream_filter {
 };
 
 /* create a new stream */
-struct stream *stream_new();
+struct stream *stream_new(void);
 
 /* flush output from a stream.  The exact behaviour depends on which flush value
  * is given.  Currently only FLUSH_FINISH is available, which flushes all output
index fca6130..61f0a14 100644 (file)
@@ -36,7 +36,7 @@ extern char tu_sample_data[];
 
 extern int tu_sample_data_inited;
 
-void tu_sample_data_rand_init();
+void tu_sample_data_rand_init(void);
 
 int tu_sample_data_file_init(const char * fname);
 
index 0050aba..0c86997 100644 (file)
@@ -79,7 +79,7 @@ struct treceval_statistics {
 /* initialises an new treceval: sets memory aside for raw results;
  * returns a pointer to a new struct treceval which needs to be freed by
  * a call to the next function after useage */
-struct treceval *treceval_new();
+struct treceval *treceval_new(void);
 
 /* releases all memory and points *trecResults to NULL;
  * expects a pointer to a pointer of a treceval structure for which
index a0b3755..deff058 100644 (file)
@@ -343,11 +343,11 @@ unsigned int poolalloc_pages(struct poolalloc *pool) {
     return pages;
 }
 
-unsigned int poolalloc_overhead_first(struct poolalloc *pool) {
+unsigned int poolalloc_overhead_first(void) {
     return sizeof(struct poolalloc);
 }
 
-unsigned int poolalloc_overhead(struct poolalloc *pool) {
+unsigned int poolalloc_overhead(void) {
     return sizeof(struct poolalloc_chunk);
 }
 
index 195e227..1cbfca2 100644 (file)
@@ -164,7 +164,7 @@ const char *rettostr(enum rbtree_ret ret) {
     }
 }
 
-int luintcmp(const void *key1, const void *key2) {
+/*int luintcmp(const void *key1, const void *key2) {
     const unsigned long int *lu1 = key1,
                             *lu2 = key2;
 
@@ -175,7 +175,7 @@ int luintcmp(const void *key1, const void *key2) {
     } else {
         return 0;
     }
-}
+}*/
 
 int test_file(FILE *fp, int argc, char **argv) {
     char *pos;
@@ -412,7 +412,7 @@ int test_file(FILE *fp, int argc, char **argv) {
 
             /* read parameters */
             if ((fscanf(fp, "%255s", name) == 1)
-              && (rbtree = rbtree_luint_new(luintcmp))) {
+              && (rbtree = rbtree_luint_new(/*luintcmp*/))) {
                 /* succeeded, do nothing */
                 if (params.verbose) {
                     printf("%s: new rbtree\n", name);