Re: [PATCH spice-server v3 02/32] red-replay-qxl: Use PRIxPTR constant for string formatting

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

 



> On 1/7/19 8:01 PM, Frediano Ziglio wrote:
> > These constants are meant to be used in format string for pointers
> > types. Use them for portability.
> > 
> > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > ---
> >   server/red-replay-qxl.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
> > index 9b63d237..4884e97e 100644
> > --- a/server/red-replay-qxl.c
> > +++ b/server/red-replay-qxl.c
> > @@ -227,7 +227,7 @@ static replay_t read_binary(SpiceReplay *replay, const
> > char *prefix, size_t *siz
> >       uint8_t *zlib_buffer;
> >       z_stream strm;
> >   
> > -    snprintf(template, sizeof(template), "binary %%d %s %%ld:%%n",
> > prefix);
> > +    snprintf(template, sizeof(template), "binary %%d %s %%" PRIdPTR
> > ":%%n", prefix);
> 
> Following patch01 wouldn't it be better to use G_GINTPTR_FORMAT here ?
> 
> Uri.
> 

The format between GLib functions and C functions can be different so
I use GLib format constants for GLib functions and C format constants
for C functions.

> >       replay_fscanf_check(replay, template, &with_zlib, size,
> >       &replay->end_pos);
> >       if (replay->error) {
> >           return REPLAY_ERROR;
> > 
> 
> 

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




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