From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Robert Newsgroups: gmane.emacs.devel Subject: 64-bit compilation and printfs Date: Sun, 11 Oct 2009 20:46:27 -0400 Message-ID: <4CE21A3C-B51B-45ED-B51B-86072D403E25@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: multipart/mixed; boundary=Apple-Mail-13--24203425 X-Trace: ger.gmane.org 1255308411 30045 80.91.229.12 (12 Oct 2009 00:46:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2009 00:46:51 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 12 02:46:41 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mx93e-0001Lc-TE for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2009 02:46:40 +0200 Original-Received: from localhost ([127.0.0.1]:44849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mx93e-00087c-Fu for ged-emacs-devel@m.gmane.org; Sun, 11 Oct 2009 20:46:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mx93Z-00086x-So for emacs-devel@gnu.org; Sun, 11 Oct 2009 20:46:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mx93Z-00086O-GX for emacs-devel@gnu.org; Sun, 11 Oct 2009 20:46:33 -0400 Original-Received: from [199.232.76.173] (port=46089 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mx93Z-00086I-A7 for emacs-devel@gnu.org; Sun, 11 Oct 2009 20:46:33 -0400 Original-Received: from qw-out-1920.google.com ([74.125.92.148]:11427) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mx93Y-0001ci-TW for emacs-devel@gnu.org; Sun, 11 Oct 2009 20:46:33 -0400 Original-Received: by qw-out-1920.google.com with SMTP id 5so3635506qwc.24 for ; Sun, 11 Oct 2009 17:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type:subject :date:message-id:to:mime-version:x-mailer; bh=iJNostZPa8xi/pWayb/igmJBZaMSUk8hwC1QlBEd5mI=; b=CrGqVv3xjgIKQKhnCmoGUogAbuce5a2pwy+OLat7EY0jGlEwqUALF3GYi60Df8u+2s Q0a6fixYTLPF7wdZzIL/Pe5w05ZdiaSawCqIWbeFlAh5EgVcKr2NX5VSvzSn2V0ynW43 p0CSr3QviUpFFrmt0gM6Sm0IQxgxv3Nx19UEc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:subject:date:message-id:to:mime-version:x-mailer; b=PCOi2gO3X9lbDFF5Sk1X1AhMlfVhAIlXdT9rtdk1OIJAw5t/lyDSVPMywnla58vO3P U/CDRIRUF6NgY6V99HtGIwWYgTGPE2LVjKhGd4kOWxWr14vDxOL2gtIH9meXqMdKGChL Y4/JxlmaiDH61TuuPyBbL3Xppt5wb6q+c567g= Original-Received: by 10.224.32.194 with SMTP id e2mr4421112qad.33.1255308391714; Sun, 11 Oct 2009 17:46:31 -0700 (PDT) Original-Received: from ?192.168.2.13? (52.sub-75-193-108.myvzw.com [75.193.108.52]) by mx.google.com with ESMTPS id 8sm634qwj.46.2009.10.11.17.46.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Oct 2009 17:46:30 -0700 (PDT) X-Mailer: Apple Mail (2.1076) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116090 Archived-At: --Apple-Mail-13--24203425 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes In the course of getting the NS port compiling in 64-bit mode, some other developers and myself discovered some format - arg mismatches in printfs. XINT and XUINT return EMACS_INT which can be a long under LP64. I'd like to replace places that use %d in the code with %ld, and cast the argument to (long) to avoid issues in 32-bit mode. This has been checked in for the NS port; the patch attached here does this in common code. Does anyone think this should be done differently? Else I'll check it in as well. thanks, Adrian --Apple-Mail-13--24203425 Content-Disposition: attachment; filename=sn_64bit_common.patch Content-Type: application/octet-stream; name="sn_64bit_common.patch" Content-Transfer-Encoding: 7bit Index: dbusbind.c =================================================================== RCS file: /sources/emacs/emacs/src/dbusbind.c,v retrieving revision 1.47 diff -u -p -r1.47 dbusbind.c --- dbusbind.c 25 Aug 2009 10:31:22 -0000 1.47 +++ dbusbind.c 12 Oct 2009 00:40:28 -0000 @@ -1247,7 +1247,7 @@ usage: (dbus-method-return-internal BUS CHECK_STRING (service); GCPRO3 (bus, serial, service); - XD_DEBUG_MESSAGE ("%d %s ", XUINT (serial), SDATA (service)); + XD_DEBUG_MESSAGE ("%lu %s ", (unsigned long)XUINT (serial), SDATA (service)); /* Open a connection to the bus. */ connection = xd_initialize (bus); @@ -1341,7 +1341,7 @@ usage: (dbus-method-error-internal BUS S CHECK_STRING (service); GCPRO3 (bus, serial, service); - XD_DEBUG_MESSAGE ("%d %s ", XUINT (serial), SDATA (service)); + XD_DEBUG_MESSAGE ("%lu %s ", (unsigned long)XUINT (serial), SDATA (service)); /* Open a connection to the bus. */ connection = xd_initialize (bus); Index: font.c =================================================================== RCS file: /sources/emacs/emacs/src/font.c,v retrieving revision 1.138 diff -u -p -r1.138 font.c --- font.c 23 Sep 2009 02:35:54 -0000 1.138 +++ font.c 12 Oct 2009 00:40:33 -0000 @@ -1353,7 +1353,7 @@ font_unparse_xlfd (font, pixel_size, nam { f[XLFD_AVGWIDTH_INDEX] = alloca (11); len += sprintf (f[XLFD_AVGWIDTH_INDEX], - "%d", XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1; + "%ld", (long)XINT (AREF (font, FONT_AVGWIDTH_INDEX))) + 1; } else f[XLFD_AVGWIDTH_INDEX] = "*", len += 2; @@ -1669,7 +1669,7 @@ font_unparse_fcname (font, pixel_size, n } if (INTEGERP (AREF (font, FONT_DPI_INDEX))) - len += sprintf (work, ":dpi=%d", XINT (AREF (font, FONT_DPI_INDEX))); + len += sprintf (work, ":dpi=%ld", (long)XINT (AREF (font, FONT_DPI_INDEX))); if (INTEGERP (AREF (font, FONT_SPACING_INDEX))) len += strlen (":spacing=100"); if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) @@ -1682,7 +1682,7 @@ font_unparse_fcname (font, pixel_size, n if (STRINGP (val)) len += SBYTES (val); else if (INTEGERP (val)) - len += sprintf (work, "%d", XINT (val)); + len += sprintf (work, "%ld", (long)XINT (val)); else if (SYMBOLP (val)) len += (NILP (val) ? 5 : 4); /* for "false" or "true" */ } @@ -1709,9 +1709,10 @@ font_unparse_fcname (font, pixel_size, n p += sprintf (p, ":%s=%s", style_names[i], SDATA (SYMBOL_NAME (styles[i]))); if (INTEGERP (AREF (font, FONT_DPI_INDEX))) - p += sprintf (p, ":dpi=%d", XINT (AREF (font, FONT_DPI_INDEX))); + p += sprintf (p, ":dpi=%ld", (long)XINT (AREF (font, FONT_DPI_INDEX))); if (INTEGERP (AREF (font, FONT_SPACING_INDEX))) - p += sprintf (p, ":spacing=%d", XINT (AREF (font, FONT_SPACING_INDEX))); + p += sprintf (p, ":spacing=%ld", + (long)XINT (AREF (font, FONT_SPACING_INDEX))); if (INTEGERP (AREF (font, FONT_AVGWIDTH_INDEX))) { if (XINT (AREF (font, FONT_AVGWIDTH_INDEX)) == 0) Index: process.c =================================================================== RCS file: /sources/emacs/emacs/src/process.c,v retrieving revision 1.596 diff -u -p -r1.596 process.c --- process.c 30 Aug 2009 05:00:59 -0000 1.596 +++ process.c 12 Oct 2009 00:40:41 -0000 @@ -1522,7 +1522,7 @@ list_processes_1 (query_only) insert_string ("?"); if (INTEGERP (speed)) { - sprintf (tembuf, " at %d b/s", XINT (speed)); + sprintf (tembuf, " at %ld b/s", (long)XINT (speed)); insert_string (tembuf); } insert_string (")\n"); Index: xdisp.c =================================================================== RCS file: /sources/emacs/emacs/src/xdisp.c,v retrieving revision 1.1313 diff -u -p -r1.1313 xdisp.c --- xdisp.c 10 Oct 2009 16:39:05 -0000 1.1313 +++ xdisp.c 12 Oct 2009 00:41:06 -0000 @@ -14128,11 +14128,13 @@ try_window_reusing_current_matrix (w) return 0; /* Can't do this if region may have changed. */ + /* if ((!NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active)) || !NILP (w->region_showing) || !NILP (Vshow_trailing_whitespace)) return 0; + */ /* If top-line visibility has changed, give up. */ if (WINDOW_WANTS_HEADER_LINE_P (w) @@ -23605,6 +23607,9 @@ note_mouse_highlight (f, x, y) if (! EQ (window, dpyinfo->mouse_face_window) || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE && !NILP (dpyinfo->mouse_face_window))) +/* if ((! EQ (window, dpyinfo->mouse_face_window) + || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE)) + && !NILP (dpyinfo->mouse_face_window))*/ clear_mouse_face (dpyinfo); /* Not on a window -> return. */ --Apple-Mail-13--24203425 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed --Apple-Mail-13--24203425--