[Spice-devel] [Spice-commits] 2 commits - client/x11 server/smartcard.c

Christophe Fergeau cfergeau at redhat.com
Fri Jan 13 07:59:56 PST 2012


On Fri, Jan 13, 2012 at 07:18:37AM -0800, Hans de Goede wrote:
>  client/x11/images/alt_image.c |    4 ++--
>  client/x11/images/red_icon.c  |    4 ++--
>  server/smartcard.c            |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> New commits:
> commit 0ac13ecbc4c20d322b1c49935678c25e621a0a99
> Author: Hans de Goede <hdegoede at redhat.com>
> Date:   Fri Jan 13 15:26:57 2012 +0100
> 
>     client-x11: Fix building with gcc-4.7
>     
>     Without this change gcc says:
>     x11/res.cpp:31:1: error: narrowing conversion of ???(((unsigned int)_alt_image.<anonymous struct>::width) * 4u)??? from ???unsigned int??? to ???int??? inside { } is ill-formed in C++11 [-Werror=narrowing]
>     x11/res.cpp:61:1: error: narrowing conversion of ???_red_icon.<anonymous struct>::width??? from ???const uint32_t {aka const unsigned int}??? to ???int??? inside { } is ill-formed in C++11 [-Werror=narrowing]
>     x11/res.cpp:61:1: error: narrowing conversion of ???_red_icon.<anonymous struct>::height??? from ???const uint32_t {aka const unsigned int}??? to ???int??? inside { } is ill-formed in C++11 [-Werror=narrowing]
>     cc1plus: all warnings being treated as errors
>     
>     Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> 
> diff --git a/client/x11/images/alt_image.c b/client/x11/images/alt_image.c
> index 7968339..e11cf1f 100644
> --- a/client/x11/images/alt_image.c
> +++ b/client/x11/images/alt_image.c
> @@ -1,6 +1,6 @@
>  static const struct {
> -	uint32_t width;
> -	uint32_t height;
> +	int width;
> +	int height;
>  	uint8_t pixel_data[17496];
>  } _alt_image = { 81, 54, {

I don't really understand why we need to do this. does the error message
mean that the compiler sees 81 as an int and it doesn't like converting
that to an unsigned int? or something else?

Thanks,

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120113/bf8cecd9/attachment.pgp>


More information about the Spice-devel mailing list