diff options
| author | Daiki Ueno | 2014-07-16 14:44:05 +0900 |
|---|---|---|
| committer | Daiki Ueno | 2014-07-16 14:44:05 +0900 |
| commit | 74660d84d923fd8252b166770ca2403f6025a7ac (patch) | |
| tree | d137a32d62ad19c33bf4750ee6db32f4c3508a7f /src | |
| parent | 037a830b500e5640335b2a45ccd52510fc5dc88b (diff) | |
| download | emacs-74660d84d923fd8252b166770ca2403f6025a7ac.tar.gz emacs-74660d84d923fd8252b166770ca2403f6025a7ac.zip | |
Revert 2014-07-16T04:11:08Z!ueno@gnu.org and fix XCHAR2B_BYTE[12] in nsgui.h only
* nsgui.h (XCHAR2B_BYTE1): Add missing parentheses around
pointer argument, before dereferencing.
(XCHAR2B_BYTE2): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/dispextern.h | 18 | ||||
| -rw-r--r-- | src/nsgui.h | 9 | ||||
| -rw-r--r-- | src/w32gui.h | 10 | ||||
| -rw-r--r-- | src/xterm.h | 9 |
5 files changed, 33 insertions, 30 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2d81cf2f465..4fb688aed16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,15 +1,8 @@ | |||
| 1 | 2014-07-16 Daiki Ueno <ueno@gnu.org> | 1 | 2014-07-15 Daiki Ueno <ueno@gnu.org> |
| 2 | 2 | ||
| 3 | Consolidate XChar2b macros for the X, W32, and NS | 3 | * nsgui.h (XCHAR2B_BYTE1): Add missing parentheses around |
| 4 | Suggested by Jan Djärv in: | 4 | pointer argument, before dereferencing. |
| 5 | https://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00203.html | 5 | (XCHAR2B_BYTE2): Likewise. |
| 6 | * w32gui.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): Move the | ||
| 7 | fallback definitions to dispextern.h. | ||
| 8 | * nsgui.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): Likewise. | ||
| 9 | Share the same definition with W32. | ||
| 10 | * xterm.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): Move to ... | ||
| 11 | * dispextern.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): | ||
| 12 | ... here for the consistency with W32 and NS. | ||
| 13 | 6 | ||
| 14 | 2014-07-15 Dmitry Antipov <dmantipov@yandex.ru> | 7 | 2014-07-15 Dmitry Antipov <dmantipov@yandex.ru> |
| 15 | 8 | ||
diff --git a/src/dispextern.h b/src/dispextern.h index 6e8758218b4..0e04cc466d3 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -31,15 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 31 | #include <X11/Intrinsic.h> | 31 | #include <X11/Intrinsic.h> |
| 32 | #endif /* USE_X_TOOLKIT */ | 32 | #endif /* USE_X_TOOLKIT */ |
| 33 | 33 | ||
| 34 | #define STORE_XCHAR2B(chp, b1, b2) \ | ||
| 35 | ((chp)->byte1 = (b1), (chp)->byte2 = (b2)) | ||
| 36 | |||
| 37 | #define XCHAR2B_BYTE1(chp) \ | ||
| 38 | ((chp)->byte1) | ||
| 39 | |||
| 40 | #define XCHAR2B_BYTE2(chp) \ | ||
| 41 | ((chp)->byte2) | ||
| 42 | |||
| 43 | #else /* !HAVE_X_WINDOWS */ | 34 | #else /* !HAVE_X_WINDOWS */ |
| 44 | 35 | ||
| 45 | /* X-related stuff used by non-X gui code. */ | 36 | /* X-related stuff used by non-X gui code. */ |
| @@ -51,15 +42,6 @@ typedef struct { | |||
| 51 | char pad; | 42 | char pad; |
| 52 | } XColor; | 43 | } XColor; |
| 53 | 44 | ||
| 54 | #define STORE_XCHAR2B(chp, b1, b2) \ | ||
| 55 | (*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff)))) | ||
| 56 | |||
| 57 | #define XCHAR2B_BYTE1(chp) \ | ||
| 58 | ((*(chp) & 0xff00) >> 8) | ||
| 59 | |||
| 60 | #define XCHAR2B_BYTE2(chp) \ | ||
| 61 | (*(chp) & 0x00ff) | ||
| 62 | |||
| 63 | #endif /* HAVE_X_WINDOWS */ | 45 | #endif /* HAVE_X_WINDOWS */ |
| 64 | 46 | ||
| 65 | #ifdef MSDOS | 47 | #ifdef MSDOS |
diff --git a/src/nsgui.h b/src/nsgui.h index 055b7aeb708..0f963f69e2b 100644 --- a/src/nsgui.h +++ b/src/nsgui.h | |||
| @@ -64,6 +64,15 @@ typedef unsigned short unichar; | |||
| 64 | #endif | 64 | #endif |
| 65 | typedef unichar XChar2b; | 65 | typedef unichar XChar2b; |
| 66 | 66 | ||
| 67 | #define STORE_XCHAR2B(chp, b1, b2) \ | ||
| 68 | (*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff)))) | ||
| 69 | |||
| 70 | #define XCHAR2B_BYTE1(chp) \ | ||
| 71 | ((*(chp) & 0xff00) >> 8) | ||
| 72 | |||
| 73 | #define XCHAR2B_BYTE2(chp) \ | ||
| 74 | (*(chp) & 0x00ff) | ||
| 75 | |||
| 67 | 76 | ||
| 68 | /* XXX: xfaces requires these structures, but the question is are we | 77 | /* XXX: xfaces requires these structures, but the question is are we |
| 69 | forced to use them? */ | 78 | forced to use them? */ |
diff --git a/src/w32gui.h b/src/w32gui.h index 40a8a00346d..d04ce625d1d 100644 --- a/src/w32gui.h +++ b/src/w32gui.h | |||
| @@ -54,6 +54,16 @@ typedef HCURSOR Cursor; | |||
| 54 | 54 | ||
| 55 | #define XChar2b wchar_t | 55 | #define XChar2b wchar_t |
| 56 | 56 | ||
| 57 | /* Dealing with bits of wchar_t as if they were an XChar2b. */ | ||
| 58 | #define STORE_XCHAR2B(chp, byte1, byte2) \ | ||
| 59 | ((*(chp)) = ((XChar2b)((((byte1) & 0x00ff) << 8) | ((byte2) & 0x00ff)))) | ||
| 60 | |||
| 61 | #define XCHAR2B_BYTE1(chp) \ | ||
| 62 | (((*(chp)) & 0xff00) >> 8) | ||
| 63 | |||
| 64 | #define XCHAR2B_BYTE2(chp) \ | ||
| 65 | ((*(chp)) & 0x00ff) | ||
| 66 | |||
| 57 | 67 | ||
| 58 | /* Windows equivalent of XImage. */ | 68 | /* Windows equivalent of XImage. */ |
| 59 | typedef struct _XImage | 69 | typedef struct _XImage |
diff --git a/src/xterm.h b/src/xterm.h index 370006366ef..6d80d1253ae 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -1047,6 +1047,15 @@ extern void x_clear_under_internal_border (struct frame *f); | |||
| 1047 | 1047 | ||
| 1048 | #define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0) | 1048 | #define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0) |
| 1049 | 1049 | ||
| 1050 | #define STORE_XCHAR2B(chp, b1, b2) \ | ||
| 1051 | ((chp)->byte1 = (b1), (chp)->byte2 = (b2)) | ||
| 1052 | |||
| 1053 | #define XCHAR2B_BYTE1(chp) \ | ||
| 1054 | ((chp)->byte1) | ||
| 1055 | |||
| 1056 | #define XCHAR2B_BYTE2(chp) \ | ||
| 1057 | ((chp)->byte2) | ||
| 1058 | |||
| 1050 | #define STORE_NATIVE_RECT(nr,rx,ry,rwidth,rheight) \ | 1059 | #define STORE_NATIVE_RECT(nr,rx,ry,rwidth,rheight) \ |
| 1051 | ((nr).x = (rx), \ | 1060 | ((nr).x = (rx), \ |
| 1052 | (nr).y = (ry), \ | 1061 | (nr).y = (ry), \ |