Revision: 1463
http://geeqie.svn.sourceforge.net/geeqie/?rev=1463&view=rev
Author: zas_
Date: 2009-03-01 23:14:19 +0000 (Sun, 01 Mar 2009)
Log Message:
-----------
When g_new0() is used, drop redundant initializations to NULL, FALSE or 0,
second pass.
Modified Paths:
--------------
trunk/src/collect-table.c
trunk/src/collect.c
trunk/src/dupe.c
trunk/src/editors.c
trunk/src/exif.c
trunk/src/filedata.c
trunk/src/image-overlay.c
trunk/src/img-view.c
trunk/src/pan-item.c
trunk/src/pan-view.c
trunk/src/remote.c
trunk/src/search.c
trunk/src/ui_tree_edit.c
trunk/src/utilops.c
Modified: trunk/src/collect-table.c
===================================================================
--- trunk/src/collect-table.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/collect-table.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -2437,35 +2437,14 @@
gint i;
ct = g_new0(CollectTable, 1);
+
ct->cd = cd;
- ct->columns = 0;
- ct->rows = 0;
-
- ct->selection = NULL;
- ct->prev_selection = NULL;
-
- ct->tip_window = NULL;
ct->tip_delay_id = -1;
-
- ct->marker_window = NULL;
- ct->marker_info = NULL;
-
- ct->status_label = NULL;
- ct->extra_label = NULL;
-
- ct->focus_row = 0;
- ct->focus_column = 0;
- ct->focus_info = NULL;
-
ct->show_text = options->show_icon_names;
ct->sync_idle_id = -1;
ct->drop_idle_id = -1;
- ct->popup = NULL;
- ct->drop_info = NULL;
- ct->drop_list = NULL;
-
ct->scrolled = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(ct->scrolled),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ct->scrolled),
Modified: trunk/src/collect.c
===================================================================
--- trunk/src/collect.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/collect.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -323,23 +323,10 @@
cd = g_new0(CollectionData, 1);
- collection_list = g_list_append(collection_list, cd);
-
cd->ref = 1; /* starts with a ref of 1 */
-
- cd->list = NULL;
cd->sort_method = SORT_NONE;
- cd->thumb_loader = NULL;
- cd->info_updated_func = NULL;
-
- cd->window_read = FALSE;
- cd->window_x = 0;
- cd->window_y = 0;
cd->window_w = COLLECT_DEF_WIDTH;
cd->window_h = COLLECT_DEF_HEIGHT;
-
- cd->changed = FALSE;
-
cd->existence = g_hash_table_new(NULL, NULL);
if (path)
@@ -350,8 +337,6 @@
}
else
{
- cd->path = NULL;
-
if (untitled_counter == 0)
{
cd->name = g_strdup(_("Untitled"));
@@ -366,6 +351,9 @@
file_data_register_notify_func(collection_notify_cb, cd,
NOTIFY_PRIORITY_MEDIUM);
+
+ collection_list = g_list_append(collection_list, cd);
+
return cd;
}
@@ -1183,8 +1171,6 @@
cw = g_new0(CollectWindow, 1);
- cw->close_dialog = NULL;
-
collection_window_list = g_list_append(collection_window_list, cw);
cw->cd = collection_new(path);
Modified: trunk/src/dupe.c
===================================================================
--- trunk/src/dupe.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/dupe.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -288,18 +288,8 @@
di = g_new0(DupeItem, 1);
di->fd = file_data_ref(fd);
-
- di->group = NULL;
di->group_rank = 0.0;
- di->simd = NULL;
- di->checksum = 0;
- di->md5sum = NULL;
- di->width = 0;
- di->height = 0;
-
- di->second = FALSE;
-
return di;
}
Modified: trunk/src/editors.c
===================================================================
--- trunk/src/editors.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/editors.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -1057,8 +1057,6 @@
ed->flags = flags;
ed->editor = editor;
ed->total = (flags & EDITOR_SINGLE_COMMAND) ? 1 : g_list_length(list);
- ed->count = 0;
- ed->stopping = FALSE;
ed->callback = cb;
ed->data = data;
Modified: trunk/src/exif.c
===================================================================
--- trunk/src/exif.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/exif.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -511,8 +511,6 @@
item->tag = tag;
item->marker = marker;
item->elements = elements;
- item->data = NULL;
- item->data_len = 0;
switch (format)
{
@@ -1228,8 +1226,6 @@
g_free(pathl);
exif = g_new0(ExifData, 1);
- exif->items = NULL;
- exif->current = NULL;
exif->path = g_strdup(path);
res = exif_jpeg_parse(exif, (guchar *)f, size, ExifKnownMarkersList);
Modified: trunk/src/filedata.c
===================================================================
--- trunk/src/filedata.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/filedata.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -346,17 +346,9 @@
fd = g_new0(FileData, 1);
- fd->path = NULL;
- fd->name = NULL;
- fd->collate_key_name = NULL;
- fd->collate_key_name_nocase = NULL;
- fd->original_path = NULL;
-
fd->size = st->st_size;
fd->date = st->st_mtime;
fd->mode = st->st_mode;
- fd->thumb_pixbuf = NULL;
- fd->sidecar_files = NULL;
fd->ref = 1;
fd->magick = 0x12345678;
Modified: trunk/src/image-overlay.c
===================================================================
--- trunk/src/image-overlay.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/image-overlay.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -1007,7 +1007,6 @@
osd->idle_id = -1;
osd->timer_id = -1;
osd->show = OSD_SHOW_NOTHING;
- osd->histogram = NULL;
osd->x = options->image_overlay.x;
osd->y = options->image_overlay.y;
Modified: trunk/src/img-view.c
===================================================================
--- trunk/src/img-view.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/img-view.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -833,10 +833,6 @@
if (!fd && !list && (!cd || !info)) return NULL;
vw = g_new0(ViewWindow, 1);
- vw->fs = NULL;
- vw->ss = NULL;
- vw->list = NULL;
- vw->list_pointer = NULL;
vw->window = window_new(GTK_WINDOW_TOPLEVEL, "view",
PIXBUF_INLINE_ICON_VIEW, NULL, NULL);
Modified: trunk/src/pan-item.c
===================================================================
--- trunk/src/pan-item.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/pan-item.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -450,6 +450,7 @@
PanItem *pi;
pi = g_new0(PanItem, 1);
+
pi->type = PAN_ITEM_THUMB;
pi->fd = fd;
pi->x = x;
@@ -457,10 +458,6 @@
pi->width = PAN_THUMB_SIZE + PAN_SHADOW_OFFSET * 2;
pi->height = PAN_THUMB_SIZE + PAN_SHADOW_OFFSET * 2;
- pi->pixbuf = NULL;
-
- pi->queued = FALSE;
-
pw->list = g_list_prepend(pw->list, pi);
return pi;
@@ -849,8 +846,6 @@
ta = g_new0(PanTextAlignment, 1);
ta->pw = pw;
- ta->column1 = NULL;
- ta->column2 = NULL;
ta->x = x;
ta->y = y;
ta->key = g_strdup(key);
Modified: trunk/src/pan-view.c
===================================================================
--- trunk/src/pan-view.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/pan-view.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -791,7 +791,6 @@
pg->y = j * ch / 2;
pg->w = cw;
pg->h = ch;
- pg->list = NULL;
pw->list_grid = g_list_prepend(pw->list_grid, pg);
@@ -2360,11 +2359,6 @@
pw->ignore_symlinks = TRUE;
- pw->list = NULL;
- pw->list_static = NULL;
- pw->list_grid = NULL;
-
- pw->fs = NULL;
pw->overlay_id = -1;
pw->idle_id = -1;
Modified: trunk/src/remote.c
===================================================================
--- trunk/src/remote.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/remote.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -226,15 +226,11 @@
}
rc = g_new0(RemoteConnection, 1);
+
rc->server = TRUE;
rc->fd = fd;
rc->path = g_strdup(path);
- rc->read_func = NULL;
- rc->read_data = NULL;
-
- rc->clients = NULL;
-
channel = g_io_channel_unix_new(rc->fd);
g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL);
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/search.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -2601,10 +2601,6 @@
sd->search_height = 480;
sd->search_width_end = 1024;
sd->search_height_end = 768;
- sd->search_name = NULL;
- sd->search_name_match_case = FALSE;
- sd->search_comment = NULL;
- sd->search_comment_match_case = FALSE;
sd->search_type = SEARCH_MATCH_NONE;
@@ -2616,16 +2612,13 @@
sd->match_comment = SEARCH_MATCH_CONTAINS;
sd->match_name_enable = TRUE;
- sd->match_size_enable = FALSE;
- sd->match_date_enable = FALSE;
- sd->match_dimensions_enable = FALSE;
- sd->match_similarity_enable = FALSE;
- sd->match_keywords_enable = FALSE;
- sd->match_comment_enable = FALSE;
sd->search_similarity = 95;
- sd->search_similarity_path = example_file ?
g_strdup(example_file->path) : NULL;
- sd->search_similarity_cd = NULL;
+
+ if (example_file)
+ {
+ sd->search_similarity_path = g_strdup(example_file->path);
+ }
sd->search_idle_id = -1;
sd->update_idle_id = -1;
Modified: trunk/src/ui_tree_edit.c
===================================================================
--- trunk/src/ui_tree_edit.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/ui_tree_edit.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -209,7 +209,6 @@
ted = g_new0(TreeEditData, 1);
ted->old_name = g_strdup(text);
- ted->new_name = NULL;
ted->edit_func = edit_func;
ted->edit_data = data;
Modified: trunk/src/utilops.c
===================================================================
--- trunk/src/utilops.c 2009-03-01 21:35:18 UTC (rev 1462)
+++ trunk/src/utilops.c 2009-03-01 23:14:19 UTC (rev 1463)
@@ -341,11 +341,12 @@
UtilityData *ud;
ud = g_new0(UtilityData, 1);
+
ud->type = type;
ud->phase = UTILITY_PHASE_START;
ud->update_idle_id = -1;
ud->perform_idle_id = -1;
- ud->external_command = NULL;
+
return ud;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn