Skip to content
Browse files

Dropped assert()s (with g_assert() instead), removed duplicating fiel…

…ds from file monitor structures
  • Loading branch information...
1 parent be1a572 commit dd946ffb568fbed7da89c6867af703139a918a61 @dmatveev committed Jun 12, 2011
Showing with 4 additions and 26 deletions.
  1. +2 −11 gio/kqueue/gkqueuedirectorymonitor.c
  2. +2 −15 gio/kqueue/gkqueuefilemonitor.c
View
13 gio/kqueue/gkqueuedirectorymonitor.c
@@ -25,12 +25,10 @@
#include "gkqueuedirectorymonitor.h"
#include "kqueue-helper.h"
#include <gio/giomodule.h>
-#include <assert.h>
struct _GKqueueDirectoryMonitor
{
GLocalDirectoryMonitor parent_instance;
- gchar *filename;
kqueue_sub *sub;
gboolean pair_moves;
};
@@ -57,12 +55,6 @@ g_kqueue_directory_monitor_finalize (GObject *object)
kqueue_monitor->sub = NULL;
}
- if (kqueue_monitor->filename)
- {
- g_free (kqueue_monitor->filename);
- kqueue_monitor->filename = NULL;
- }
-
if (G_OBJECT_CLASS (g_kqueue_directory_monitor_parent_class)->finalize)
(*G_OBJECT_CLASS (g_kqueue_directory_monitor_parent_class)->finalize) (object);
}
@@ -86,13 +78,12 @@ g_kqueue_directory_monitor_constructor (GType type,
construct_properties);
kqueue_monitor = G_KQUEUE_DIRECTORY_MONITOR (obj);
- kqueue_monitor->filename = g_strdup (G_LOCAL_DIRECTORY_MONITOR (obj)->dirname);
ret_kh_startup = _kh_startup();
- assert (ret_kh_startup);
+ g_assert (ret_kh_startup);
/* TODO: pair moves. */
- sub = _kh_sub_new (kqueue_monitor->filename,
+ sub = _kh_sub_new (G_LOCAL_DIRECTORY_MONITOR (obj)->dirname,
FALSE,
kqueue_monitor);
View
17 gio/kqueue/gkqueuefilemonitor.c
@@ -25,16 +25,10 @@
#include "gkqueuefilemonitor.h"
#include "kqueue-helper.h"
#include <gio/giomodule.h>
-#include <assert.h>
-/* TODO: This code is also written as in the inotify backend, but wait.
- * kqueue_sub already contains `filename' and `pair_moves' fields. Do
- * we need it in the `GKqueueFileMonitor', since we already have a `sub'
- * field? Probably I will drop it. */
struct _GKqueueFileMonitor
{
GLocalFileMonitor parent_instance;
- gchar *filename;
kqueue_sub *sub;
gboolean pair_moves;
};
@@ -61,12 +55,6 @@ g_kqueue_file_monitor_finalize (GObject *object)
kqueue_monitor->sub = NULL;
}
- if (kqueue_monitor->filename)
- {
- g_free (kqueue_monitor->filename);
- kqueue_monitor->filename = NULL;
- }
-
if (G_OBJECT_CLASS (g_kqueue_file_monitor_parent_class)->finalize)
(*G_OBJECT_CLASS (g_kqueue_file_monitor_parent_class)->finalize) (object);
}
@@ -90,13 +78,12 @@ g_kqueue_file_monitor_constructor (GType type,
construct_properties);
kqueue_monitor = G_KQUEUE_FILE_MONITOR (obj);
- kqueue_monitor->filename = g_strdup (G_LOCAL_FILE_MONITOR (obj)->filename);
ret_kh_startup = _kh_startup();
- assert (ret_kh_startup);
+ g_assert (ret_kh_startup);
/* TODO: pair moves. */
- sub = _kh_sub_new (kqueue_monitor->filename,
+ sub = _kh_sub_new (G_LOCAL_FILE_MONITOR (obj)->filename,
FALSE,
kqueue_monitor);

0 comments on commit dd946ff

Please sign in to comment.
Something went wrong with that request. Please try again.