| Message ID | 20260618123844.656396-21-barnabas.pocze@ideasonboard.com |
|---|---|
| State | Accepted |
| Headers | show |
| Series |
|
| Related | show |
I guess false is cast to 0, but ok Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> On Thu, Jun 18, 2026 at 02:38:37PM +0200, Barnabás Pőcze wrote: > Return `0` instead of `false` in the error case. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > --- > src/gstreamer/gstlibcameraallocator.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp > index d4492d994b..d9d771d545 100644 > --- a/src/gstreamer/gstlibcameraallocator.cpp > +++ b/src/gstreamer/gstlibcameraallocator.cpp > @@ -260,7 +260,7 @@ gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *self, > GLibLocker lock(GST_OBJECT(self)); > > auto *pool = reinterpret_cast<GQueue *>(g_hash_table_lookup(self->pools, stream)); > - g_return_val_if_fail(pool, false); > + g_return_val_if_fail(pool, 0); > > return pool->length; > } > -- > 2.54.0 >
Hi, Le lundi 22 juin 2026 à 15:47 +0200, Jacopo Mondi a écrit : > I guess false is cast to 0, but ok > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Yes, but it remains a type miss-match, I would have expected a build warning. Its good catch, cleaner once fixed, so I second this. Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > > On Thu, Jun 18, 2026 at 02:38:37PM +0200, Barnabás Pőcze wrote: > > Return `0` instead of `false` in the error case. > > > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > > --- > > src/gstreamer/gstlibcameraallocator.cpp | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp > > index d4492d994b..d9d771d545 100644 > > --- a/src/gstreamer/gstlibcameraallocator.cpp > > +++ b/src/gstreamer/gstlibcameraallocator.cpp > > @@ -260,7 +260,7 @@ gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *self, > > GLibLocker lock(GST_OBJECT(self)); > > > > auto *pool = reinterpret_cast<GQueue *>(g_hash_table_lookup(self->pools, stream)); > > - g_return_val_if_fail(pool, false); > > + g_return_val_if_fail(pool, 0); > > > > return pool->length; > > } > > -- > > 2.54.0 > >
On Thu, Jun 18, 2026 at 02:38:37PM +0200, Barnabás Pőcze wrote: > Return `0` instead of `false` in the error case. I'd add "as the function's return type is gsize". > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/gstreamer/gstlibcameraallocator.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp > index d4492d994b..d9d771d545 100644 > --- a/src/gstreamer/gstlibcameraallocator.cpp > +++ b/src/gstreamer/gstlibcameraallocator.cpp > @@ -260,7 +260,7 @@ gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *self, > GLibLocker lock(GST_OBJECT(self)); > > auto *pool = reinterpret_cast<GQueue *>(g_hash_table_lookup(self->pools, stream)); > - g_return_val_if_fail(pool, false); > + g_return_val_if_fail(pool, 0); > > return pool->length; > }
diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp index d4492d994b..d9d771d545 100644 --- a/src/gstreamer/gstlibcameraallocator.cpp +++ b/src/gstreamer/gstlibcameraallocator.cpp @@ -260,7 +260,7 @@ gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *self, GLibLocker lock(GST_OBJECT(self)); auto *pool = reinterpret_cast<GQueue *>(g_hash_table_lookup(self->pools, stream)); - g_return_val_if_fail(pool, false); + g_return_val_if_fail(pool, 0); return pool->length; }
Return `0` instead of `false` in the error case. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/gstreamer/gstlibcameraallocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)