diff options
author | Victor Toso <victortoso@gnome.org> | 2021-03-20 13:27:44 +0100 |
---|---|---|
committer | Victor Toso <victortoso@gnome.org> | 2021-03-20 13:27:44 +0100 |
commit | 7ffb45b104ea78fe9938909b43d4ae81cbc55bf4 (patch) | |
tree | b8dae70ff84cc2fd5369a1b9a2fed601280da300 | |
parent | 928134e240f13b3aa2c858e7d17e1d0f65aa12de (diff) | |
download | grilo-7ffb45b104ea78fe9938909b43d4ae81cbc55bf4.tar.gz |
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
-rw-r--r-- | src/grl-operation-options.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/grl-operation-options.c b/src/grl-operation-options.c index 7296f47..59769da 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> |