diff options
| author | Paul Eggert | 2012-09-30 18:43:28 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-09-30 18:43:28 -0700 |
| commit | 82ef37c1405ff5ed16a6506d006ae3340c69e607 (patch) | |
| tree | 2698475d012748f32e5f96ab9d9a8ec3887fe4b0 /src | |
| parent | 0478776bb7f04bfb60ff7a2397546c955a1f3ce2 (diff) | |
| download | emacs-82ef37c1405ff5ed16a6506d006ae3340c69e607.tar.gz emacs-82ef37c1405ff5ed16a6506d006ae3340c69e607.zip | |
* frame.c (x_report_frame_params): Port better to wider ints.
Do not assume that EMACS_UINT is the same width as uprintmax_t,
or that pointers can be printed in 15 decimal digits.
Avoid GCC warnings if EMACS_UINT is wider than a pointer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/frame.c | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 96f6eb07cd1..9704c6d4469 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-10-01 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * frame.c (x_report_frame_params): Port better to wider ints. | ||
| 4 | Do not assume that EMACS_UINT is the same width as uprintmax_t, | ||
| 5 | or that pointers can be printed in 15 decimal digits. | ||
| 6 | Avoid GCC warnings if EMACS_UINT is wider than a pointer. | ||
| 7 | |||
| 1 | 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr> | 8 | 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr> |
| 2 | 9 | ||
| 3 | Support x64 build on MS-Windows. | 10 | Support x64 build on MS-Windows. |
diff --git a/src/frame.c b/src/frame.c index 33bbe0ad704..0a127740980 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3028,9 +3028,9 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist) | |||
| 3028 | void | 3028 | void |
| 3029 | x_report_frame_params (struct frame *f, Lisp_Object *alistptr) | 3029 | x_report_frame_params (struct frame *f, Lisp_Object *alistptr) |
| 3030 | { | 3030 | { |
| 3031 | char buf[16]; | ||
| 3032 | Lisp_Object tem; | 3031 | Lisp_Object tem; |
| 3033 | EMACS_UINT w; | 3032 | uprintmax_t w; |
| 3033 | char buf[INT_BUFSIZE_BOUND (w)]; | ||
| 3034 | 3034 | ||
| 3035 | /* Represent negative positions (off the top or left screen edge) | 3035 | /* Represent negative positions (off the top or left screen edge) |
| 3036 | in a way that Fmodify_frame_parameters will understand correctly. */ | 3036 | in a way that Fmodify_frame_parameters will understand correctly. */ |
| @@ -3067,7 +3067,7 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr) | |||
| 3067 | MS-Windows it returns a value whose type is HANDLE, which is | 3067 | MS-Windows it returns a value whose type is HANDLE, which is |
| 3068 | actually a pointer. Explicit casting avoids compiler | 3068 | actually a pointer. Explicit casting avoids compiler |
| 3069 | warnings. */ | 3069 | warnings. */ |
| 3070 | w = (EMACS_UINT) FRAME_X_WINDOW (f); | 3070 | w = (uintptr_t) FRAME_X_WINDOW (f); |
| 3071 | store_in_alist (alistptr, Qwindow_id, | 3071 | store_in_alist (alistptr, Qwindow_id, |
| 3072 | make_formatted_string (buf, "%"pMu, w)); | 3072 | make_formatted_string (buf, "%"pMu, w)); |
| 3073 | #ifdef HAVE_X_WINDOWS | 3073 | #ifdef HAVE_X_WINDOWS |
| @@ -3075,7 +3075,7 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr) | |||
| 3075 | /* Tooltip frame may not have this widget. */ | 3075 | /* Tooltip frame may not have this widget. */ |
| 3076 | if (FRAME_X_OUTPUT (f)->widget) | 3076 | if (FRAME_X_OUTPUT (f)->widget) |
| 3077 | #endif | 3077 | #endif |
| 3078 | w = (EMACS_UINT) FRAME_OUTER_WINDOW (f); | 3078 | w = (uintptr_t) FRAME_OUTER_WINDOW (f); |
| 3079 | store_in_alist (alistptr, Qouter_window_id, | 3079 | store_in_alist (alistptr, Qouter_window_id, |
| 3080 | make_formatted_string (buf, "%"pMu, w)); | 3080 | make_formatted_string (buf, "%"pMu, w)); |
| 3081 | #endif | 3081 | #endif |