>>>> "Andy" == Andy Piper
<andyp(a)parallax.co.uk> writes:
Andy> At 14:46 06/12/98 -0800, Martin Buchholz wrote:
Andy> I had to make these fixes as well.
I respectfully veto the console-msw.c part of this patch, and propose
instead this pedantically more correct, completely untested, patch:
1998-12-07 Martin Buchholz <martin(a)xemacs.org>
* console-msw.c (DHEADER):
(DOPAQUE_DATA):
(DEVENT):
(DCONS):
(DCONSCDR):
(DSTRING):
(DVECTOR):
(DSYMBOL):
(DSYMNAME):
- max_align_t should not be visible to the user of the
XOPAQUE_DATA macro.
- use Bufbyte instead of char
- parens around (FOOP (obj)) are always redundant.
If they were necessary, we should fix the macro instead.
- Always use string_data(foo) instead of foo->data.
--- src/opaque.h.old
+++ src/opaque.h
@@ -80,7 +80,7 @@
void free_opaque_ptr (Lisp_Object ptr);
#define OPAQUE_SIZE(op) XINT ((op)->size_or_chain)
-#define OPAQUE_DATA(op) ((op)->data)
+#define OPAQUE_DATA(op) ((void *) ((op)->data))
#define OPAQUE_MARKFUN(op) ((op)->markfun)
#define XOPAQUE_SIZE(op) OPAQUE_SIZE (XOPAQUE (op))
#define XOPAQUE_DATA(op) OPAQUE_DATA (XOPAQUE (op))
--- src/console-msw.c.old
+++ src/console-msw.c
@@ -84,49 +84,49 @@
* Intended for use in the MSVC "Watch" window which doesn't like
* the aborts that the error_check_foo() functions can make.
*/
-struct lrecord_header *DHEADER(Lisp_Object obj)
+struct lrecord_header *DHEADER (Lisp_Object obj)
{
- return (LRECORDP (obj)) ? XRECORD_LHEADER (obj) : NULL;
+ return LRECORDP (obj) ? XRECORD_LHEADER (obj) : NULL;
}
-int *DOPAQUE_DATA (Lisp_Object obj)
+void *DOPAQUE_DATA (Lisp_Object obj)
{
- return (OPAQUEP (obj)) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL;
+ return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL;
}
-struct Lisp_Event *DEVENT(Lisp_Object obj)
+struct Lisp_Event *DEVENT (Lisp_Object obj)
{
- return (EVENTP (obj)) ? XEVENT (obj) : NULL;
+ return EVENTP (obj) ? XEVENT (obj) : NULL;
}
-struct Lisp_Cons *DCONS(Lisp_Object obj)
+struct Lisp_Cons *DCONS (Lisp_Object obj)
{
- return (CONSP (obj)) ? XCONS (obj) : NULL;
+ return CONSP (obj) ? XCONS (obj) : NULL;
}
-struct Lisp_Cons *DCONSCDR(Lisp_Object obj)
+struct Lisp_Cons *DCONSCDR (Lisp_Object obj)
{
- return ((CONSP (obj)) && (CONSP (XCDR (obj)))) ? XCONS (XCDR (obj)) : 0;
+ return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0;
}
-char *DSTRING(Lisp_Object obj)
+Bufbyte *DSTRING (Lisp_Object obj)
{
- return (STRINGP (obj)) ? XSTRING_DATA (obj) : NULL;
+ return STRINGP (obj) ? XSTRING_DATA (obj) : NULL;
}
-struct Lisp_Vector *DVECTOR(Lisp_Object obj)
+struct Lisp_Vector *DVECTOR (Lisp_Object obj)
{
- return (VECTORP (obj)) ? XVECTOR (obj) : NULL;
+ return VECTORP (obj) ? XVECTOR (obj) : NULL;
}
-struct Lisp_Symbol *DSYMBOL(Lisp_Object obj)
+struct Lisp_Symbol *DSYMBOL (Lisp_Object obj)
{
- return (SYMBOLP (obj)) ? XSYMBOL (obj) : NULL;
+ return SYMBOLP (obj) ? XSYMBOL (obj) : NULL;
}
-char *DSYMNAME(Lisp_Object obj)
+Bufbyte *DSYMNAME (Lisp_Object obj)
{
- return (SYMBOLP (obj)) ? XSYMBOL (obj)->name->_data : NULL;
+ return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL;
}
#endif