* Wrapped deprecated code between #if (SCM_DEBUG_DEPRECATED == 0) #endif.
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Mon, 15 May 2000 11:47:48 +0000 (11:47 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Mon, 15 May 2000 11:47:48 +0000 (11:47 +0000)
* Replace use of deprecated macros SCM_INPORTP, SCM_OUTPORTP, SCM_ICHRP.

21 files changed:
libguile/ChangeLog
libguile/async.c
libguile/chars.h
libguile/continuations.h
libguile/error.c
libguile/error.h
libguile/evalext.c
libguile/fports.c
libguile/ioext.c
libguile/ioext.h
libguile/keywords.c
libguile/ports.c
libguile/ports.h
libguile/print.c
libguile/ramap.c
libguile/smob.c
libguile/smob.h
libguile/tag.c
libguile/tag.h
libguile/tags.h
libguile/validate.h

index 20dfe4e..0f46c4c 100644 (file)
@@ -1,3 +1,22 @@
+2000-05-15  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * async.c (scm_sys_gc_async_thunk), chars.h (SCM_ICHRP, SCM_ICHR,
+       SCM_MAKICHR), continuations.h (SCM_SETJMPBUF), error.c
+       (scm_sysmissing), error.h (scm_sysmissing), evalext.c
+       ('serial-map), ioext.c (scm_fseek), ioext.h (scm_fseek),
+       keywords.c (scm_tc16_kw, scm_init_keywords), ports.h (SCM_CRDY,
+       SCM_INPORTP, SCM_OUTPORTP), ramap.c ('serial-array-copy!,
+       'serial-array-map!), smob.c (scm_newsmob), smob.h (scm_smobfuns,
+       scm_newsmob), tag.c (scm_tag), tag.h (scm_tag), tags.h
+       (scm_tc16_flo, scm_tc_flo, scm_tc_dblr, scm_tc_dblc):  Wrapped
+       deprecated code between #if (SCM_DEBUG_DEPRECATED == 0) #endif.
+
+       * fports.c (scm_fport_buffer_add), ports.c (scm_input_port_p,
+       scm_output_port_p), print.c (scm_get_print_state), validate.h
+       (SCM_VALIDATE_CHAR):  Replace use of deprecated macros
+       SCM_INPORTP, SCM_OUTPORTP, SCM_ICHRP by SCM_INPUT_PORT_P,
+       SCM_OUTPUT_PORT_P, SCM_CHARP, respectively.
+
 2000-05-14  Gary Houston  <ghouston@arglist.com>
 
        * stime.c (scm_strftime): if HAVE_TM_ZONE is not defined, hack the
index 1ec9e2c..d8b3a71 100644 (file)
@@ -455,6 +455,9 @@ static SCM
 scm_sys_gc_async_thunk (void)
 {
   scm_c_run_hook (scm_after_gc_hook, SCM_EOL);
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
   /* The following code will be removed in Guile 1.5.  */
   if (SCM_NFALSEP (scm_gc_vcell))
     {
@@ -463,6 +466,9 @@ scm_sys_gc_async_thunk (void)
       if (SCM_NFALSEP (proc) && !SCM_UNBNDP (proc))
        scm_apply (proc, SCM_EOL, SCM_EOL);
     }
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
   return SCM_UNSPECIFIED;
 }
 
index 45850fa..6b7a896 100644 (file)
 #define SCM_CHAR(x) ((unsigned int)SCM_ITAG8_DATA(x))
 #define SCM_MAKE_CHAR(x) SCM_MAKE_ITAG8(x, scm_tc8_char)
 
-#define SCM_ICHRP(x) SCM_CHARP(x) /* deprecated */
-#define SCM_ICHR(x) SCM_CHAR(x) /* deprecated */
-#define SCM_MAKICHR(x) SCM_MAKE_CHAR(x) /* deprecated */
-
 \f
 
 extern char *const scm_charnames[];
@@ -91,6 +87,16 @@ extern int scm_upcase (unsigned int c);
 extern int scm_downcase (unsigned int c);
 extern void scm_init_chars (void);
 
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+#define SCM_ICHRP(x) SCM_CHARP(x)
+#define SCM_ICHR(x) SCM_CHAR(x)
+#define SCM_MAKICHR(x) SCM_MAKE_CHAR(x)
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* SCM_CHARSH */
 
 /*
index 380121f..94628a6 100644 (file)
@@ -63,7 +63,6 @@ typedef struct
 
 #define SCM_CONTREGS(x)                ((scm_contregs *) SCM_CELL_WORD_1 (x))   
 #define SCM_SET_CONTREGS(x, r) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (r))) 
-#define SCM_SETJMPBUF(x, r)    (SCM_SET_CONTREGS ((x), (r))) /* deprecated */
 
 #define SCM_JMPBUF(x)          ((SCM_CONTREGS (x))->jmpbuf)
 #define SCM_DYNENV(x)          ((SCM_CONTREGS (x))->dynenv)
@@ -78,6 +77,14 @@ extern SCM scm_make_cont (SCM * answer);
 extern SCM scm_call_continuation (SCM cont, SCM val);
 extern void scm_init_continuations (void);
 
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+#define SCM_SETJMPBUF(x, r) (SCM_SET_CONTREGS ((x), (r)))
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* CONTINUATIONSH */
 
 /*
index c229139..5eab67a 100644 (file)
@@ -159,6 +159,9 @@ scm_syserror_msg (const char *subr, const char *message, SCM args, int eno)
             scm_cons (SCM_MAKINUM (eno), SCM_EOL));
 }
 
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 /* scm_sysmissing is no longer used in libguile.  it can probably be
    removed after a release or two.  there's a comment in NEWS about it
    (2000-01-09).  */
@@ -180,6 +183,9 @@ scm_sysmissing (const char *subr)
 #endif
 }
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
+
 SCM_SYMBOL (scm_num_overflow_key, "numerical-overflow");
 void
 scm_num_overflow (const char *subr)
index ac2a8d4..34a2abd 100644 (file)
@@ -67,9 +67,6 @@ extern SCM scm_strerror (SCM err);
 extern void scm_syserror (const char *subr) SCM_NORETURN;
 extern void scm_syserror_msg (const char *subr, const char *message,
                               SCM args, int eno) SCM_NORETURN;
-/* scm_sysmissing is no longer used in libguile.  it can probably be
-   removed after a release or two (2000-01-09).  */
-extern void scm_sysmissing (const char *subr) SCM_NORETURN;
 extern void scm_num_overflow (const char *subr) SCM_NORETURN;
 extern void scm_out_of_range (const char *subr, SCM bad_value)
      SCM_NORETURN;
@@ -86,6 +83,14 @@ extern void scm_misc_error (const char *subr, const char *message,
 extern SCM scm_wta (SCM arg, const char *pos, const char *s_subr);
 extern void scm_init_error (void);
 
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+extern void scm_sysmissing (const char *subr) SCM_NORETURN;
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* ERRORH */
 
 /*
index 4d6885b..ec18aa2 100644 (file)
@@ -149,9 +149,13 @@ scm_m_undefine (SCM x, SCM env)
 #endif
 }
 
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 /* This name is obsolete.  Will be removed in 1.5.  */
 SCM_REGISTER_PROC (s_serial_map, "serial-map", 2, 0, 1, scm_map);
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 SCM_REGISTER_PROC (s_map_in_order, "map-in-order", 2, 0, 1, scm_map);
 
 void 
index 19511fd..1ee2ce3 100644 (file)
@@ -97,7 +97,7 @@ scm_fport_buffer_add (SCM port, int read_size, int write_size)
        write_size = default_size;
     }
 
-  if (SCM_INPORTP (port) && read_size > 0)
+  if (SCM_INPUT_PORT_P (port) && read_size > 0)
     {
       pt->read_buf = malloc (read_size);
       if (pt->read_buf == NULL)
@@ -111,7 +111,7 @@ scm_fport_buffer_add (SCM port, int read_size, int write_size)
       pt->read_buf_size = 1;
     }
 
-  if (SCM_OUTPORTP (port) && write_size > 0)
+  if (SCM_OUTPUT_PORT_P (port) && write_size > 0)
     {
       pt->write_buf = malloc (write_size);
       if (pt->write_buf == NULL)
index 796ac09..07a9efb 100644 (file)
@@ -310,6 +310,9 @@ SCM_DEFINE (scm_ftell, "ftell", 1, 0, 0,
 }
 #undef FUNC_NAME
 
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 SCM_DEFINE (scm_fseek, "fseek", 3, 0, 0,
             (SCM object, SCM offset, SCM whence),
            "Obsolete.  Almost the same as seek, above, but the return value is\n"
@@ -321,6 +324,9 @@ SCM_DEFINE (scm_fseek, "fseek", 3, 0, 0,
 }
 #undef FUNC_NAME
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
+
 SCM_DEFINE (scm_redirect_port, "redirect-port", 2, 0, 0,
             (SCM old, SCM new),
            "This procedure takes two ports and duplicates the underlying file\n"
index 95b2d1e..8394941 100644 (file)
@@ -52,7 +52,6 @@ extern SCM scm_read_delimited_x (SCM delims, SCM buf, SCM gobble, SCM port, SCM
 extern SCM scm_read_line (SCM port);
 extern SCM scm_write_line (SCM obj, SCM port);
 extern SCM scm_ftell (SCM object);
-extern SCM scm_fseek (SCM object, SCM offset, SCM whence);
 extern SCM scm_redirect_port (SCM into_pt, SCM from_pt);
 extern SCM scm_dup_to_fdes (SCM fd_or_port, SCM newfd);
 extern SCM scm_fileno (SCM port);
@@ -62,6 +61,14 @@ extern SCM scm_primitive_move_to_fdes (SCM port, SCM fd);
 extern SCM scm_fdes_to_ports (SCM fd);
 extern void scm_init_ioext (void);
 
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+extern SCM scm_fseek (SCM object, SCM offset, SCM whence);
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* IOEXTH */
 
 /*
index c1ecada..b8959ea 100644 (file)
@@ -65,10 +65,15 @@ prin_keyword (SCM exp,SCM port,scm_print_state *pstate)
 
 int scm_tc16_keyword;
 
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 /* This global is only kept for backward compatibility.
    Will be removed in next release.  */
 int scm_tc16_kw;
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 
 SCM_DEFINE (scm_make_keyword_from_dash_symbol, "make-keyword-from-dash-symbol", 1, 0, 0, 
             (SCM symbol),
@@ -136,7 +141,13 @@ scm_init_keywords ()
 {
   scm_tc16_keyword = scm_make_smob_type_mfpe ("keyword", 0,
                                              scm_markcdr, NULL, prin_keyword, NULL);
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
   scm_tc16_kw = scm_tc16_keyword;
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
   scm_keyword_obarray = scm_make_vector (SCM_MAKINUM (256), SCM_EOL);
 #include "libguile/keywords.x"
 }
index 7f609cc..7c3f045 100644 (file)
@@ -714,7 +714,7 @@ SCM_DEFINE (scm_input_port_p, "input-port?", 1, 0, 0,
 {
   if (SCM_IMP (x))
     return SCM_BOOL_F;
-  return SCM_BOOL(SCM_INPORTP (x));
+  return SCM_BOOL(SCM_INPUT_PORT_P (x));
 }
 #undef FUNC_NAME
 
@@ -729,7 +729,7 @@ SCM_DEFINE (scm_output_port_p, "output-port?", 1, 0, 0,
     return SCM_BOOL_F;
   if (SCM_PORT_WITH_PS_P (x))
     x = SCM_PORT_WITH_PS_PORT (x);
-  return SCM_BOOL(SCM_OUTPORTP (x));
+  return SCM_BOOL(SCM_OUTPUT_PORT_P (x));
 }
 #undef FUNC_NAME
 
index e94b61c..77bed60 100644 (file)
@@ -149,7 +149,6 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table.  */
 #define SCM_RDNG       (2L<<16) /* Is it a readable port? */
 #define SCM_WRTNG      (4L<<16) /* Is it writable? */
 #define SCM_BUF0       (8L<<16) /* Is it unbuffered? */
-/* #define SCM_CRDY    (32L<<16)  obsolete, for pushed back characters  */
 #define SCM_BUFLINE     (64L<<16) /* Is it line-buffered? */
 
 #define SCM_PORTP(x) (SCM_NIMP(x) && (SCM_TYP7(x)==scm_tc7_port))
@@ -159,11 +158,9 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table.  */
 #define SCM_INPUT_PORT_P(x) \
   (SCM_NIMP(x) \
    && (((0x7f | SCM_RDNG) & SCM_UNPACK_CAR(x)) == (scm_tc7_port | SCM_RDNG)))
-#define SCM_INPORTP(x) SCM_INPUT_PORT_P (x) /* Deprecated */
 #define SCM_OUTPUT_PORT_P(x) \
   (SCM_NIMP(x) \
    && (((0x7f | SCM_WRTNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_WRTNG)))
-#define SCM_OUTPORTP(x) SCM_OUTPUT_PORT_P (x) /* Deprecated */
 #define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_UNPACK_CAR (x)))
 #define SCM_CLOSEDP(x) (!SCM_OPENP(x))
 
@@ -308,6 +305,16 @@ extern SCM scm_pt_size (void);
 extern SCM scm_pt_member (SCM member);
 #endif /* GUILE_DEBUG */
 
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+/* #define SCM_CRDY    (32L<<16)  obsolete, for pushed back characters  */
+#define SCM_INPORTP(x) SCM_INPUT_PORT_P (x)
+#define SCM_OUTPORTP(x) SCM_OUTPUT_PORT_P (x)
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* PORTSH */
 
 /*
index 5222da0..77782aa 100644 (file)
@@ -1090,7 +1090,7 @@ SCM_DEFINE (scm_get_print_state, "get-print-state", 1, 0, 0,
 {
   if (SCM_PORT_WITH_PS_P (port))
     return SCM_PORT_WITH_PS_PS (port);
-  if (SCM_OUTPORTP (port))
+  if (SCM_OUTPUT_PORT_P (port))
     return SCM_BOOL_F;
   RETURN_SCM_WTA (1,port);
 }
index 04c2ad8..500611b 100644 (file)
@@ -808,8 +808,14 @@ racp (SCM src, SCM dst)
 }
 
 
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 /* This name is obsolete.  Will go away in release 1.5.  */
 SCM_REGISTER_PROC(s_serial_array_copy_x, "serial-array-copy!", 2, 0, 0, scm_array_copy_x);
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
+
 SCM_REGISTER_PROC(s_array_copy_in_order_x, "array-copy-in-order!", 2, 0, 0, scm_array_copy_x);
 
 
@@ -1491,8 +1497,15 @@ ramap_a (SCM ra0,SCM proc,SCM ras)
   return 1;
 }
 
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 /* This name is obsolete.  Will go away in release 1.5.  */
 SCM_REGISTER_PROC(s_serial_array_map_x, "serial-array-map!", 2, 0, 1, scm_array_map_x);
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
+
 SCM_REGISTER_PROC(s_array_map_in_order_x, "array-map-in-order!", 2, 0, 1, scm_array_map_x);
 
 
index 2f65e8e..e07b24c 100644 (file)
@@ -203,8 +203,10 @@ scm_set_smob_mfpe (long tc,
   if (equalp) scm_set_smob_equalp (tc, equalp);
 }
 
-/* Deprecated function - use scm_make_smob_type, or scm_make_smob_type_mfpe
-   instead. */
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+/* Use scm_make_smob_type or scm_make_smob_type_mfpe instead. */
 long 
 scm_newsmob (const scm_smobfuns *smob)
 {
@@ -216,6 +218,8 @@ scm_newsmob (const scm_smobfuns *smob)
   return tc;
 }
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 
 SCM
 scm_make_smob (long tc)
index c92a466..0d8f077 100644 (file)
@@ -59,16 +59,6 @@ typedef struct scm_smob_descriptor
   SCM (*equalp) (SCM, SCM);
 } scm_smob_descriptor;
 
-/* scm_smobfuns is the argument type for the obsolete function scm_newsmob */
-
-typedef struct scm_smobfuns
-{
-  SCM (*mark) (SCM);
-  scm_sizet (*free) (SCM);
-  int (*print) (SCM exp, SCM port, scm_print_state *pstate);
-  SCM (*equalp) (SCM, SCM);
-} scm_smobfuns;
-
 \f
 
 #define SCM_NEWSMOB(z, tc, data) \
@@ -170,9 +160,22 @@ extern void scm_set_smob_mfpe (long tc,
 extern SCM scm_make_smob (long tc);
 extern void scm_smob_prehistory (void);
 
-/* Deprecated function */
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+typedef struct scm_smobfuns
+{
+  SCM (*mark) (SCM);
+  scm_sizet (*free) (SCM);
+  int (*print) (SCM exp, SCM port, scm_print_state *pstate);
+  SCM (*equalp) (SCM, SCM);
+} scm_smobfuns;
+
 extern long scm_newsmob (const scm_smobfuns *smob);
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* SMOBH */
 
 /*
index 9bff613..41ddb5b 100644 (file)
@@ -89,6 +89,8 @@ SCM_CONST_LONG (scm_utag_flag_base, "utag_flag_base", 254);
 SCM_CONST_LONG (scm_utag_struct_base, "utag_struct_base", 255);
 
 
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 SCM_DEFINE (scm_tag, "tag", 1, 0, 0, 
             (SCM x),
             "Return an integer corresponding to the type of X.  Deprecated.")
@@ -208,6 +210,7 @@ SCM_DEFINE (scm_tag, "tag", 1, 0, 0,
 }
 #undef FUNC_NAME
 
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
 
 \f
 
index 69afb35..be5e00f 100644 (file)
 
 \f
 
-
+extern void scm_init_tag (void);
 
 \f
 
+#if (SCM_DEBUG_DEPRECATED == 0)
+
 extern SCM scm_tag (SCM x);
-extern void scm_init_tag (void);
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
 
 #endif  /* TAGH */
 
index e443ef2..3e26bd8 100644 (file)
@@ -439,12 +439,6 @@ typedef long scm_bits_t;
 #define scm_tc16_real           0x027f
 #define scm_tc16_complex        0x037f
 
-/* The following four macros are now deprecated: */
-#define scm_tc16_flo           scm_tc16_real
-#define scm_tc_flo             0x017fL
-#define scm_tc_dblr            scm_tc16_real
-#define scm_tc_dblc            scm_tc16_complex
-
 /* Smob type 4 allocated, but not initialized cells;
    this is required to prevent the gc from hosing your cells if
    you have to allocate while creating the cell*/
@@ -589,6 +583,17 @@ extern char *scm_isymnames[];   /* defined in print.c */
 
 #define scm_tcs_symbols scm_tc7_ssymbol:case scm_tc7_msymbol
 
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+#define scm_tc16_flo           scm_tc16_real
+#define scm_tc_flo             0x017fL
+#define scm_tc_dblr            scm_tc16_real
+#define scm_tc_dblc            scm_tc16_complex
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* TAGSH */
 
 /*
index 53159c9..bcd7328 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: validate.h,v 1.9 2000-04-18 15:23:11 gjb Exp $ */
+/* $Id: validate.h,v 1.10 2000-05-15 11:47:48 dirk Exp $ */
 /*     Copyright (C) 1999, 2000 Free Software Foundation, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
     cvar = SCM_TRUE_P (flag) ? 1 : 0; \
   } while (0)
 
-#define SCM_VALIDATE_CHAR(pos, scm) SCM_MAKE_VALIDATE (pos, scm, ICHRP)
+#define SCM_VALIDATE_CHAR(pos, scm) SCM_MAKE_VALIDATE (pos, scm, CHARP)
 
 #define SCM_VALIDATE_CHAR_COPY(pos, scm, cvar) \
   do { \