]> mj.ucw.cz Git - libucw.git/commitdiff
Clean up #undef's.
authorMartin Mares <mj@ucw.cz>
Sat, 8 Sep 2007 20:49:54 +0000 (22:49 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 8 Sep 2007 20:49:54 +0000 (22:49 +0200)
lib/sorter/TODO
lib/sorter/array.h
lib/sorter/common.h
lib/sorter/sorter.h

index a86acf1e42cd3897ca1d69b5a3632851a3853b1c..ed0af57b3de5a42cdd31a7111a79e082f96b6412 100644 (file)
@@ -5,10 +5,11 @@ o  Empty files.
 
 Cleanups:
 o  Clean up data types and make sure they cannot overflow. (size_t vs. u64 vs. sh_off_t vs. uns)
+o  Clean up log levels.
+o  Clean up introductory comments.
 o  Log messages should show both original and new size of the data. The speed
    should be probably calculated from the former.
 o  Automatically tune ASORT_MIN_RADIX, ASORT_MIN_SHIFT and especially ASORT_RADIX_BITS.
-o  Check undefs in sorter.h and array.h.
 
 Improvements:
 o  Switching between direct and normal I/O. Should use normal I/O if the input is small enough.
index 0f18741b451d1f4a1223c5817b29ac78a6726dcb..076f6d33dfd0f0858a90cab7a297a7f0251ebdb5 100644 (file)
@@ -23,7 +23,7 @@
  *  ASORT_PREFIX(x) [*]        add a name prefix (used on all global names
  *                     defined by the sorter)
  *  ASORT_KEY_TYPE  [*]        data type of a single array entry key
- *  ASORT_LT(x,y)      x < y for ASORT_TYPE (default: "x<y")
+ *  ASORT_LT(x,y)      x < y for ASORT_KEY_TYPE (default: "x<y")
  *  ASORT_HASH(x)      a monotone hash function (safisfying hash(x) < hash(y) => x<y)
  *  ASORT_LONG_HASH    hashes are 64-bit numbers (default is 32 bits)
  *
@@ -308,15 +308,14 @@ static Q(key) *Q(sort)(Q(key) *array, uns num_elts
   return ctx.array;
 }
 
-/* FIXME */
-#undef ASORT_PREFIX
+#undef ASORT_HASH
 #undef ASORT_KEY_TYPE
+#undef ASORT_LONG_HASH
 #undef ASORT_LT
-#undef ASORT_SWAP
-#undef ASORT_THRESHOLD
 #undef ASORT_PAGE_ALIGNED
-#undef ASORT_HASH
+#undef ASORT_PREFIX
 #undef ASORT_RADIX_BITS
 #undef ASORT_RADIX_MASK
-#undef ASORT_LONG_HASH
+#undef ASORT_SWAP
+#undef ASORT_THRESHOLD
 #undef Q
index cae6cf92c3bc64f2c61026faf72116961bad0ce1..ad16382a6c732229d494a52914e22aa2d2595c7b 100644 (file)
@@ -124,7 +124,7 @@ struct asort_context {
   void *buffer;                                // Auxiliary buffer (required when radix-sorting)
   uns num_elts;                                // Number of elements in the array
   uns elt_size;                                // Bytes per element
-  uns hash_bits;                       // Remaining bits of hash function
+  uns hash_bits;                       // Remaining bits of the hash function
   uns radix_bits;                      // How many bits to process in a single radix-sort pass
   void (*quicksort)(void *array_ptr, uns num_elts);
   void (*quicksplit)(void *array_ptr, uns num_elts, int *leftp, int *rightp);
index 971e6e67b91d9102d837f4aa06ff13afc70ab887..c8924840135d2f0d0337d093d8c1160bea41f21a 100644 (file)
@@ -282,30 +282,30 @@ static struct fastbuf *P(sort)(
   return ctx.out_fb;
 }
 
-#undef SORT_PREFIX
-#undef SORT_KEY
-#undef SORT_KEY_REGULAR
-#undef SORT_KEY_SIZE
+#undef SORT_ASSERT_UNIQUE
 #undef SORT_DATA_SIZE
-#undef SORT_VAR_KEY
-#undef SORT_VAR_DATA
-#undef SORT_INT
-#undef SORT_INT64
+#undef SORT_DELETE_INPUT
 #undef SORT_HASH_BITS
-#undef SORT_UNIFY
-#undef SORT_UNIFY_WORKSPACE
-#undef SORT_INPUT_FILE
 #undef SORT_INPUT_FB
+#undef SORT_INPUT_FILE
+#undef SORT_INPUT_PIPE
 #undef SORT_INPUT_PRESORT
-#undef SORT_OUTPUT_FILE
+#undef SORT_INT
+#undef SORT_INT64
+#undef SORT_INTERNAL_RADIX
+#undef SORT_KEY
+#undef SORT_KEY_REGULAR
+#undef SORT_KEY_SIZE
+#undef SORT_LONG_HASH
 #undef SORT_OUTPUT_FB
+#undef SORT_OUTPUT_FILE
 #undef SORT_OUTPUT_THIS_FB
+#undef SORT_PREFIX
+#undef SORT_UNIFY
+#undef SORT_UNIFY_WORKSPACE
 #undef SORT_UNIQUE
-#undef SORT_ASSERT_UNIQUE
-#undef SORT_DELETE_INPUT
-#undef SORT_INTERNAL_RADIX
-#undef SORT_LONG_HASH
+#undef SORT_VAR_DATA
+#undef SORT_VAR_KEY
 #undef SWAP
 #undef LESS
 #undef P
-/* FIXME: Check that we undef everything we should. */