Max Reitz dc3c871ae0 ui/curses: Fix build with -m32
wchar_t may resolve to be an unsigned long on 32-bit architectures.
Using the %x conversion specifier will then give a compiler warning:

ui/curses.c: In function ‘get_ucs’:
ui/curses.c:492:49: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘wchar_t’ {aka ‘long int’} [-Werror=format=]
  492 |         fprintf(stderr, "Could not convert 0x%04x "
      |                                              ~~~^
      |                                                 |
      |                                                 unsigned int
      |                                              %04lx
  493 |                         "from wchar_t to a multibyte character: %s\n",
  494 |                         wch, strerror(errno));
      |                         ~~~
      |                         |
      |                         wchar_t {aka long int}
ui/curses.c:504:49: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘wchar_t’ {aka ‘long int’} [-Werror=format=]
  504 |         fprintf(stderr, "Could not convert 0x%04x "
      |                                              ~~~^
      |                                                 |
      |                                                 unsigned int
      |                                              %04lx
  505 |                         "from a multibyte character to UCS-2 : %s\n",
  506 |                         wch, strerror(errno));
      |                         ~~~
      |                         |
      |                         wchar_t {aka long int}

Fix this by casting the wchar_t value to an unsigned long and using %lx
as the conversion specifier.

Fixes: b7b664a4fe9a955338f2e11a0f7433b29c8cbad0
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-id: 20190527142540.23255-1-mreitz@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-06-07 11:29:40 +02:00
..
2017-10-17 10:25:42 +02:00
2019-03-11 08:39:02 +01:00
2019-06-07 11:29:40 +02:00
2019-02-21 11:45:19 +01:00
2019-01-14 11:04:35 +00:00
2019-05-17 13:21:40 +02:00
2019-02-05 10:45:44 +01:00
2019-02-05 10:45:44 +01:00
2018-10-12 14:46:24 +02:00
2019-02-05 10:45:44 +01:00
2017-10-17 10:25:42 +02:00
2017-07-27 14:23:09 +02:00
2016-02-04 17:01:04 +00:00
2016-02-04 17:01:04 +00:00
2019-02-05 16:50:18 +01:00