unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* XCHAR2B_BYTE[12] definitions in NS
@ 2014-07-15  9:02 Daiki Ueno
  2014-07-15 13:20 ` Jan Djärv
  0 siblings, 1 reply; 4+ messages in thread
From: Daiki Ueno @ 2014-07-15  9:02 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

Hi,

While I'm doing some experiment based on the NS port, I sometimes get
unexpected glyph index, because of missing parentheses in
XCHAR2B_BYTE[12] definitions (patch attached).  I believe those macros
are not actually used by the NS port, but maybe good to fix it to avoid
any confusion.  OK to commit, or perhaps they should be completely
removed?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nsgui.h.patch --]
[-- Type: text/x-patch, Size: 862 bytes --]

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2014-07-14 19:23:18 +0000
+++ src/ChangeLog	2014-07-15 08:48:30 +0000
@@ -1,3 +1,9 @@
+2014-07-15  Daiki Ueno  <ueno@gnu.org>
+
+	* nsgui.h (XCHAR2B_BYTE1): Add missing parentheses around
+	pointer argument, before dereferencing.
+	(XCHAR2B_BYTE2): Likewise.
+
 2014-07-14  Paul Eggert  <eggert@cs.ucla.edu>
 
 	Use binary-io module, O_BINARY, and "b" flag (Bug#18006).

=== modified file 'src/nsgui.h'
--- src/nsgui.h	2014-06-02 18:01:21 +0000
+++ src/nsgui.h	2014-07-15 06:40:08 +0000
@@ -68,10 +68,10 @@
   (*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff))))
 
 #define XCHAR2B_BYTE1(chp) \
- (((*chp) & 0xff00) >> 8)
+  ((*(chp) & 0xff00) >> 8)
 
 #define XCHAR2B_BYTE2(chp) \
- ((*chp) & 0x00ff)
+  (*(chp) & 0x00ff)
 
 
 /* XXX: xfaces requires these structures, but the question is are we


[-- Attachment #3: Type: text/plain, Size: 24 bytes --]


Regards,
--
Daiki Ueno

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-16  5:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-15  9:02 XCHAR2B_BYTE[12] definitions in NS Daiki Ueno
2014-07-15 13:20 ` Jan Djärv
2014-07-16  4:14   ` Daiki Ueno
2014-07-16  5:46     ` Daiki Ueno

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).