unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daiki Ueno <ueno@gnu.org>
To: emacs-devel@gnu.org
Subject: XCHAR2B_BYTE[12] definitions in NS
Date: Tue, 15 Jul 2014 18:02:50 +0900	[thread overview]
Message-ID: <m38unv805h.fsf-ueno@gnu.org> (raw)

[-- 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

             reply	other threads:[~2014-07-15  9:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15  9:02 Daiki Ueno [this message]
2014-07-15 13:20 ` XCHAR2B_BYTE[12] definitions in NS Jan Djärv
2014-07-16  4:14   ` Daiki Ueno
2014-07-16  5:46     ` Daiki Ueno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m38unv805h.fsf-ueno@gnu.org \
    --to=ueno@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).