retro_controller_iterator_next() prints errors on null `port` and `controller` args
/**
* retro_controller_iterator_next:
* @self: a #RetroControllerIterator
* @port: (out) (optional): return location for the port
* @controller: (out) (optional) (nullable): return location for the controller
*
* Fetch the next #RetroController and the port number it is plugged into.
*
* Returns: %FALSE if it reached the end, %TRUE otherwise
*/
gboolean
retro_controller_iterator_next (RetroControllerIterator *self,
guint **port,
RetroController **controller)
{
g_return_val_if_fail (RETRO_IS_CONTROLLER_ITERATOR (self), FALSE);
g_return_val_if_fail (port != NULL, FALSE);
g_return_val_if_fail (controller != NULL, FALSE);
While it makes sense to check if port and controller aren't NULL
, the (optional)
annotations imply it's perfectly fine to not pass them. So either they should be changed or the g_return_val_if_fail()
checks should be removed in favor of simply if (port)
and if (controller)
.