From 208a048da7706662bcb55579063a63cc95a524c9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 9 Sep 2011 11:32:43 +0300 Subject: [PATCH] src/frame.c (x_report_frame_params): Cast to avoid compiler warnings. --- src/ChangeLog | 4 ++++ src/frame.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ad50d5bb3d1..97a70e87fcd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-09-09 Eli Zaretskii + + * frame.c (x_report_frame_params): Cast to avoid compiler warnings. + 2011-09-08 Martin Rudalics * window.c (Fset_window_prev_buffers, Fset_window_next_buffers): diff --git a/src/frame.c b/src/frame.c index e20b3a7fdb2..cf866e66578 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3098,7 +3098,11 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr) for non-toolkit scroll bar. ruler-mode.el depends on this. */ : Qnil)); - w = FRAME_X_WINDOW (f); + /* FRAME_X_WINDOW is not guaranteed to return an integer. E.g., on + MS-Windows it returns a value whose type is HANDLE, which is + actually a pointer. Explicit casting avoids compiler + warnings. */ + w = (unsigned long) FRAME_X_WINDOW (f); sprintf (buf, "%lu", w); store_in_alist (alistptr, Qwindow_id, build_string (buf)); @@ -3108,7 +3112,7 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr) if (FRAME_X_OUTPUT (f)->widget) #endif { - w = FRAME_OUTER_WINDOW (f); + w = (unsigned long) FRAME_OUTER_WINDOW (f); sprintf (buf, "%lu", w); } store_in_alist (alistptr, Qouter_window_id, -- 2.39.2