Hi,

here are several patches for CVS head that mostly fix compiler
warnings and errors on Mac OS X and OpenBSD.

2004-11-02  Andreas V�gele  <[EMAIL PROTECTED]>

        * backtrace.c (scm_display_backtrace_with_highlights): Join the
        first and the second line of the SCM_DEFINE macro call, since old
        preprocessors cannot handle definitions that are split into two
        lines.

        * inline.h (scm_cell, scm_double_cell): Don't use C99 variable
        declarations.

        * pairs.h (scm_i_chase_pairs): Replace scm_t_uint32 with
        scm_t_bits to fix the mismatch between the function declaration
        and the definition in pairs.c.

        * sort.c (quicksort): Don't use C99 variable declarations.

        * srfi-4.c (uvec_fast_ref): Avoid a compiler warning by returning
        SCM_BOOL_F if no type matches.

        * threads.c (thread_print): Cast a pointer to size_t when printing
        with scm_uintprint.

        * unif.c (scm_i_tag_to_prototype): Make sure that "instead" gets
        defined.
        (scm_array_prototype): Call scm_i_get_old_prototype only if
        SCM_ENABLE_DEPRECATED is set.

Index: libguile/backtrace.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/backtrace.c,v
retrieving revision 1.99
diff -u -r1.99 backtrace.c
--- libguile/backtrace.c	29 Sep 2004 17:40:11 -0000	1.99
+++ libguile/backtrace.c	2 Nov 2004 20:22:24 -0000
@@ -728,8 +728,7 @@
 }
 #undef FUNC_NAME
 
-SCM_DEFINE (scm_display_backtrace_with_highlights, "display-backtrace",
-	    2, 3, 0, 
+SCM_DEFINE (scm_display_backtrace_with_highlights, "display-backtrace", 2, 3, 0, 
 	    (SCM stack, SCM port, SCM first, SCM depth, SCM highlights),
 	    "Display a backtrace to the output port @var{port}. @var{stack}\n"
 	    "is the stack to take the backtrace from, @var{first} specifies\n"
Index: libguile/inline.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/inline.h,v
retrieving revision 1.20
diff -u -r1.20 inline.h
--- libguile/inline.h	7 Oct 2004 22:52:22 -0000	1.20
+++ libguile/inline.h	2 Nov 2004 20:00:08 -0000
@@ -63,12 +63,13 @@
 SCM
 scm_cell (scm_t_bits car, scm_t_bits cdr)
 {
+  SCM z, *freelist;
+
   if (scm_gc_running_p)
     {
       abort();
     }
   
-  SCM z;
   /* We retrieve the SCM pointer only once since the call to
      SCM_FREELIST_LOC will be slightly expensive when we support
      preemptive multithreading.  SCM_FREELIST_LOC will then retrieve
@@ -78,7 +79,7 @@
      following code will compile to the same as if we had worked
      directly on the scm_i_freelist variable.
    */
-  SCM *freelist = SCM_FREELIST_LOC (scm_i_freelist);
+  freelist = SCM_FREELIST_LOC (scm_i_freelist);
 
   if (scm_is_null (*freelist))
     z = scm_gc_for_newcell (&scm_i_master_freelist, freelist);
@@ -166,13 +167,14 @@
 scm_double_cell (scm_t_bits car, scm_t_bits cbr,
 		 scm_t_bits ccr, scm_t_bits cdr)
 {
+  SCM z, *freelist;
+
   if (scm_gc_running_p)
     {
       abort();
     }
 
-  SCM z;
-  SCM *freelist = SCM_FREELIST_LOC (scm_i_freelist2);
+  freelist = SCM_FREELIST_LOC (scm_i_freelist2);
 
   if (scm_is_null (*freelist))
     z = scm_gc_for_newcell (&scm_i_master_freelist2, freelist);
Index: libguile/pairs.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/pairs.h,v
retrieving revision 1.37
diff -u -r1.37 pairs.h
--- libguile/pairs.h	22 Sep 2004 17:37:01 -0000	1.37
+++ libguile/pairs.h	2 Nov 2004 20:23:56 -0000
@@ -119,7 +119,7 @@
 #define SCM_I_AAAD_PAT 0xfe /* 11111110 */
 #define SCM_I_AAAA_PAT 0xff /* 11111111 */
 
-SCM_API SCM scm_i_chase_pairs (SCM x, scm_t_uint32 pattern);
+SCM_API SCM scm_i_chase_pairs (SCM x, scm_t_bits pattern);
 
 #define scm_cddr(x)   scm_i_chase_pairs ((x), SCM_I_DD_PAT)
 #define scm_cdar(x)   scm_i_chase_pairs ((x), SCM_I_DA_PAT)
Index: libguile/sort.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/sort.c,v
retrieving revision 1.58
diff -u -r1.58 sort.c
--- libguile/sort.c	22 Oct 2004 13:17:04 -0000	1.58
+++ libguile/sort.c	2 Nov 2004 20:29:22 -0000
@@ -127,6 +127,7 @@
 	{
 	  size_t left;
 	  size_t right;
+	  size_t mid;
 	  SCM pivot;
 
 	  SCM_TICK;
@@ -136,7 +137,7 @@
 	     probability of picking a pathological pivot value and
 	     skips a comparison for both the left and right. */
 
-	  size_t mid = lo + (hi - lo) / 2;
+	  mid = lo + (hi - lo) / 2;
 
 	  if (scm_is_true ((*cmp) (less, base_ptr[mid], base_ptr[lo])))
 	    SWAP (base_ptr[mid], base_ptr[lo]);
Index: libguile/srfi-4.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/srfi-4.c,v
retrieving revision 1.6
diff -u -r1.6 srfi-4.c
--- libguile/srfi-4.c	2 Nov 2004 20:15:32 -0000	1.6
+++ libguile/srfi-4.c	2 Nov 2004 20:53:54 -0000
@@ -282,6 +282,7 @@
   else if (type == SCM_UVEC_C64)
     return scm_c_make_rectangular (((double*)base)[2*c_idx],
 				   ((double*)base)[2*c_idx+1]);
+  return SCM_BOOL_F;
 }
 
 static SCM_C_INLINE void
Index: libguile/threads.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/threads.c,v
retrieving revision 1.69
diff -u -r1.69 threads.c
--- libguile/threads.c	22 Oct 2004 15:13:12 -0000	1.69
+++ libguile/threads.c	2 Nov 2004 20:42:32 -0000
@@ -164,7 +164,7 @@
 {
   scm_thread *t = SCM_THREAD_DATA (exp);
   scm_puts ("#<thread ", port);
-  scm_uintprint (t->thread, 10, port);
+  scm_uintprint ((size_t)t->thread, 10, port);
   scm_puts (" (", port);
   scm_uintprint ((scm_t_bits)t, 16, port);
   scm_puts (")>", port);
Index: libguile/unif.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/unif.c,v
retrieving revision 1.166
diff -u -r1.166 unif.c
--- libguile/unif.c	2 Nov 2004 20:15:32 -0000	1.166
+++ libguile/unif.c	2 Nov 2004 20:53:32 -0000
@@ -2401,6 +2401,9 @@
 	proto = scm_c_make_rectangular (0.0, 1.0);
 	instead = "???";
 	break;
+      default:
+	instead = "???";
+	break;
       }
     if (!scm_is_eq (proto, SCM_EOL) && tag[1] == '\0')
       {
@@ -2659,10 +2662,14 @@
 	}
       else
 	{
+#if SCM_ENABLE_DEPRECATED
 	  SCM proto = scm_i_get_old_prototype (ra);
 	  if (scm_is_eq (SCM_UNSPECIFIED, proto))
 	    goto badarg;
 	  return proto;
+#else
+	  goto badarg;
+#endif
 	}
     case scm_tc7_vector:
     case scm_tc7_wvect:
_______________________________________________
Bug-guile mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-guile

Reply via email to