guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/srfi ChangeLog srfi-14.c


From: Martin Grabmueller
Subject: guile/guile-core/srfi ChangeLog srfi-14.c
Date: Mon, 16 Jul 2001 10:02:39 -0700

CVSROOT:        /cvs
Module name:    guile
Branch:         branch_release-1-6
Changes by:     Martin Grabmueller <address@hidden>     01/07/16 10:02:39

Modified files:
        guile-core/srfi: ChangeLog srfi-14.c 

Log message:
        * srfi-14.c: Allocate correct memory size for charsets (32 bytes),
        use this value for initializing and comparing charsets.
        (scm_char_set_hash): Use ``better'' hash algorithm which produces
        more values.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/srfi/ChangeLog.diff?cvsroot=OldCVS&only_with_tag=branch_release-1-6&tr1=1.44.2.6&tr2=1.44.2.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/srfi/srfi-14.c.diff?cvsroot=OldCVS&only_with_tag=branch_release-1-6&tr1=1.9.2.4&tr2=1.9.2.5&r1=text&r2=text

Patches:
Index: guile/guile-core/srfi/ChangeLog
diff -u guile/guile-core/srfi/ChangeLog:1.50 
guile/guile-core/srfi/ChangeLog:1.51
--- guile/guile-core/srfi/ChangeLog:1.50        Sun Jul 15 11:54:28 2001
+++ guile/guile-core/srfi/ChangeLog     Mon Jul 16 08:47:02 2001
@@ -1,3 +1,10 @@
+2001-07-16  Martin Grabmueller  <address@hidden>
+
+       * srfi-14.c: Allocate correct memory size for charsets (32 bytes),
+       use this value for initializing and comparing charsets.
+       (scm_char_set_hash): Use ``better'' hash algorithm which produces
+       more values.
+
 2001-07-15  Gary Houston  <address@hidden>
 
        * srfi-14.c (scm_char_set_hash): recognise 0 instead of #f in the
Index: guile/guile-core/srfi/srfi-14.c
diff -u guile/guile-core/srfi/srfi-14.c:1.13 
guile/guile-core/srfi/srfi-14.c:1.14
--- guile/guile-core/srfi/srfi-14.c:1.13        Sun Jul 15 11:54:28 2001
+++ guile/guile-core/srfi/srfi-14.c     Mon Jul 16 08:47:02 2001
@@ -94,8 +94,8 @@
 {
   long * p;
   
-  p = scm_must_malloc (SCM_CHARSET_SIZE, func_name);
-  memset (p, 0, SCM_CHARSET_SIZE);
+  p = scm_must_malloc (SCM_CHARSET_SIZE / sizeof (char), func_name);
+  memset (p, 0, SCM_CHARSET_SIZE / sizeof (char));
   SCM_RETURN_NEWSMOB (scm_tc16_charset, p);
 }
 
@@ -131,7 +131,8 @@
       csi_data = (long *) SCM_SMOB_DATA (csi);
       if (cs1_data == NULL)
        cs1_data = csi_data;
-      else if (memcmp (cs1_data, csi_data, SCM_CHARSET_SIZE) != 0)
+      else if (memcmp (cs1_data, csi_data,
+                      SCM_CHARSET_SIZE / sizeof (char)) != 0)
        return SCM_BOOL_F;
       char_sets = SCM_CDR (char_sets);
     }
@@ -204,7 +205,8 @@
   p = (long *) SCM_SMOB_DATA (cs);
   for (k = 0; k < SCM_CHARSET_SIZE / sizeof (long); k++)
     {
-      val = p[k] ^ val;
+      if (p[k] != 0)
+        val = p[k] + (val << 1);
     }
   return SCM_MAKINUM (val % bnd);
 }
@@ -1368,7 +1370,7 @@
   if (!initialized)
     {
       scm_tc16_charset = scm_make_smob_type ("character-set", 
-                                            SCM_CHARSET_SIZE * sizeof (long));
+                                            SCM_CHARSET_SIZE / sizeof (char));
       scm_set_smob_free (scm_tc16_charset, charset_free);
       scm_set_smob_print (scm_tc16_charset, charset_print);
       initialized = 1;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]