[libcamera-devel] libcamera: Document missing parameters and return values

Message ID 20190108144642.10611-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 93a037efff7b8afd04aad76f6b6a4514acb6f670
Headers show
Series
  • [libcamera-devel] libcamera: Document missing parameters and return values
Related show

Commit Message

Laurent Pinchart Jan. 8, 2019, 2:46 p.m. UTC
Several functions are missing documentation for some of them parameters
and/or for their return value. Fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/device_enumerator.cpp | 3 +++
 src/libcamera/log.cpp               | 7 +++++++
 src/libcamera/pipeline_handler.cpp  | 8 +++++---
 src/libcamera/signal.cpp            | 5 +++++
 4 files changed, 20 insertions(+), 3 deletions(-)

Comments

Niklas Söderlund Jan. 9, 2019, 3:41 p.m. UTC | #1
Hi Laurent,

Thanks for your patch.

On 2019-01-08 16:46:42 +0200, Laurent Pinchart wrote:
> Several functions are missing documentation for some of them parameters
> and/or for their return value. Fix this.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/device_enumerator.cpp | 3 +++
>  src/libcamera/log.cpp               | 7 +++++++
>  src/libcamera/pipeline_handler.cpp  | 8 +++++---
>  src/libcamera/signal.cpp            | 5 +++++
>  4 files changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
> index c088f3e5d243..f1d016db64a0 100644
> --- a/src/libcamera/device_enumerator.cpp
> +++ b/src/libcamera/device_enumerator.cpp
> @@ -124,6 +124,9 @@ bool DeviceMatch::match(const MediaDevice *device) const
>   * implementations may be needed. This function creates the best enumerator for
>   * the operating system based on the available resources. Not all different
>   * enumerator types are guaranteed to support all features.
> + *
> + * \return A pointer to the newly created device enumerator on success, or
> + * nullptr if an error occurs
>   */
>  DeviceEnumerator *DeviceEnumerator::create()
>  {
> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
> index c1ec55618ea3..281e31d963f5 100644
> --- a/src/libcamera/log.cpp
> +++ b/src/libcamera/log.cpp
> @@ -90,6 +90,11 @@ static const char *log_severity_name(LogSeverity severity)
>   */
>  
>  /**
> + * \param fileName The file name where the message is logged from
> + * \param line The line number where the message is logged from
> + * \param severity The log message severity, controlling how the message will be
> + * displayed
> + *
>   * Create a log message pertaining to line \a line of file \a fileName. The
>   * \a severity argument sets the message severity to control whether it will be
>   * output or dropped.
> @@ -130,6 +135,8 @@ LogMessage::~LogMessage()
>   * Data is added to a LogMessage through the stream returned by this function.
>   * The stream implements the std::ostream API and can be used for logging as
>   * std::cout.
> + *
> + * \return A reference to the log message stream
>   */
>  
>  } /* namespace libcamera */
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index 093821d4c471..ee7694879848 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -36,11 +36,13 @@ namespace libcamera {
>  /**
>   * \fn PipelineHandler::match(DeviceEnumerator *enumerator)
>   * \brief Match media devices and create camera instances
> + * \param enumerator The enumerator providing all media devices found in the
> + * system
>   *
>   * This function is the main entry point of the pipeline handler. It is called
> - * by the device enumerator with the enumerator passed as an argument. It shall
> - * acquire from the enumerator all the media devices it needs for a single
> - * pipeline and create one or multiple Camera instances.
> + * by the device enumerator with the \a enumerator passed as an argument. It
> + * shall acquire from the \a enumerator all the media devices it needs for a
> + * single pipeline and create one or multiple Camera instances.
>   *
>   * If all media devices needed by the pipeline handler are found, they must all
>   * be acquired by a call to MediaDevice::acquire(). This function shall then
> diff --git a/src/libcamera/signal.cpp b/src/libcamera/signal.cpp
> index 0fd3bb2a34a1..51536dc5fdd0 100644
> --- a/src/libcamera/signal.cpp
> +++ b/src/libcamera/signal.cpp
> @@ -58,21 +58,26 @@ namespace libcamera {
>  /**
>   * \fn Signal::disconnect(T *object)
>   * \brief Disconnect the signal from all slots of the \a object
> + * \param object The object pointer whose slots to disconnect
>   */
>  
>  /**
>   * \fn Signal::disconnect(T *object, void(T::*func)(Args...))
>   * \brief Disconnect the signal from the \a object slot member function \a func
> + * \param object The object pointer whose slots to disconnect
> + * \param func The slot member function to disconnect
>   */
>  
>  /**
>   * \fn Signal::disconnect(void(*func)(Args...))
>   * \brief Disconnect the signal from the slot static function \a func
> + * \param func The slot static function to disconnect
>   */
>  
>  /**
>   * \fn Signal::emit(Args... args)
>   * \brief Emit the signal and call all connected slots
> + * \param args The arguments passed to the connected slots
>   *
>   * Emitting a signal calls all connected slots synchronously and sequentially in
>   * the order the slots have been connected. The arguments passed to the emit()
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
index c088f3e5d243..f1d016db64a0 100644
--- a/src/libcamera/device_enumerator.cpp
+++ b/src/libcamera/device_enumerator.cpp
@@ -124,6 +124,9 @@  bool DeviceMatch::match(const MediaDevice *device) const
  * implementations may be needed. This function creates the best enumerator for
  * the operating system based on the available resources. Not all different
  * enumerator types are guaranteed to support all features.
+ *
+ * \return A pointer to the newly created device enumerator on success, or
+ * nullptr if an error occurs
  */
 DeviceEnumerator *DeviceEnumerator::create()
 {
diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
index c1ec55618ea3..281e31d963f5 100644
--- a/src/libcamera/log.cpp
+++ b/src/libcamera/log.cpp
@@ -90,6 +90,11 @@  static const char *log_severity_name(LogSeverity severity)
  */
 
 /**
+ * \param fileName The file name where the message is logged from
+ * \param line The line number where the message is logged from
+ * \param severity The log message severity, controlling how the message will be
+ * displayed
+ *
  * Create a log message pertaining to line \a line of file \a fileName. The
  * \a severity argument sets the message severity to control whether it will be
  * output or dropped.
@@ -130,6 +135,8 @@  LogMessage::~LogMessage()
  * Data is added to a LogMessage through the stream returned by this function.
  * The stream implements the std::ostream API and can be used for logging as
  * std::cout.
+ *
+ * \return A reference to the log message stream
  */
 
 } /* namespace libcamera */
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 093821d4c471..ee7694879848 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -36,11 +36,13 @@  namespace libcamera {
 /**
  * \fn PipelineHandler::match(DeviceEnumerator *enumerator)
  * \brief Match media devices and create camera instances
+ * \param enumerator The enumerator providing all media devices found in the
+ * system
  *
  * This function is the main entry point of the pipeline handler. It is called
- * by the device enumerator with the enumerator passed as an argument. It shall
- * acquire from the enumerator all the media devices it needs for a single
- * pipeline and create one or multiple Camera instances.
+ * by the device enumerator with the \a enumerator passed as an argument. It
+ * shall acquire from the \a enumerator all the media devices it needs for a
+ * single pipeline and create one or multiple Camera instances.
  *
  * If all media devices needed by the pipeline handler are found, they must all
  * be acquired by a call to MediaDevice::acquire(). This function shall then
diff --git a/src/libcamera/signal.cpp b/src/libcamera/signal.cpp
index 0fd3bb2a34a1..51536dc5fdd0 100644
--- a/src/libcamera/signal.cpp
+++ b/src/libcamera/signal.cpp
@@ -58,21 +58,26 @@  namespace libcamera {
 /**
  * \fn Signal::disconnect(T *object)
  * \brief Disconnect the signal from all slots of the \a object
+ * \param object The object pointer whose slots to disconnect
  */
 
 /**
  * \fn Signal::disconnect(T *object, void(T::*func)(Args...))
  * \brief Disconnect the signal from the \a object slot member function \a func
+ * \param object The object pointer whose slots to disconnect
+ * \param func The slot member function to disconnect
  */
 
 /**
  * \fn Signal::disconnect(void(*func)(Args...))
  * \brief Disconnect the signal from the slot static function \a func
+ * \param func The slot static function to disconnect
  */
 
 /**
  * \fn Signal::emit(Args... args)
  * \brief Emit the signal and call all connected slots
+ * \param args The arguments passed to the connected slots
  *
  * Emitting a signal calls all connected slots synchronously and sequentially in
  * the order the slots have been connected. The arguments passed to the emit()