[Spice-devel] [PATCH spice-server] dcc: Use more portable mnemonic

Victor Toso victortoso at redhat.com
Tue Jun 6 08:48:32 UTC 2017


Hi,

On Tue, Jun 06, 2017 at 09:40:31AM +0100, Frediano Ziglio wrote:
> The maximum value for a 32 bit variable is UINT32_MAX and not
> UINT_MAX. Currently all supported platforms have these two
> constants having the same value so this patch don't change
> nothing in the generated code but potentially this could
> change in a future.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Grep shows one more, but that is unsigned int...

server/dcc.c:1058:    if (report->num_frames == 0 && report->num_drops == UINT_MAX) {
server/red-qxl.c:986:    qxl_state->max_monitors = UINT_MAX;

 struct QXLState {
   ...
     unsigned int max_monitors;
 };

Acked-by: Victor Toso <victortoso at redhat.com>

> ---
>  server/dcc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/dcc.c b/server/dcc.c
> index 4d5c8a0..dbc496c 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -1055,7 +1055,7 @@ static bool dcc_handle_stream_report(DisplayChannelClient *dcc,
>          return TRUE;
>      }
>  
> -    if (report->num_frames == 0 && report->num_drops == UINT_MAX) {
> +    if (report->num_frames == 0 && report->num_drops == UINT32_MAX) {
>          spice_warning("stream_report: the client does not support stream %u",
>                        report->stream_id);
>          /* Stop streaming the video so the client can see it */
> -- 
> 2.9.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170606/d62fd168/attachment.sig>


More information about the Spice-devel mailing list