* Re: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.
[not found] <20210623082744.24421-1-swee.aun.khor@intel.com>
@ 2021-06-23 12:33 ` Gerd Hoffmann
2021-06-24 0:56 ` Khor, Swee Aun
0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2021-06-23 12:33 UTC (permalink / raw)
To: Khor, Swee Aun
Cc: khairul.anuar.romli, Hazwan.Arif.Mazlan, vivek.kasireddy, Khor,
qemu-devel, eblake, armbru
On Wed, Jun 23, 2021 at 04:27:44PM +0800, Khor, Swee Aun wrote:
> This lets user select monitor number to display QEMU in full screen
> with -display gtk,full-screen-on-monitor=<value>.
../../ui/gtk.c: In function 'gtk_display_init':
../../ui/gtk.c:2300:25: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'int64_t' {aka 'long long int'} [-Werror=format=]
2300 | warn_report("Failed to enable full screen on monitor %ld. "
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
2303 | opts->u.gtk.full_screen_on_monitor, monitor_n);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int64_t {aka long long int}
take care,
Gerd
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.
2021-06-23 12:33 ` [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor' Gerd Hoffmann
@ 2021-06-24 0:56 ` Khor, Swee Aun
2021-06-24 8:48 ` Gerd Hoffmann
0 siblings, 1 reply; 4+ messages in thread
From: Khor, Swee Aun @ 2021-06-24 0:56 UTC (permalink / raw)
To: Gerd Hoffmann
Cc: Romli, Khairul Anuar, Khor, Swee Aun, Mazlan, Hazwan Arif,
Kasireddy, Vivek, qemu-devel, eblake, armbru
Hi Gerd,
I am able to compile the code without error with my v3 patch. I don't see my patch showing up in https://patchew.org/QEMU/ , is it due to this compilation error?
I tried to change from %ld -> %lld but I encountered compilation error this time.
../ui/gtk.c: In function 'gtk_display_init':
../ui/gtk.c:2300:25: error: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int64_t' {aka 'long int'} [-Werror=format=]
2300 | warn_report("Failed to enable full screen on monitor %lld. "
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
2303 | opts->u.gtk.full_screen_on_monitor, monitor_n);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int64_t {aka long int}
cc1: all warnings being treated as errors
Suspect it is due to variants of host machine, I think I will change it to use PRId64 which is more generic for all platform like below. What you think?
warn_report("Failed to enable full screen on monitor %" PRId64 ". "
"Current total number of monitors is %d, "
"please verify full-screen-on-monitor option value.",
opts->u.gtk.full_screen_on_monitor, monitor_n);
or you prefer casting ? This seems working as well.
warn_report("Failed to enable full screen on monitor %lld . "
"Current total number of monitors is %d, "
"please verify full-screen-on-monitor option value.",
(long long)opts->u.gtk.full_screen_on_monitor, monitor_n);
Regards,
SweeAun
-----Original Message-----
From: Gerd Hoffmann <kraxel@redhat.com>
Sent: Wednesday, June 23, 2021 8:34 PM
To: Khor, Swee Aun <swee.aun.khor@intel.com>
Cc: qemu-devel@nongnu.org; armbru@redhat.com; eblake@redhat.com; Romli, Khairul Anuar <khairul.anuar.romli@intel.com>; Kasireddy, Vivek <vivek.kasireddy@intel.com>; Mazlan, Hazwan Arif <hazwan.arif.mazlan@intel.com>; Khor@sirius.home.kraxel.org
Subject: Re: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.
On Wed, Jun 23, 2021 at 04:27:44PM +0800, Khor, Swee Aun wrote:
> This lets user select monitor number to display QEMU in full screen
> with -display gtk,full-screen-on-monitor=<value>.
../../ui/gtk.c: In function 'gtk_display_init':
../../ui/gtk.c:2300:25: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'int64_t' {aka 'long long int'} [-Werror=format=]
2300 | warn_report("Failed to enable full screen on monitor %ld. "
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
2303 | opts->u.gtk.full_screen_on_monitor, monitor_n);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int64_t {aka long long int}
take care,
Gerd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.
2021-06-24 0:56 ` Khor, Swee Aun
@ 2021-06-24 8:48 ` Gerd Hoffmann
2021-06-24 8:51 ` Khor, Swee Aun
0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2021-06-24 8:48 UTC (permalink / raw)
To: Khor, Swee Aun
Cc: Romli, Khairul Anuar, Mazlan, Hazwan Arif, Kasireddy, Vivek,
qemu-devel, eblake, armbru
On Thu, Jun 24, 2021 at 12:56:28AM +0000, Khor, Swee Aun wrote:
> Hi Gerd,
> I am able to compile the code without error with my v3 patch. I don't see my patch showing up in https://patchew.org/QEMU/ , is it due to this compilation error?
>
> I tried to change from %ld -> %lld but I encountered compilation error this time.
>
> ../ui/gtk.c: In function 'gtk_display_init':
> ../ui/gtk.c:2300:25: error: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int64_t' {aka 'long int'} [-Werror=format=]
> 2300 | warn_report("Failed to enable full screen on monitor %lld. "
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ......
> 2303 | opts->u.gtk.full_screen_on_monitor, monitor_n);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | |
> | int64_t {aka long int}
> cc1: all warnings being treated as errors
stdint.h also has #defines for printing integers (PRI{x,d}{8,16,32,64}),
they make sure the correct format string is used.
PRId64 would be the one for int64_t
take care,
Gerd
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.
2021-06-24 8:48 ` Gerd Hoffmann
@ 2021-06-24 8:51 ` Khor, Swee Aun
0 siblings, 0 replies; 4+ messages in thread
From: Khor, Swee Aun @ 2021-06-24 8:51 UTC (permalink / raw)
To: Gerd Hoffmann
Cc: Romli, Khairul Anuar, Mazlan, Hazwan Arif, Kasireddy, Vivek,
qemu-devel, eblake, armbru
Thanks Gerd. I will submit another patch using PRId64 In warn_report.
Regards,
SweeAun
-----Original Message-----
From: Gerd Hoffmann <kraxel@redhat.com>
Sent: Thursday, June 24, 2021 4:49 PM
To: Khor, Swee Aun <swee.aun.khor@intel.com>
Cc: qemu-devel@nongnu.org; armbru@redhat.com; eblake@redhat.com; Romli, Khairul Anuar <khairul.anuar.romli@intel.com>; Kasireddy, Vivek <vivek.kasireddy@intel.com>; Mazlan, Hazwan Arif <hazwan.arif.mazlan@intel.com>
Subject: Re: [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor'.
On Thu, Jun 24, 2021 at 12:56:28AM +0000, Khor, Swee Aun wrote:
> Hi Gerd,
> I am able to compile the code without error with my v3 patch. I don't see my patch showing up in https://patchew.org/QEMU/ , is it due to this compilation error?
>
> I tried to change from %ld -> %lld but I encountered compilation error this time.
>
> ../ui/gtk.c: In function 'gtk_display_init':
> ../ui/gtk.c:2300:25: error: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int64_t' {aka 'long int'} [-Werror=format=]
> 2300 | warn_report("Failed to enable full screen on monitor %lld. "
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ......
> 2303 | opts->u.gtk.full_screen_on_monitor, monitor_n);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | |
> | int64_t {aka long int}
> cc1: all warnings being treated as errors
stdint.h also has #defines for printing integers (PRI{x,d}{8,16,32,64}), they make sure the correct format string is used.
PRId64 would be the one for int64_t
take care,
Gerd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-24 8:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210623082744.24421-1-swee.aun.khor@intel.com>
2021-06-23 12:33 ` [PATCH v3] ui/gtk: New -display gtk option 'full-screen-on-monitor' Gerd Hoffmann
2021-06-24 0:56 ` Khor, Swee Aun
2021-06-24 8:48 ` Gerd Hoffmann
2021-06-24 8:51 ` Khor, Swee Aun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.