From: Alexander Kuleshov <kuleshovmail@gmail.com>
To: 27597@debbugs.gnu.org
Subject: bug#27597: [PATCH] fix warnings in src/xdisp.c
Date: Thu, 6 Jul 2017 17:47:03 +0600 [thread overview]
Message-ID: <CANCZXo4MeqZ+MdxUUAK85md_7r_3KwEF_ZAsSXqS8cZ5m3+uNw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 355 bytes --]
Hello,
here is simple fix for following warnings:
xdisp.c: In function ‘Fdump_glyph_matrix’:
xdisp.c:19320:20: error: format ‘%lld’ expects argument of type ‘long
long int’, but argument 3 has type ‘ptrdiff_t {aka long int}’
[-Werror=format=]
fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n",
from src/xdisp.c
[-- Attachment #2: 0001-use-pD-directives-for-ptrdiff_t-values-to-get-rid-fr.patch --]
[-- Type: text/x-patch, Size: 3662 bytes --]
From 82beb984aa4d5009d0535d41f2de41bf2992deb9 Mon Sep 17 00:00:00 2001
From: Alexander Kuleshov <kuleshovmail@gmail.com>
Date: Thu, 6 Jul 2017 17:39:51 +0600
Subject: [PATCH] use pD directives for ptrdiff_t values to get rid from
warnings
* src/xdisp.c: use pD directives for ptrdiff_t values instead of
pI
---
src/xdisp.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index 8bc5d81..95d3784 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19083,7 +19083,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
|| glyph->type == GLYPHLESS_GLYPH)
{
fprintf (stderr,
- " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
+ " %5"pD"d %c %9"pD"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
glyph - row->glyphs[TEXT_AREA],
(glyph->type == CHAR_GLYPH
? 'C'
@@ -19108,7 +19108,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
else if (glyph->type == STRETCH_GLYPH)
{
fprintf (stderr,
- " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
+ " %5"pD"d %c %9"pD"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
glyph - row->glyphs[TEXT_AREA],
'S',
glyph->charpos,
@@ -19129,7 +19129,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
else if (glyph->type == IMAGE_GLYPH)
{
fprintf (stderr,
- " %5"pD"d %c %9"pI"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
+ " %5"pD"d %c %9"pD"d %c %3d 0x%06x %c %4d %1.1d%1.1d\n",
glyph - row->glyphs[TEXT_AREA],
'I',
glyph->charpos,
@@ -19150,7 +19150,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
else if (glyph->type == COMPOSITE_GLYPH)
{
fprintf (stderr,
- " %5"pD"d %c %9"pI"d %c %3d 0x%06x",
+ " %5"pD"d %c %9"pD"d %c %3d 0x%06x",
glyph - row->glyphs[TEXT_AREA],
'+',
glyph->charpos,
@@ -19211,7 +19211,7 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs)
fprintf (stderr, "Row Start End Used oE><\\CTZFesm X Y W H V A P\n");
fprintf (stderr, "==============================================================================\n");
- fprintf (stderr, "%3d %9"pI"d %9"pI"d %4d %1.1d%1.1d%1.1d%1.1d\
+ fprintf (stderr, "%3d %9"pD"d %9"pD"d %4d %1.1d%1.1d%1.1d%1.1d\
%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n",
vpos,
MATRIX_ROW_START_CHARPOS (row),
@@ -19240,7 +19240,7 @@ dump_glyph_row (struct glyph_row *row, int vpos, int glyphs)
fprintf (stderr, " %9"pD"d %9"pD"d\t%5d\n", row->start.overlay_string_index,
row->end.overlay_string_index,
row->continuation_lines_width);
- fprintf (stderr, " %9"pI"d %9"pI"d\n",
+ fprintf (stderr, " %9"pD"d %9"pD"d\n",
CHARPOS (row->start.string_pos),
CHARPOS (row->end.string_pos));
fprintf (stderr, " %9d %9d\n", row->start.dpvec_index,
@@ -19317,7 +19317,7 @@ with numeric argument, its value is passed as the GLYPHS flag. */)
struct window *w = XWINDOW (selected_window);
struct buffer *buffer = XBUFFER (w->contents);
- fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n",
+ fprintf (stderr, "PT = %"pD"d, BEGV = %"pD"d. ZV = %"pD"d\n",
BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer));
fprintf (stderr, "Cursor x = %d, y = %d, hpos = %d, vpos = %d\n",
w->cursor.x, w->cursor.y, w->cursor.hpos, w->cursor.vpos);
--
2.9.0.GIT
next reply other threads:[~2017-07-06 11:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 11:47 Alexander Kuleshov [this message]
2017-07-08 8:19 ` bug#27597: [PATCH] fix warnings in src/xdisp.c Eli Zaretskii
2017-07-08 10:28 ` Alexander Kuleshov
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=CANCZXo4MeqZ+MdxUUAK85md_7r_3KwEF_ZAsSXqS8cZ5m3+uNw@mail.gmail.com \
--to=kuleshovmail@gmail.com \
--cc=27597@debbugs.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).