SCM_NIMP test integrated into an || clause that I'd missed before
and was causing a segfault in the regression tests.
* symbols.h (SCM_ROUCHARS): Make cast be to (unsigned char *), not
(char *); fixes a problem reported by the regression test
ports.test.
* ports.c: Fixed a couple of arg/number mismatches in
SCM_VALIDATE_ macros.
Now passes the (not-comprehensive) guile-modules test-suite again!
if (SCM_UNBNDP (port))
port = scm_cur_inp;
else
- SCM_VALIDATE_OPINPORT(1,port);
+ SCM_VALIDATE_OPINPORT(2,port);
c = SCM_ICHR (cobj);
if (SCM_UNBNDP (port))
port = scm_cur_inp;
else
- SCM_VALIDATE_OPINPORT(1,port);
+ SCM_VALIDATE_OPINPORT(2,port);
scm_ungets (SCM_ROUCHARS (str), SCM_LENGTH (str), port);
#define SCM_ROCHARS(x) ((char *)((SCM_TYP7(x) == scm_tc7_substring) \
? SCM_INUM (SCM_CADR (x)) + SCM_CHARS (SCM_CDDR (x)) \
: SCM_CHARS (x)))
-#define SCM_ROUCHARS(x) ((char *) ((SCM_TYP7(x) == scm_tc7_substring) \
+#define SCM_ROUCHARS(x) ((unsigned char *) ((SCM_TYP7(x) == scm_tc7_substring) \
? SCM_INUM (SCM_CADR (x)) + SCM_UCHARS (SCM_CDDR (x))\
: SCM_UCHARS (x)))
#define SCM_ROLENGTH(x) SCM_LENGTH (x)
* can be expected to occur.
*/
#define SCM_ECONSP(x) (SCM_CONSP (x) \
- || (SCM_TYP3(x) == 1 \
- && SCM_CDR (SCM_CAR (x) - 1) != 0))
+ || SCM_NIMP(x) && ((SCM_TYP3(x) == 1 \
+ && SCM_CDR (SCM_CAR (x) - 1) != 0)))
#define SCM_NECONSP(x) (SCM_NCONSP(x) \
&& (SCM_TYP3(x) != 1 \
- || SCM_CDR (SCM_CAR (x) - 1) == 0))
+ || (SCM_NIMP(x) && SCM_CDR (SCM_CAR (x) - 1) == 0)))
\f