<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 2:06 PM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 1 Jul 2015 12:29:00 +0200<br>
Marek Chalupa <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>> wrote:<br>
<br>
> sizeof operator returns size_t, which need not to be unsigned int, but can<br>
> be long (long) unsigned int.<br>
> So here the correct fix should be either to use %zu (since C99) or cast it<br>
> to unsigned long and use %lu<br>
<br>
</span> < SardemFF7> Why has sizeof() anything do to with your patch? "vtnr"<br>
is an "unsigned int" and is not a size_t or anything O_o<br></blockquote><div><br></div><div>Oops, sorry all. Don't know why I thought it is size_t ...<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
;-)<br>
<br>
Thanks,<br>
pq<br>
<br>
> On Sat, Jun 20, 2015 at 1:28 AM, Bryce Harrington <<a href="mailto:bryce@osg.samsung.com">bryce@osg.samsung.com</a>><br>
<span class="">> wrote:<br>
><br>
> > Addresses this warning found by Denis Denisov:<br>
> ><br>
> > [src/logind-util.c:702]: (warning) %d in format string (no. 1)<br>
> > requires 'int' but the argument type is 'unsigned int'.<br>
> ><br>
</span>> > Signed-off-by: Bryce Harrington <<a href="mailto:bryce@osg.samsung.com">bryce@osg.samsung.com</a>><br>
<span class="">> > ---<br>
> > src/logind-util.c | 2 +-<br>
> > 1 file changed, 1 insertion(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/src/logind-util.c b/src/logind-util.c<br>
> > index 5c95874..006a1ae 100644<br>
> > --- a/src/logind-util.c<br>
> > +++ b/src/logind-util.c<br>
> > @@ -702,7 +702,7 @@ weston_logind_setup_vt(struct weston_logind *wl)<br>
> > sigset_t mask;<br>
> > struct wl_event_loop *loop;<br>
> ><br>
> > - snprintf(buf, sizeof(buf), "/dev/tty%d", wl->vtnr);<br>
> > + snprintf(buf, sizeof(buf), "/dev/tty%u", wl->vtnr);<br>
> > buf[sizeof(buf) - 1] = 0;<br>
> ><br>
> > wl->vt = open(buf, O_RDWR|O_CLOEXEC|O_NONBLOCK);<br>
> > --<br>
> > 1.9.1<br>
> ><br>
> > _______________________________________________<br>
> > wayland-devel mailing list<br>
</span>> > <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
> ><br>
<br>
</blockquote></div><br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra">Marek<br></div></div>