diff options
| author | Stefan Monnier | 2013-03-28 12:21:38 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-03-28 12:21:38 -0400 |
| commit | 717b8bcd964f55cb509711149ad112deca36c2a7 (patch) | |
| tree | 1e5dc390c11fc5b031f624bfd1c9ca6fb7c7c464 /src | |
| parent | e74aeda863cd6896e06e92586f87b45d63d67d15 (diff) | |
| download | emacs-717b8bcd964f55cb509711149ad112deca36c2a7.tar.gz emacs-717b8bcd964f55cb509711149ad112deca36c2a7.zip | |
* src/lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
(set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
forward references.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/lisp.h | 113 |
2 files changed, 60 insertions, 59 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 77338e6c46f..59cf008b72f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER) | ||
| 4 | (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid | ||
| 5 | forward references. | ||
| 6 | |||
| 1 | 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru> | 7 | 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 8 | ||
| 3 | * window.h (struct window): Replace hchild, vchild and buffer slots | 9 | * window.h (struct window): Replace hchild, vchild and buffer slots |
diff --git a/src/lisp.h b/src/lisp.h index 897addc90c1..4481a2e3373 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -552,11 +552,6 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper) | |||
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | 554 | ||
| 555 | /* Forward declarations. */ | ||
| 556 | |||
| 557 | LISP_INLINE bool SAVE_VALUEP (Lisp_Object); | ||
| 558 | LISP_INLINE struct Lisp_Save_Value *XSAVE_VALUE (Lisp_Object); | ||
| 559 | |||
| 560 | /* Extract a value or address from a Lisp_Object. */ | 555 | /* Extract a value or address from a Lisp_Object. */ |
| 561 | 556 | ||
| 562 | #define XCONS(a) (eassert (CONSP (a)), \ | 557 | #define XCONS(a) (eassert (CONSP (a)), \ |
| @@ -1487,53 +1482,6 @@ struct Lisp_Save_Value | |||
| 1487 | } data[SAVE_VALUE_SLOTS]; | 1482 | } data[SAVE_VALUE_SLOTS]; |
| 1488 | }; | 1483 | }; |
| 1489 | 1484 | ||
| 1490 | /* Return the type of V's Nth saved value. */ | ||
| 1491 | LISP_INLINE int | ||
| 1492 | save_type (struct Lisp_Save_Value *v, int n) | ||
| 1493 | { | ||
| 1494 | eassert (0 <= n && n < SAVE_VALUE_SLOTS); | ||
| 1495 | return (v->save_type >> (SAVE_SLOT_BITS * n) & ((1 << SAVE_SLOT_BITS) - 1)); | ||
| 1496 | } | ||
| 1497 | |||
| 1498 | /* Get and set the Nth saved pointer. */ | ||
| 1499 | |||
| 1500 | LISP_INLINE void * | ||
| 1501 | XSAVE_POINTER (Lisp_Object obj, int n) | ||
| 1502 | { | ||
| 1503 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER); | ||
| 1504 | return XSAVE_VALUE (obj)->data[n].pointer;; | ||
| 1505 | } | ||
| 1506 | LISP_INLINE void | ||
| 1507 | set_save_pointer (Lisp_Object obj, int n, void *val) | ||
| 1508 | { | ||
| 1509 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER); | ||
| 1510 | XSAVE_VALUE (obj)->data[n].pointer = val; | ||
| 1511 | } | ||
| 1512 | |||
| 1513 | /* Likewise for the saved integer. */ | ||
| 1514 | |||
| 1515 | LISP_INLINE ptrdiff_t | ||
| 1516 | XSAVE_INTEGER (Lisp_Object obj, int n) | ||
| 1517 | { | ||
| 1518 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER); | ||
| 1519 | return XSAVE_VALUE (obj)->data[n].integer; | ||
| 1520 | } | ||
| 1521 | LISP_INLINE void | ||
| 1522 | set_save_integer (Lisp_Object obj, int n, ptrdiff_t val) | ||
| 1523 | { | ||
| 1524 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER); | ||
| 1525 | XSAVE_VALUE (obj)->data[n].integer = val; | ||
| 1526 | } | ||
| 1527 | |||
| 1528 | /* Extract Nth saved object. */ | ||
| 1529 | |||
| 1530 | LISP_INLINE Lisp_Object | ||
| 1531 | XSAVE_OBJECT (Lisp_Object obj, int n) | ||
| 1532 | { | ||
| 1533 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_OBJECT); | ||
| 1534 | return XSAVE_VALUE (obj)->data[n].object; | ||
| 1535 | } | ||
| 1536 | |||
| 1537 | /* A miscellaneous object, when it's on the free list. */ | 1485 | /* A miscellaneous object, when it's on the free list. */ |
| 1538 | struct Lisp_Free | 1486 | struct Lisp_Free |
| 1539 | { | 1487 | { |
| @@ -1555,13 +1503,6 @@ union Lisp_Misc | |||
| 1555 | struct Lisp_Save_Value u_save_value; | 1503 | struct Lisp_Save_Value u_save_value; |
| 1556 | }; | 1504 | }; |
| 1557 | 1505 | ||
| 1558 | LISP_INLINE struct Lisp_Save_Value * | ||
| 1559 | XSAVE_VALUE (Lisp_Object a) | ||
| 1560 | { | ||
| 1561 | eassert (SAVE_VALUEP (a)); | ||
| 1562 | return & XMISC (a)->u_save_value; | ||
| 1563 | } | ||
| 1564 | |||
| 1565 | /* Forwarding pointer to an int variable. | 1506 | /* Forwarding pointer to an int variable. |
| 1566 | This is allowed only in the value cell of a symbol, | 1507 | This is allowed only in the value cell of a symbol, |
| 1567 | and it means that the symbol's value really lives in the | 1508 | and it means that the symbol's value really lives in the |
| @@ -1854,6 +1795,60 @@ SAVE_VALUEP (Lisp_Object x) | |||
| 1854 | return MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value; | 1795 | return MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value; |
| 1855 | } | 1796 | } |
| 1856 | 1797 | ||
| 1798 | LISP_INLINE struct Lisp_Save_Value * | ||
| 1799 | XSAVE_VALUE (Lisp_Object a) | ||
| 1800 | { | ||
| 1801 | eassert (SAVE_VALUEP (a)); | ||
| 1802 | return & XMISC (a)->u_save_value; | ||
| 1803 | } | ||
| 1804 | |||
| 1805 | /* Return the type of V's Nth saved value. */ | ||
| 1806 | LISP_INLINE int | ||
| 1807 | save_type (struct Lisp_Save_Value *v, int n) | ||
| 1808 | { | ||
| 1809 | eassert (0 <= n && n < SAVE_VALUE_SLOTS); | ||
| 1810 | return (v->save_type >> (SAVE_SLOT_BITS * n) & ((1 << SAVE_SLOT_BITS) - 1)); | ||
| 1811 | } | ||
| 1812 | |||
| 1813 | /* Get and set the Nth saved pointer. */ | ||
| 1814 | |||
| 1815 | LISP_INLINE void * | ||
| 1816 | XSAVE_POINTER (Lisp_Object obj, int n) | ||
| 1817 | { | ||
| 1818 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER); | ||
| 1819 | return XSAVE_VALUE (obj)->data[n].pointer;; | ||
| 1820 | } | ||
| 1821 | LISP_INLINE void | ||
| 1822 | set_save_pointer (Lisp_Object obj, int n, void *val) | ||
| 1823 | { | ||
| 1824 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER); | ||
| 1825 | XSAVE_VALUE (obj)->data[n].pointer = val; | ||
| 1826 | } | ||
| 1827 | |||
| 1828 | /* Likewise for the saved integer. */ | ||
| 1829 | |||
| 1830 | LISP_INLINE ptrdiff_t | ||
| 1831 | XSAVE_INTEGER (Lisp_Object obj, int n) | ||
| 1832 | { | ||
| 1833 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER); | ||
| 1834 | return XSAVE_VALUE (obj)->data[n].integer; | ||
| 1835 | } | ||
| 1836 | LISP_INLINE void | ||
| 1837 | set_save_integer (Lisp_Object obj, int n, ptrdiff_t val) | ||
| 1838 | { | ||
| 1839 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER); | ||
| 1840 | XSAVE_VALUE (obj)->data[n].integer = val; | ||
| 1841 | } | ||
| 1842 | |||
| 1843 | /* Extract Nth saved object. */ | ||
| 1844 | |||
| 1845 | LISP_INLINE Lisp_Object | ||
| 1846 | XSAVE_OBJECT (Lisp_Object obj, int n) | ||
| 1847 | { | ||
| 1848 | eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_OBJECT); | ||
| 1849 | return XSAVE_VALUE (obj)->data[n].object; | ||
| 1850 | } | ||
| 1851 | |||
| 1857 | #define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x))) | 1852 | #define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x))) |
| 1858 | 1853 | ||
| 1859 | #define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int) | 1854 | #define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int) |