summaryrefslogtreecommitdiff
path: root/libguile/print.h
diff options
context:
space:
mode:
authorGreg J. Badros <gjb@cs.washington.edu>1999-12-16 03:46:42 +0000
committerGreg J. Badros <gjb@cs.washington.edu>1999-12-16 03:46:42 +0000
commitd3a6bc94840464e1af8109de5dddd5859560c679 (patch)
tree87475ee6d125df4493b89e5e6a9a13933c8ab356 /libguile/print.h
parentf353a9e2323b3957cd8475bcf10f7b489a8ce000 (diff)
downloadguile-d3a6bc94840464e1af8109de5dddd5859560c679.tar.gz
* *.h: Use SCM_NIMP(X) && in all the FOOP macros.
* *.[ch]: Use do { ... } while (0) idiom in macros that expanded to a bare block.
Diffstat (limited to 'libguile/print.h')
-rw-r--r--libguile/print.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/libguile/print.h b/libguile/print.h
index 2701153be..38ba1ac75 100644
--- a/libguile/print.h
+++ b/libguile/print.h
@@ -42,6 +42,9 @@
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice. */
+
+/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
+ gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
#include "libguile/__scm.h"
@@ -62,15 +65,15 @@ extern scm_option scm_print_opts[];
#define SCM_PRINT_STATE(obj) ((scm_print_state *) SCM_STRUCT_DATA (obj))
#define RESET_PRINT_STATE(pstate) \
-{ \
+do { \
pstate->list_offset = 0; \
pstate->top = 0; \
-}
+} while (0)
#define SCM_WRITINGP(pstate) ((pstate)->writingp)
#define SCM_SET_WRITINGP(pstate, x) { (pstate)->writingp = (x); }
-#define SCM_PORT_WITH_PS_P(p) (SCM_TYP16 (p) == scm_tc16_port_with_ps)
+#define SCM_PORT_WITH_PS_P(p) (SCM_NIMP(p) && (SCM_TYP16 (p) == scm_tc16_port_with_ps))
#define SCM_PORT_WITH_PS_PORT(p) SCM_CADR (p)
#define SCM_PORT_WITH_PS_PS(p) SCM_CDDR (p)