[geocode-glib] forward: Restrict answer count to be positive



commit 2a1052201f9b04bcea41e2936dae9fe2a30b05d2
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Nov 17 16:57:27 2016 +0000

    forward: Restrict answer count to be positive
    
    Require it to be a positive integer. This is technically an API break,
    but any code which used a non-positive integer before would not have
    worked anyway.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774631

 geocode-glib/geocode-forward.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/geocode-glib/geocode-forward.c b/geocode-glib/geocode-forward.c
index 05a4739..057485e 100644
--- a/geocode-glib/geocode-forward.c
+++ b/geocode-glib/geocode-forward.c
@@ -397,7 +397,7 @@ geocode_forward_search (GeocodeForward      *forward,
 /**
  * geocode_forward_set_answer_count:
  * @forward: a #GeocodeForward representing a query
- * @count: the number of requested results
+ * @count: the number of requested results, which must be greater than zero
  *
  * Sets the number of requested results to @count.
  **/
@@ -408,6 +408,7 @@ geocode_forward_set_answer_count (GeocodeForward *forward,
        GValue *count_value;
 
        g_return_if_fail (GEOCODE_IS_FORWARD (forward));
+       g_return_if_fail (count > 0);
 
        forward->priv->answer_count = count;
 


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