Removed definition of GUILE_PTHREAD_COMPAT inside commentary
[bpt/guile.git] / libguile / objects.c
index 16a8c0b..6421e10 100644 (file)
@@ -1,4 +1,4 @@
-/*     Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
+/*     Copyright (C) 1995, 1996, 1999, 2000 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -58,6 +58,9 @@
 #include "smob.h"
 #include "eval.h"
 #include "alist.h"
+#include "ports.h"
+#include "strings.h"
+#include "vectors.h"
 
 #include "validate.h"
 #include "objects.h"
@@ -157,22 +160,15 @@ scm_class_of (SCM x)
 
        case scm_tc7_smob:
          {
-           SCM type = SCM_TYP16 (x);
-           if (type == scm_tc16_flo)
-             {
-               if (SCM_CAR (x) & SCM_IMAG_PART)
-                 return scm_class_complex;
-               else
-                 return scm_class_real;
-             }
-           else if (type != scm_tc16_port_with_ps)
+           long type = SCM_TYP16 (x);
+           if (type != scm_tc16_port_with_ps)
              return scm_smob_class[SCM_TC2SMOBNUM (type)];
            x = SCM_PORT_WITH_PS_PORT (x);
            /* fall through to ports */
          }
        case scm_tc7_port:
-         return scm_port_class[(SCM_WRTNG & SCM_CAR (x)
-                                ? (SCM_RDNG & SCM_CAR (x)
+         return scm_port_class[(SCM_WRTNG & SCM_UNPACK_CAR (x)
+                                ? (SCM_RDNG & SCM_UNPACK_CAR (x)
                                    ? SCM_INOUT_PCLASS_INDEX | SCM_PTOBNUM (x)
                                    : SCM_OUT_PCLASS_INDEX | SCM_PTOBNUM (x))
                                 : SCM_IN_PCLASS_INDEX | SCM_PTOBNUM (x))];
@@ -280,7 +276,7 @@ scm_mcache_lookup_cmethod (SCM cache, SCM args)
       if (SCM_NIMP (ls))
        do
          {
-           i += (SCM_STRUCT_DATA (scm_class_of (SCM_CAR (ls)))
+           i += SCM_UNPACK (SCM_STRUCT_DATA (scm_class_of (SCM_CAR (ls)))
                  [scm_si_hashsets + hashset]);
            ls = SCM_CDR (ls);
          }
@@ -496,3 +492,9 @@ scm_init_objects ()
 
 #include "objects.x"
 }
+
+/*
+  Local Variables:
+  c-file-style: "gnu"
+  End:
+*/