Re: [PATCH 01/22] Eliminate signed/unsigned warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rebased at https://cgit.freedesktop.org/~fziglio/spice-streaming-agent/commit/?h=style3&id=4f76b95337136bce0b0ec8b28aefc20a21ae6ac7,
I would use a different invalid value like -1, you need to change other lines I think.

Frediano

> 
> https://lists.freedesktop.org/archives/spice-devel/2018-February/042080.html
> 
> On Wed, Feb 28, 2018 at 04:43:04PM +0100, Christophe de Dinechin wrote:
> > From: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> > 
> > Signed-off-by: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> > ---
> >  src/mjpeg-fallback.cpp        | 2 +-
> >  src/spice-streaming-agent.cpp | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/mjpeg-fallback.cpp b/src/mjpeg-fallback.cpp
> > index fd37167..5758893 100644
> > --- a/src/mjpeg-fallback.cpp
> > +++ b/src/mjpeg-fallback.cpp
> > @@ -47,7 +47,7 @@ private:
> >      std::vector<uint8_t> frame;
> >  
> >      // last frame sizes
> > -    uint32_t last_width = ~0u, last_height = ~0u;
> > +    int last_width = ~0u, last_height = ~0u;
> >      // last time before capture
> >      uint64_t last_time = 0;
> >  };
> > diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
> > index 494cf8e..b17e27f 100644
> > --- a/src/spice-streaming-agent.cpp
> > +++ b/src/spice-streaming-agent.cpp
> > @@ -88,7 +88,7 @@ static void handle_stream_start_stop(uint32_t len)
> >                                   "(longer than " +
> >                                   std::to_string(sizeof(msg)) + ")");
> >      }
> >      int n = read(streamfd, &msg, len);
> > -    if (n != len) {
> > +    if (n != (int) len) {
> >          throw std::runtime_error("read command from device FAILED -- read
> >          " + std::to_string(n) +
> >                                   " expected " + std::to_string(len));
> >      }
> > @@ -109,7 +109,7 @@ static void handle_stream_capabilities(uint32_t len)
> >          throw std::runtime_error("capability message too long");
> >      }
> >      int n = read(streamfd, caps, len);
> > -    if (n != len) {
> > +    if (n != (int) len) {
> >          throw std::runtime_error("read command from device FAILED -- read
> >          " + std::to_string(n) +
> >                                   " expected " + std::to_string(len));
> >      }
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]