diff src/lisp-union.h @ 5027:22179cd0fe15

merge
author Ben Wing <ben@xemacs.org>
date Wed, 10 Feb 2010 07:25:19 -0600
parents ae48681c47fa
children 308d34e9f07d
line wrap: on
line diff
--- a/src/lisp-union.h	Wed Feb 10 07:15:36 2010 -0600
+++ b/src/lisp-union.h	Wed Feb 10 07:25:19 2010 -0600
@@ -1,7 +1,7 @@
 /* Fundamental definitions for XEmacs Lisp interpreter -- union objects.
    Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994
    Free Software Foundation, Inc.
-   Copyright (C) 2002, 2005 Ben Wing.
+   Copyright (C) 2002, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -142,16 +142,19 @@
 
 /* WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-   You can only VOID_TO_LISP something that had previously been
-   LISP_TO_VOID'd.  You cannot go the other way, i.e. create a bogus
-   Lisp_Object.  If you want to stuff a void * into a Lisp_Object, use
-   make_opaque_ptr(). */
+   You can only GET_LISP_FROM_VOID something that had previously been
+   STORE_LISP_IN_VOID'd.  If you want to go the other way, use
+   STORE_VOID_IN_LISP and GET_VOID_FROM_LISP, or use make_opaque_ptr(). */
 
-/* Convert between a (void *) and a Lisp_Object, as when the
-   Lisp_Object is passed to a toolkit callback function */
+/* Convert a Lisp object to a void * pointer, as when it needs to be passed
+   to a toolkit callback function */
+#define STORE_LISP_IN_VOID(larg) ((void *) ((larg).v))
+
+/* Convert a void * pointer back into a Lisp object, assuming that the
+   pointer was generated by STORE_LISP_IN_VOID. */
 DECLARE_INLINE_HEADER (
 Lisp_Object
-VOID_TO_LISP (const void *arg)
+GET_LISP_FROM_VOID (const void *arg)
 )
 {
   Lisp_Object larg;
@@ -159,8 +162,6 @@
   return larg;
 }
 
-#define LISP_TO_VOID(larg) ((void *) ((larg).v))
-
 /* Convert a Lisp_Object into something that can't be used as an
    lvalue.  Useful for type-checking. */
 #if (__GNUC__ > 1)