]> git.donarmstrong.com Git - lilypond.git/commitdiff
* flower/hash.cc: Remove.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 17 Aug 2003 21:30:05 +0000 (21:30 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 17 Aug 2003 21:30:05 +0000 (21:30 +0000)
* flower/include/dictionary.hh (V>): Compile fix: Remove assignment
to (nonexistent?) hash_func_ identifier.

* python/midi.c (midi_error, midi_warning): Use char const* for
__FUNCTION__ argument.

ChangeLog
flower/hash.cc [deleted file]
flower/include/dictionary.hh
python/midi.c

index 4bbddb6753f66f0386a64c550e32373ab0f92cad..95ffbeace6c6fcb2b1e0439d1ae9360c154a79d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2003-08-17  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * flower/hash.cc: Remove.
+
+       * flower/include/dictionary.hh (V>): Compile fix: Remove assignment
+       to (nonexistent?) hash_func_ identifier.
+
+       * python/midi.c (midi_error, midi_warning): Use char const* for
+       __FUNCTION__ argument.
+
        * python/gettext.py: Remove.  We already require python 2.1, which
        includes gettext.py.
 
diff --git a/flower/hash.cc b/flower/hash.cc
deleted file mode 100644 (file)
index 78ae587..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*   
-  hash.cc --  implement various functions for hash tables.
-  
-  source file of the Flower Library
-  
-  (c)  1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-#include "string.hh"
-#include "array.hh"
-#include "dictionary.hh"
-
-
-// Note: assumes long is at least 32 bits.
-const unsigned long my_prime_list[] = 
-{
-  5, 11, 23,                   // be a bit careful for short lists: we want reasonable mem usage.
-  53,         97,         193,       389,       769,
-  1543,       3079,       6151,      12289,     24593,
-  49157,      98317,      196613,    393241,    786433,
-  1572869,    3145739,    6291469,   12582917,  25165843,
-  50331653,   100663319,  201326611, 402653189u, 805306457u, 
-  1610612741u, 3221225473u, 4294967291u
-};
-
-unsigned long
-prime_list (int idx)
-{
-  return my_prime_list [idx];
-}
-
-unsigned int
-string_hash (String s)
-{
-  const char* str = s.to_str0 ();
-  unsigned int result = 0;
-  while (1) {
-    char c = *str++;
-    if (c == 0) break;
-      result += (result<<3) + c;
-  }
-  return result;
-}
-
-
-unsigned int
-hash (unsigned int i)
-{
-  return i;
-}
-
-unsigned int
-int_hash (int i)
-{
-  return (unsigned) i;
-}
-
index 7adf8e0758bbbf0b8d34ee5061b40d6456823296..f4e8730040bbccc2af60f50441028f81ee0cedd0 100644 (file)
 
 #include <map>
 
-
 #include "string.hh"
-#include "array.hh"
-
-
-unsigned int string_hash (String);
 
 template <class V>
 struct Dict_initialiser
@@ -40,10 +35,8 @@ public:
     }
   Dictionary (Dict_initialiser<V> *p)
     {
-      hash_func_ = string_hash;
       for (Dict_initialiser<V> *q = p; q->key_; q++)
- (*this) [q->key_] = q->value_;
-         
+       (*this) [q->key_] = q->value_;
     }
   bool elem_b (String s)
   {
index 5ce8ba78f937426d4c2cccd67fb848fdc7b042ff..f815a2ecba4c8f90bfd28d1b5b224a3180036cab 100644 (file)
@@ -33,7 +33,7 @@ static PyObject *Midi_error;
 static PyObject *Midi_warning;
 
 static PyObject *
-midi_error (char func, char *s)
+midi_error (char const *func, char *s)
 {
   char*dest = (char*) malloc (sizeof (char) * (strlen (func) + strlen (s) + 1));
   strcpy (dest, func);
@@ -45,7 +45,7 @@ midi_error (char * func, char *s)
 }
 
 static PyObject *
-midi_warning (char *s)
+midi_warning (char const *s)
 {
   PyErr_SetString (Midi_warning, s);
   return 0;