[glib] GFileMonitor: Don't accept negative values for rate-limit
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GFileMonitor: Don't accept negative values for rate-limit
- Date: Sun, 28 Nov 2010 22:16:09 +0000 (UTC)
commit bfbd7169a258ac9561f2d01755651046e13f462b
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Nov 28 17:14:49 2010 -0500
GFileMonitor: Don't accept negative values for rate-limit
Patch by Alksander Morgado,
https://bugzilla.gnome.org/show_bug.cgi?id=635768
gio/gfilemonitor.c | 16 ++++++++--------
gio/gfilemonitor.h | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gio/gfilemonitor.c b/gio/gfilemonitor.c
index 38a0493..726cd62 100644
--- a/gio/gfilemonitor.c
+++ b/gio/gfilemonitor.c
@@ -327,21 +327,21 @@ g_file_monitor_cancel (GFileMonitor* monitor)
/**
* g_file_monitor_set_rate_limit:
* @monitor: a #GFileMonitor.
- * @limit_msecs: a integer with the limit in milliseconds to
- * poll for changes.
+ * @limit_msecs: a non-negative integer with the limit in milliseconds
+ * to poll for changes
*
* Sets the rate limit to which the @monitor will report
- * consecutive change events to the same file.
- *
- **/
+ * consecutive change events to the same file.
+ */
void
g_file_monitor_set_rate_limit (GFileMonitor *monitor,
- int limit_msecs)
+ gint limit_msecs)
{
GFileMonitorPrivate *priv;
-
+
g_return_if_fail (G_IS_FILE_MONITOR (monitor));
-
+ g_return_if_fail (limit_msecs >= 0);
+
priv = monitor->priv;
if (priv->rate_limit_msec != limit_msecs)
{
diff --git a/gio/gfilemonitor.h b/gio/gfilemonitor.h
index cf6f6be..8e27d22 100644
--- a/gio/gfilemonitor.h
+++ b/gio/gfilemonitor.h
@@ -81,7 +81,7 @@ GType g_file_monitor_get_type (void) G_GNUC_CONST;
gboolean g_file_monitor_cancel (GFileMonitor *monitor);
gboolean g_file_monitor_is_cancelled (GFileMonitor *monitor);
void g_file_monitor_set_rate_limit (GFileMonitor *monitor,
- int limit_msecs);
+ gint limit_msecs);
/* For implementations */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]