gnome-commander r1553 - trunk/src



Author: epiotr
Date: Fri Feb  1 18:03:15 2008
New Revision: 1553
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1553&view=rev

Log:
Code cleanup

Modified:
   trunk/src/gnome-cmd-bookmark-dialog.cc
   trunk/src/gnome-cmd-cmdline.cc
   trunk/src/gnome-cmd-con-smb.cc
   trunk/src/gnome-cmd-con.cc
   trunk/src/gnome-cmd-data.cc
   trunk/src/gnome-cmd-dir-indicator.cc
   trunk/src/gnome-cmd-dir-pool.cc
   trunk/src/gnome-cmd-file-popmenu.cc
   trunk/src/gnome-cmd-smb-net.cc
   trunk/src/gnome-cmd-style.cc
   trunk/src/imageloader.cc
   trunk/src/owner.cc
   trunk/src/plugin_manager.cc

Modified: trunk/src/gnome-cmd-bookmark-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-bookmark-dialog.cc	(original)
+++ trunk/src/gnome-cmd-bookmark-dialog.cc	Fri Feb  1 18:03:15 2008
@@ -552,7 +552,7 @@
 static gboolean
 on_new_bookmark_ok (GnomeCmdStringDialog *string_dialog, const gchar **values, gpointer data)
 {
-    GnomeCmdBookmark *bookmark = g_new (GnomeCmdBookmark, 1);
+    GnomeCmdBookmark *bookmark = g_new0 (GnomeCmdBookmark, 1);
     GnomeCmdCon *con = gnome_cmd_file_selector_get_connection (gnome_cmd_main_win_get_fs (main_win, ACTIVE));
     GnomeCmdBookmarkGroup *group = gnome_cmd_con_get_bookmarks (con);
 

Modified: trunk/src/gnome-cmd-cmdline.cc
==============================================================================
--- trunk/src/gnome-cmd-cmdline.cc	(original)
+++ trunk/src/gnome-cmd-cmdline.cc	Fri Feb  1 18:03:15 2008
@@ -226,8 +226,8 @@
 
     GtkWidget *label;
 
-    cmdline->priv = g_new (GnomeCmdCmdlinePrivate, 1);
-    cmdline->priv->history = NULL;
+    cmdline->priv = g_new0 (GnomeCmdCmdlinePrivate, 1);
+    // cmdline->priv->history = NULL;
 
     cmdline->priv->cwd = gtk_label_new ("cwd");
     gtk_widget_ref (cmdline->priv->cwd);

Modified: trunk/src/gnome-cmd-con-smb.cc
==============================================================================
--- trunk/src/gnome-cmd-con-smb.cc	(original)
+++ trunk/src/gnome-cmd-con-smb.cc	Fri Feb  1 18:03:15 2008
@@ -212,7 +212,7 @@
 
     GnomeCmdCon *con = GNOME_CMD_CON (smb_con);
 
-    smb_con->priv = g_new (GnomeCmdConSmbPrivate, 1);
+    smb_con->priv = g_new0 (GnomeCmdConSmbPrivate, 1);
 
     con->alias = g_strdup (_("SMB"));
     con->method = CON_SMB;

Modified: trunk/src/gnome-cmd-con.cc
==============================================================================
--- trunk/src/gnome-cmd-con.cc	(original)
+++ trunk/src/gnome-cmd-con.cc	Fri Feb  1 18:03:15 2008
@@ -205,10 +205,10 @@
     con->priv->default_dir = NULL;
     con->priv->dir_history = history_new (20);
     con->priv->dir_pool = gnome_cmd_dir_pool_new ();
-    con->priv->bookmarks = g_new (GnomeCmdBookmarkGroup, 1);
-    con->priv->bookmarks->bookmarks = NULL;
+    con->priv->bookmarks = g_new0 (GnomeCmdBookmarkGroup, 1);
     con->priv->bookmarks->con = con;
-    con->priv->bookmarks->data = NULL;
+    // con->priv->bookmarks->bookmarks = NULL;
+    // con->priv->bookmarks->data = NULL;
     con->priv->all_dirs = NULL;
     con->priv->all_dirs_map = NULL;
 }

Modified: trunk/src/gnome-cmd-data.cc
==============================================================================
--- trunk/src/gnome-cmd-data.cc	(original)
+++ trunk/src/gnome-cmd-data.cc	Fri Feb  1 18:03:15 2008
@@ -1030,7 +1030,7 @@
 
 inline void load_search_defaults ()
 {
-    data->priv->search_defaults = g_new (SearchDefaults, 1);
+    data->priv->search_defaults = g_new0 (SearchDefaults, 1);
 
     data->priv->search_defaults->width = gnome_cmd_data_get_int ("/search-history/width", 450);
     data->priv->search_defaults->height = gnome_cmd_data_get_int ("/search-history/height", 400);

Modified: trunk/src/gnome-cmd-dir-indicator.cc
==============================================================================
--- trunk/src/gnome-cmd-dir-indicator.cc	(original)
+++ trunk/src/gnome-cmd-dir-indicator.cc	Fri Feb  1 18:03:15 2008
@@ -54,8 +54,7 @@
 /*******************************
  * Gtk class implementation
  *******************************/
-static void
-destroy (GtkObject *object)
+static void destroy (GtkObject *object)
 {
     GnomeCmdDirIndicator *dir_indicator = GNOME_CMD_DIR_INDICATOR (object);
 
@@ -68,8 +67,7 @@
 }
 
 
-static void
-class_init (GnomeCmdDirIndicatorClass *klass)
+static void class_init (GnomeCmdDirIndicatorClass *klass)
 {
     GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
@@ -83,10 +81,7 @@
 /*******************************
  * Event handlers
  *******************************/
-static gboolean
-on_dir_indicator_clicked (GnomeCmdDirIndicator *indicator,
-                          GdkEventButton *event,
-                          GnomeCmdFileSelector *fs)
+static gboolean on_dir_indicator_clicked (GnomeCmdDirIndicator *indicator, GdkEventButton *event, GnomeCmdFileSelector *fs)
 {
     g_return_val_if_fail (GNOME_CMD_IS_DIR_INDICATOR (indicator), FALSE);
 
@@ -117,14 +112,13 @@
 }
 
 
-static void
-update_markup (GnomeCmdDirIndicator *indicator, gint i)
+inline void update_markup (GnomeCmdDirIndicator *indicator, gint i)
 {
-    gchar *s, *m;
-
     if (!indicator->priv->slashCharPosition)
         return;
 
+    gchar *s, *m;
+
     s = g_strdup (gtk_label_get_text (GTK_LABEL (indicator->priv->label)));
 
     if (i >= 0)
@@ -148,10 +142,7 @@
 }
 
 
-static gint
-on_dir_indicator_motion (GnomeCmdDirIndicator *indicator,
-                         GdkEventMotion *event,
-                         gpointer user_data)
+static gint on_dir_indicator_motion (GnomeCmdDirIndicator *indicator, GdkEventMotion *event, gpointer user_data)
 {
     gint i, iX, iY;
 
@@ -189,10 +180,7 @@
 }
 
 
-static gint
-on_dir_indicator_leave (GnomeCmdDirIndicator *indicator,
-                        GdkEventMotion *event,
-                        gpointer user_data)
+static gint on_dir_indicator_leave (GnomeCmdDirIndicator *indicator, GdkEventMotion *event, gpointer user_data)
 {
     g_return_val_if_fail (GNOME_CMD_IS_DIR_INDICATOR (indicator), FALSE);
 
@@ -204,8 +192,7 @@
 }
 
 
-static int
-get_string_pixel_size (const char *s, int len)
+inline int get_string_pixel_size (const char *s, int len)
 {
     // find the size, in pixels, of the given string
     gint xSize, ySize;
@@ -231,8 +218,7 @@
 }
 
 
-static gboolean
-on_bookmark_button_clicked (GtkWidget *button, GnomeCmdDirIndicator *indicator)
+static gboolean on_bookmark_button_clicked (GtkWidget *button, GnomeCmdDirIndicator *indicator)
 {
     if (indicator->priv->bookmark_is_popped)
     {
@@ -249,8 +235,7 @@
 }
 
 
-static gboolean
-on_history_button_clicked (GtkWidget *button, GnomeCmdDirIndicator *indicator)
+static gboolean on_history_button_clicked (GtkWidget *button, GnomeCmdDirIndicator *indicator)
 {
     if (indicator->priv->history_is_popped)
     {
@@ -267,24 +252,21 @@
 }
 
 
-static void
-on_dir_history_popup_hide (GtkMenu *menu, GnomeCmdDirIndicator *indicator)
+static void on_dir_history_popup_hide (GtkMenu *menu, GnomeCmdDirIndicator *indicator)
 {
     indicator->priv->dir_history_popup = NULL;
     indicator->priv->history_is_popped = FALSE;
 }
 
 
-static void
-on_bookmark_popup_hide (GtkMenu *menu, GnomeCmdDirIndicator *indicator)
+static void on_bookmark_popup_hide (GtkMenu *menu, GnomeCmdDirIndicator *indicator)
 {
     indicator->priv->bookmark_popup = NULL;
     indicator->priv->bookmark_is_popped = FALSE;
 }
 
 
-static void
-on_dir_history_item_selected (GtkMenuItem *item, const gchar *path)
+static void on_dir_history_item_selected (GtkMenuItem *item, const gchar *path)
 {
     g_return_if_fail (path != NULL);
 
@@ -297,8 +279,7 @@
 }
 
 
-static void
-on_bookmark_item_selected (GtkMenuItem *item, GnomeCmdBookmark *bm)
+static void on_bookmark_item_selected (GtkMenuItem *item, GnomeCmdBookmark *bm)
 {
     g_return_if_fail (bm != NULL);
 
@@ -311,10 +292,7 @@
 }
 
 
-static void
-get_popup_pos (GtkMenu *menu,
-               gint *x, gint *y, gboolean push_in,
-               GnomeCmdDirIndicator *indicator)
+static void get_popup_pos (GtkMenu *menu, gint *x, gint *y, gboolean push_in, GnomeCmdDirIndicator *indicator)
 {
     g_return_if_fail (GNOME_CMD_IS_DIR_INDICATOR (indicator));
 
@@ -324,9 +302,7 @@
 }
 
 
-static void
-add_menu_item (GnomeCmdDirIndicator *indicator, GtkMenuShell *shell, const gchar *text,
-               GtkSignalFunc func, gpointer data)
+static void add_menu_item (GnomeCmdDirIndicator *indicator, GtkMenuShell *shell, const gchar *text, GtkSignalFunc func, gpointer data)
 {
     GtkWidget *item = text ? gtk_menu_item_new_with_label (text) : gtk_menu_item_new ();
 
@@ -342,14 +318,8 @@
 }
 
 
-static void
-popup_dir_history (GnomeCmdDirIndicator *indicator)
+static void popup_dir_history (GnomeCmdDirIndicator *indicator)
 {
-    GList *l;
-    GnomeCmdCon *con;
-    History *history;
-    gint w = -1;
-
     if (indicator->priv->dir_history_popup) return;
 
     indicator->priv->dir_history_popup = gtk_menu_new ();
@@ -361,22 +331,23 @@
         GTK_OBJECT (indicator->priv->dir_history_popup), "hide",
         GTK_SIGNAL_FUNC (on_dir_history_popup_hide), indicator);
 
-    con = gnome_cmd_file_selector_get_connection (indicator->priv->fs);
-    history = gnome_cmd_con_get_dir_history (con);
+    GnomeCmdCon *con = gnome_cmd_file_selector_get_connection (indicator->priv->fs);
+    History *history = gnome_cmd_con_get_dir_history (con);
 
-    for (l=history->ents; l; l=l->next)
+    for (GList *l=history->ents; l; l=l->next)
     {
         gchar *path = (gchar *) l->data;
-        add_menu_item (
-            indicator,
-            GTK_MENU_SHELL (indicator->priv->dir_history_popup),
-            path,
-            GTK_SIGNAL_FUNC (on_dir_history_item_selected),
-            path);
+        add_menu_item (indicator,
+                       GTK_MENU_SHELL (indicator->priv->dir_history_popup),
+                       path,
+                       GTK_SIGNAL_FUNC (on_dir_history_item_selected),
+                       path);
     }
 
     gnome_popup_menu_do_popup (indicator->priv->dir_history_popup, (GtkMenuPositionFunc)get_popup_pos, indicator, NULL, NULL, NULL);
 
+    gint w = -1;
+
     if (GTK_WIDGET (indicator)->allocation.width > 100)
         w = GTK_WIDGET (indicator)->allocation.width;
 
@@ -384,8 +355,7 @@
 }
 
 
-static void
-on_bookmarks_add_current (GtkMenuItem *item, GnomeCmdDirIndicator *indicator)
+static void on_bookmarks_add_current (GtkMenuItem *item, GnomeCmdDirIndicator *indicator)
 {
     GnomeCmdDir *dir = gnome_cmd_file_selector_get_directory (indicator->priv->fs);
     GnomeCmdCon *con = gnome_cmd_file_selector_get_connection (indicator->priv->fs);
@@ -401,21 +371,14 @@
 }
 
 
-static void
-on_bookmarks_manage (GtkMenuItem *item, GnomeCmdDirIndicator *indicator)
+static void on_bookmarks_manage (GtkMenuItem *item, GnomeCmdDirIndicator *indicator)
 {
     bookmarks_edit (NULL, NULL);
 }
 
 
-static void
-popup_bookmarks (GnomeCmdDirIndicator *indicator)
+inline void popup_bookmarks (GnomeCmdDirIndicator *indicator)
 {
-    GList *l;
-    GnomeCmdCon *con;
-    GnomeCmdBookmarkGroup *group;
-    gint w = -1;
-
     if (indicator->priv->bookmark_popup) return;
 
     indicator->priv->bookmark_popup = gtk_menu_new ();
@@ -423,18 +386,17 @@
     gtk_object_set_data_full (GTK_OBJECT (indicator), "bookmark_popup", indicator->priv->bookmark_popup, (GtkDestroyNotify) gtk_widget_unref);
     gtk_signal_connect (GTK_OBJECT (indicator->priv->bookmark_popup), "hide", GTK_SIGNAL_FUNC (on_bookmark_popup_hide), indicator);
 
-    con = gnome_cmd_file_selector_get_connection (indicator->priv->fs);
-    group = gnome_cmd_con_get_bookmarks (con);
+    GnomeCmdCon *con = gnome_cmd_file_selector_get_connection (indicator->priv->fs);
+    GnomeCmdBookmarkGroup *group = gnome_cmd_con_get_bookmarks (con);
 
-    for (l = group->bookmarks; l; l = l->next)
+    for (GList *l = group->bookmarks; l; l = l->next)
     {
         GnomeCmdBookmark *bm = (GnomeCmdBookmark *) l->data;
-        add_menu_item (
-            indicator,
-            GTK_MENU_SHELL (indicator->priv->bookmark_popup),
-            bm->name,
-            GTK_SIGNAL_FUNC (on_bookmark_item_selected),
-            bm);
+        add_menu_item (indicator,
+                       GTK_MENU_SHELL (indicator->priv->bookmark_popup),
+                       bm->name,
+                       GTK_SIGNAL_FUNC (on_bookmark_item_selected),
+                       bm);
     }
 
     add_menu_item (indicator, GTK_MENU_SHELL (indicator->priv->bookmark_popup), NULL, NULL, indicator);
@@ -443,6 +405,8 @@
 
     gnome_popup_menu_do_popup (indicator->priv->bookmark_popup, (GtkMenuPositionFunc)get_popup_pos, indicator, NULL, NULL, NULL);
 
+    gint w = -1;
+
     if (GTK_WIDGET (indicator)->allocation.width > 100)
         w = GTK_WIDGET (indicator)->allocation.width;
 
@@ -450,8 +414,7 @@
 }
 
 
-static void
-init (GnomeCmdDirIndicator *indicator)
+static void init (GnomeCmdDirIndicator *indicator)
 {
     GtkWidget *hbox, *arrow, *bbox;
 
@@ -518,8 +481,7 @@
 /***********************************
  * Public functions
  ***********************************/
-GtkType
-gnome_cmd_dir_indicator_get_type    (void)
+GtkType gnome_cmd_dir_indicator_get_type (void)
 {
     static GtkType type = 0;
 
@@ -543,8 +505,7 @@
 }
 
 
-GtkWidget *
-gnome_cmd_dir_indicator_new (GnomeCmdFileSelector *fs)
+GtkWidget *gnome_cmd_dir_indicator_new (GnomeCmdFileSelector *fs)
 {
     GnomeCmdDirIndicator *dir_indicator = (GnomeCmdDirIndicator *) gtk_type_new (gnome_cmd_dir_indicator_get_type ());
 
@@ -556,8 +517,7 @@
 }
 
 
-void
-gnome_cmd_dir_indicator_set_dir (GnomeCmdDirIndicator *indicator, gchar *path)
+void gnome_cmd_dir_indicator_set_dir (GnomeCmdDirIndicator *indicator, gchar *path)
 {
     gchar *s = get_utf8 (path);
     gtk_label_set_text (GTK_LABEL (indicator->priv->label), s);
@@ -633,22 +593,19 @@
 }
 
 
-void
-gnome_cmd_dir_indicator_set_active (GnomeCmdDirIndicator *indicator, gboolean value)
+void gnome_cmd_dir_indicator_set_active (GnomeCmdDirIndicator *indicator, gboolean value)
 {
     // FIXME: Do something creative here
 }
 
 
-void
-gnome_cmd_dir_indicator_show_history (GnomeCmdDirIndicator *indicator)
+void gnome_cmd_dir_indicator_show_history (GnomeCmdDirIndicator *indicator)
 {
     popup_dir_history (indicator);
 }
 
 
-void
-gnome_cmd_dir_indicator_show_bookmarks (GnomeCmdDirIndicator *indicator)
+void gnome_cmd_dir_indicator_show_bookmarks (GnomeCmdDirIndicator *indicator)
 {
     popup_bookmarks (indicator);
 }

Modified: trunk/src/gnome-cmd-dir-pool.cc
==============================================================================
--- trunk/src/gnome-cmd-dir-pool.cc	(original)
+++ trunk/src/gnome-cmd-dir-pool.cc	Fri Feb  1 18:03:15 2008
@@ -38,8 +38,7 @@
 static GtkObjectClass *parent_class = NULL;
 
 
-static void
-check_cache_maxsize (GnomeCmdDirPool *pool)
+inline void check_cache_maxsize (GnomeCmdDirPool *pool)
 {
     // remove the last dir if maxsize is exceeded
     while (g_list_length (pool->priv->queue) > gnome_cmd_data_get_dir_cache_size ())
@@ -61,8 +60,7 @@
  * Gtk class implementation
  *******************************/
 
-static void
-destroy (GtkObject *object)
+static void destroy (GtkObject *object)
 {
     GnomeCmdDirPool *pool = GNOME_CMD_DIR_POOL (object);
 
@@ -75,8 +73,7 @@
 }
 
 
-static void
-class_init (GnomeCmdDirPoolClass *klass)
+static void class_init (GnomeCmdDirPoolClass *klass)
 {
     GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
 
@@ -86,13 +83,12 @@
 }
 
 
-static void
-init (GnomeCmdDirPool *pool)
+static void init (GnomeCmdDirPool *pool)
 {
-    pool->priv = g_new (GnomeCmdDirPoolPrivate, 1);
+    pool->priv = g_new0 (GnomeCmdDirPoolPrivate, 1);
 
     pool->priv->map = g_hash_table_new (g_str_hash, g_str_equal);
-    pool->priv->queue = NULL;
+    // pool->priv->queue = NULL;
 }
 
 
@@ -100,8 +96,7 @@
  * Public functions
  ***********************************/
 
-GtkType
-gnome_cmd_dir_pool_get_type         (void)
+GtkType gnome_cmd_dir_pool_get_type (void)
 {
     static GtkType type = 0;
 
@@ -125,15 +120,13 @@
 }
 
 
-GnomeCmdDirPool *
-gnome_cmd_dir_pool_new (void)
+GnomeCmdDirPool *gnome_cmd_dir_pool_new (void)
 {
     return (GnomeCmdDirPool *) gtk_type_new (gnome_cmd_dir_pool_get_type ());
 }
 
 
-GnomeCmdDir *
-gnome_cmd_dir_pool_get (GnomeCmdDirPool *pool, const gchar *path)
+GnomeCmdDir *gnome_cmd_dir_pool_get (GnomeCmdDirPool *pool, const gchar *path)
 {
     g_return_val_if_fail (GNOME_CMD_IS_DIR_POOL (pool), NULL);
 
@@ -150,8 +143,7 @@
 }
 
 
-void
-gnome_cmd_dir_pool_add (GnomeCmdDirPool *pool, GnomeCmdDir *dir)
+void gnome_cmd_dir_pool_add (GnomeCmdDirPool *pool, GnomeCmdDir *dir)
 {
     g_return_if_fail (GNOME_CMD_IS_DIR_POOL (pool));
     g_return_if_fail (GNOME_CMD_IS_DIR (dir));
@@ -165,8 +157,7 @@
 }
 
 
-void
-gnome_cmd_dir_pool_remove (GnomeCmdDirPool *pool, GnomeCmdDir *dir)
+void gnome_cmd_dir_pool_remove (GnomeCmdDirPool *pool, GnomeCmdDir *dir)
 {
 }
 
@@ -174,17 +165,15 @@
 extern GList *all_dirs;
 
 
-static void
-print_dir (GnomeCmdDir *dir, gpointer data)
+static void print_dir (GnomeCmdDir *dir, gpointer data)
 {
     g_printerr ("%s\n", gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir)));
 }
 
 
-void
-gnome_cmd_dir_pool_show_state (GnomeCmdDirPool *pool)
+void gnome_cmd_dir_pool_show_state (GnomeCmdDirPool *pool)
 {
     g_printerr ("\n\n------------= All currently existing directories =-------------\n");
-    g_list_foreach (all_dirs, (GFunc)print_dir, NULL);
+    g_list_foreach (all_dirs, (GFunc) print_dir, NULL);
 }
 

Modified: trunk/src/gnome-cmd-file-popmenu.cc
==============================================================================
--- trunk/src/gnome-cmd-file-popmenu.cc	(original)
+++ trunk/src/gnome-cmd-file-popmenu.cc	Fri Feb  1 18:03:15 2008
@@ -388,7 +388,7 @@
 }
 
 
-inline gchar *get_default_application_action_name(GList *files)
+inline gchar *get_default_application_action_name (GList *files)
 {
     if (g_list_length(files)>1)
         return g_strdup(_("_Open"));

Modified: trunk/src/gnome-cmd-smb-net.cc
==============================================================================
--- trunk/src/gnome-cmd-smb-net.cc	(original)
+++ trunk/src/gnome-cmd-smb-net.cc	Fri Feb  1 18:03:15 2008
@@ -43,11 +43,11 @@
 
 static void add_wg_to_list (GnomeVFSFileInfo *info, GList **list)
 {
-    SmbEntity *ent = g_new (SmbEntity, 1);
+    SmbEntity *ent = g_new0 (SmbEntity, 1);
 
     ent->name = info->name;
     ent->type = SMB_WORKGROUP;
-    ent->workgroup_name = NULL;
+    // ent->workgroup_name = NULL;
 
     *list = g_list_append (*list, ent);
 }

Modified: trunk/src/gnome-cmd-style.cc
==============================================================================
--- trunk/src/gnome-cmd-style.cc	(original)
+++ trunk/src/gnome-cmd-style.cc	Fri Feb  1 18:03:15 2008
@@ -30,7 +30,7 @@
 GtkStyle *sel_list_style = NULL;
 
 
-static GtkStyle *create_list_style ()
+inline GtkStyle *create_list_style ()
 {
     GnomeCmdColorTheme *cols = gnome_cmd_data_get_current_color_theme ();
     const gchar *font_name = gnome_cmd_data_get_list_font ();
@@ -64,7 +64,7 @@
 }
 
 
-static GtkStyle *create_sel_list_style ()
+inline GtkStyle *create_sel_list_style ()
 {
     GtkStyle *style;
     GnomeCmdColorTheme *cols = gnome_cmd_data_get_current_color_theme ();

Modified: trunk/src/imageloader.cc
==============================================================================
--- trunk/src/imageloader.cc	(original)
+++ trunk/src/imageloader.cc	Fri Feb  1 18:03:15 2008
@@ -418,7 +418,7 @@
         g_free (icon_path2);
         g_free (icon_path3);
 
-        entry = g_new (CacheEntry, 1);
+        entry = g_new0 (CacheEntry, 1);
         entry->dead_end = (pm == NULL || bm == NULL);
         entry->pixmap = pm;
         entry->mask = bm;

Modified: trunk/src/owner.cc
==============================================================================
--- trunk/src/owner.cc	(original)
+++ trunk/src/owner.cc	Fri Feb  1 18:03:15 2008
@@ -45,7 +45,7 @@
 {
     if (pw)
     {
-        user_t *user = g_new(user_t,1);
+        user_t *user = g_new0 (user_t,1);
 
         g_assert (pw->pw_name);
         g_assert (pw->pw_passwd);
@@ -79,7 +79,7 @@
         g_assert (gr->gr_name);
         g_assert (gr->gr_passwd);
 
-        group = g_new(group_t,1);
+        group = g_new0 (group_t,1);
 
         group->zombie =  zombie;
         group->name =    g_strdup (gr->gr_name);

Modified: trunk/src/plugin_manager.cc
==============================================================================
--- trunk/src/plugin_manager.cc	(original)
+++ trunk/src/plugin_manager.cc	Fri Feb  1 18:03:15 2008
@@ -172,7 +172,7 @@
             if (buf.st_mode & S_IFREG)
             {
                 // the direntry has the .so extension and is a regular file, lets accept it
-                PluginData *data = g_new (PluginData, 1);
+                PluginData *data = g_new0 (PluginData, 1);
                 data->fname = g_strdup (ent->d_name);
                 data->fpath = g_build_path (G_DIR_SEPARATOR_S, dpath, ent->d_name, NULL);
                 data->loaded = FALSE;



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