[grilo] operation-options: Update doc on undefined behavior



commit 7ffb45b104ea78fe9938909b43d4ae81cbc55bf4
Author: Victor Toso <victortoso gnome org>
Date:   Sat Mar 20 13:27:44 2021 +0100

    operation-options: Update doc on undefined behavior
    
    As pointed out by Carlos in the issue below, we are currently calling
    va_arg (args, gint) to the user parameter, that translates to 0 which
    we would happily take in Grilo as correct.
    
    For numeric types, user can simply use G_MAXINT and friends to limit
    lower/upper limits. Grilo will take care of clamping this if value if
    it is outside boundaries of a specific metadata-key.
    
    Resolves: https://gitlab.gnome.org/GNOME/grilo/-/issues/140

 src/grl-operation-options.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/grl-operation-options.c b/src/grl-operation-options.c
index 7296f477..59769da9 100644
--- a/src/grl-operation-options.c
+++ b/src/grl-operation-options.c
@@ -767,14 +767,16 @@ grl_operation_options_set_key_range_filter_value (GrlOperationOptions *options,
  *
  * Set filter as "min1 <= k1 <= max1 AND min2 <= k2 <= max2 AND ..."
  *
- * The range can be open if some of the minX, maxX values are %NULL.
+ * For non numeric types, the range can be open if some of the minX, maxX
+ * values are %NULL. Leaving NULL for numeric types leads to underifned
+ * behavior.
 
  * <example>
  *  Album must start with "T" and the bitrate should be 256kbs or greater.
  *  <programlisting>
  *   grl_operation_options_set_key_range_filters (my_options,
  *                                                GRL_METADATA_KEY_ALBUM, "Ta", "Tz",
- *                                                GRL_METADATA_KEY_BITRATE, 256, NULL,
+ *                                                GRL_METADATA_KEY_BITRATE, 256, G_MAXINT,
  *                                                NULL);
  *  </programlisting>
  * </example>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]