[libcamera-devel,2/3] Documentation: application-developer: Use correct type to store size
diff mbox series

Message ID 20210926212108.22510-2-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,1/3] Documentation: application-developer: Make global variable static
Related show

Commit Message

Laurent Pinchart Sept. 26, 2021, 9:21 p.m. UTC
The return type of std::vector::size() is size_t. Use the same type,
instead of unsigned int, to store its return value when retrieving the
number of allocated buffers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 Documentation/guides/application-developer.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Elder Sept. 27, 2021, 6:58 a.m. UTC | #1
Hi Laurent,

On Mon, Sep 27, 2021 at 12:21:07AM +0300, Laurent Pinchart wrote:
> The return type of std::vector::size() is size_t. Use the same type,
> instead of unsigned int, to store its return value when retrieving the
> number of allocated buffers.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  Documentation/guides/application-developer.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst
> index 3de13060db08..41a7d88369be 100644
> --- a/Documentation/guides/application-developer.rst
> +++ b/Documentation/guides/application-developer.rst
> @@ -278,7 +278,7 @@ as the parameter of the ``FrameBufferAllocator::buffers()`` function.
>             return -ENOMEM;
>         }
>  
> -       unsigned int allocated = allocator->buffers(cfg.stream()).size();
> +       size_t allocated = allocator->buffers(cfg.stream()).size();
>         std::cout << "Allocated " << allocated << " buffers for stream" << std::endl;
>     }
>  
> -- 
> Regards,
> 
> Laurent Pinchart
>
Kieran Bingham Sept. 27, 2021, 12:20 p.m. UTC | #2
On Mon, Sep 27, 2021 at 12:21:07AM +0300, Laurent Pinchart wrote:
> The return type of std::vector::size() is size_t. Use the same type,
> instead of unsigned int, to store its return value when retrieving the
> number of allocated buffers.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  Documentation/guides/application-developer.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst
> index 3de13060db08..41a7d88369be 100644
> --- a/Documentation/guides/application-developer.rst
> +++ b/Documentation/guides/application-developer.rst
> @@ -278,7 +278,7 @@ as the parameter of the ``FrameBufferAllocator::buffers()`` function.
>             return -ENOMEM;
>         }
>  
> -       unsigned int allocated = allocator->buffers(cfg.stream()).size();
> +       size_t allocated = allocator->buffers(cfg.stream()).size();
>         std::cout << "Allocated " << allocated << " buffers for stream" << std::endl;
>     }
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 

--
Kieran

Patch
diff mbox series

diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst
index 3de13060db08..41a7d88369be 100644
--- a/Documentation/guides/application-developer.rst
+++ b/Documentation/guides/application-developer.rst
@@ -278,7 +278,7 @@  as the parameter of the ``FrameBufferAllocator::buffers()`` function.
            return -ENOMEM;
        }
 
-       unsigned int allocated = allocator->buffers(cfg.stream()).size();
+       size_t allocated = allocator->buffers(cfg.stream()).size();
        std::cout << "Allocated " << allocated << " buffers for stream" << std::endl;
    }