Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove functions marked as unused #1408

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions geeqie.imp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{ include: [ "<bits/types/sig_atomic_t.h>", private, "<csignal>", public ] },
{ include: [ "<bits/types/struct_FILE.h>", private, "<cstdio>", public ] },
{ include: [ "<bits/std_abs.h>", private, "<cstdlib>", public ] },

{ include: [ "\"cairo.h\"", private, "<cairo.h>", public ] },

Expand All @@ -12,6 +13,8 @@

{ include: [ "\"gdk/gdkkeysyms.h\"", private, "<gdk/gdk.h>", public ] },

{ include: [ "\"gio/gemblem.h\"", private, "<gio/gio.h>", public ] },

{ include: [ "@\"gobject/.*\"", private, "<glib-object.h>", public ] },

{ include: [ "<glib/gtypes.h>", private, "<glib.h>", public ] },
Expand Down
1 change: 1 addition & 0 deletions src/advanced-exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "intl.h"
#include "layout-util.h"
#include "layout.h"
#include "main-defines.h"
#include "misc.h"
#include "options.h"
#include "ui-misc.h"
Expand Down
25 changes: 0 additions & 25 deletions src/bar-exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -780,18 +780,6 @@ void bar_pane_exif_destroy(GtkWidget *, gpointer data)
g_free(ped);
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
void bar_pane_exif_size_request_unused(GtkWidget *, GtkRequisition *requisition, gpointer data)
{
auto *ped = static_cast<PaneExifData *>(data);
if (requisition->height < ped->min_height)
{
requisition->height = ped->min_height;
}
}
#pragma GCC diagnostic pop

void bar_pane_exif_size_allocate(GtkWidget *, GtkAllocation *alloc, gpointer data)
{
auto ped = static_cast<PaneExifData *>(data);
Expand Down Expand Up @@ -876,19 +864,6 @@ GList * bar_pane_exif_list()
return exif_list;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
void bar_pane_exif_close_unused(GtkWidget *widget)
{
PaneExifData *ped;

ped = static_cast<PaneExifData *>(g_object_get_data(G_OBJECT(widget), "pane_data"));
if (!ped) return;

g_object_unref(ped->vbox);
}
#pragma GCC diagnostic pop

GtkWidget *bar_pane_exif_new_from_config(const gchar **attribute_names, const gchar **attribute_values)
{
gchar *title = nullptr;
Expand Down
14 changes: 0 additions & 14 deletions src/bar-keywords.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1815,20 +1815,6 @@ gboolean autocomplete_keywords_list_save(gchar *path)
*-------------------------------------------------------------------
*/

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
void bar_pane_keywords_close_unused(GtkWidget *bar)
{
PaneKeywordsData *pkd;

pkd = static_cast<PaneKeywordsData *>(g_object_get_data(G_OBJECT(bar), "pane_data"));
if (!pkd) return;

g_free(pkd->pane.id);
g_object_unref(pkd->widget);
}
#pragma GCC diagnostic pop

GtkWidget *bar_pane_keywords_new_from_config(const gchar **attribute_names, const gchar **attribute_values)
{
gchar *id = g_strdup("keywords");
Expand Down
13 changes: 0 additions & 13 deletions src/bar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -717,19 +717,6 @@ static void bar_size_allocate(GtkWidget *, GtkAllocation *, gpointer data)
bd->width = gtk_paned_get_position(GTK_PANED(bd->lw->utility_paned));
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
gint bar_get_width_unused(GtkWidget *bar)
{
BarData *bd;

bd = static_cast<BarData *>(g_object_get_data(G_OBJECT(bar), "bar_data"));
if (!bd) return 0;

return bd->width;
}
#pragma GCC diagnostic pop

void bar_close(GtkWidget *bar)
{
BarData *bd;
Expand Down
11 changes: 0 additions & 11 deletions src/cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -503,17 +503,6 @@ void cache_sim_data_set_dimensions(CacheData *cd, gint w, gint h)
cd->dimensions = TRUE;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
void cache_sim_data_set_date_unused(CacheData *cd, time_t date)
{
if (!cd) return;

cd->date = date;
cd->have_date = TRUE;
}
#pragma GCC diagnostic pop

void cache_sim_data_set_md5sum(CacheData *cd, const guchar digest[16])
{
gint i;
Expand Down
1 change: 1 addition & 0 deletions src/collect-io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "collect-io.h"

#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <gdk-pixbuf/gdk-pixbuf.h>
Expand Down
3 changes: 0 additions & 3 deletions src/collect-table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
#include <cstddef>
#include <utility>

#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gio/gio.h>
#include <glib-object.h>

#include "cellrenderericon.h"
Expand Down
15 changes: 1 addition & 14 deletions src/collect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ CollectInfo *collection_info_new(FileData *fd, struct stat *, GdkPixbuf *pixbuf)
return ci;
}

void collection_info_free_thumb(CollectInfo *ci)
static void collection_info_free_thumb(CollectInfo *ci)
{
if (ci->pixbuf) g_object_unref(ci->pixbuf);
ci->pixbuf = nullptr;
Expand All @@ -129,19 +129,6 @@ void collection_info_set_thumb(CollectInfo *ci, GdkPixbuf *pixbuf)
ci->pixbuf = pixbuf;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
gboolean collection_info_load_thumb_unused(CollectInfo *ci)
{
if (!ci) return FALSE;

collection_info_free_thumb(ci);

log_printf("collection_info_load_thumb not implemented!\n(because an instant thumb loader not implemented)");
return FALSE;
}
#pragma GCC diagnostic pop

/* an ugly static var, well what ya gonna do ? */
static SortType collection_list_sort_method = SORT_NAME;

Expand Down
1 change: 0 additions & 1 deletion src/collect.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct CollectInfo

CollectInfo *collection_info_new(FileData *fd, struct stat *st, GdkPixbuf *pixbuf);

void collection_info_free_thumb(CollectInfo *ci);
void collection_info_free(CollectInfo *ci);

void collection_info_set_thumb(CollectInfo *ci, GdkPixbuf *pixbuf);
Expand Down
67 changes: 0 additions & 67 deletions src/color-man.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ struct ColorManCache {
gint refcount;
};

/* pixels to transform per idle call */
#define COLOR_MAN_CHUNK_SIZE 81900


static void color_man_lib_init()
{
Expand Down Expand Up @@ -299,17 +296,6 @@ static ColorManCache *color_man_cache_get(ColorManProfileType in_type, const gch
*-------------------------------------------------------------------
*/

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static void color_man_done_unused(ColorMan *cm, ColorManReturnType type)
{
if (cm->func_done)
{
cm->func_done(cm, type, cm->func_done_data);
}
}
#pragma GCC diagnostic pop

void color_man_correct_region(ColorMan *cm, GdkPixbuf *pixbuf, gint x, gint y, gint w, gint h)
{
ColorManCache *cc;
Expand Down Expand Up @@ -347,49 +333,6 @@ void color_man_correct_region(ColorMan *cm, GdkPixbuf *pixbuf, gint x, gint y, g

}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static gboolean color_man_idle_cb_unused(gpointer data)
{
auto *cm = static_cast<ColorMan *>(data);
gint width;
gint height;
gint rh;

if (!cm->pixbuf) return FALSE;

if (cm->imd &&
cm->pixbuf != image_get_pixbuf(cm->imd))
{
cm->idle_id = 0;
color_man_done_unused(cm, COLOR_RETURN_IMAGE_CHANGED);
return FALSE;
}

width = gdk_pixbuf_get_width(cm->pixbuf);
height = gdk_pixbuf_get_height(cm->pixbuf);

if (cm->row > height)
{
if (!cm->incremental_sync && cm->imd)
{
image_area_changed(cm->imd, 0, 0, width, height);
}

cm->idle_id = 0;
color_man_done_unused(cm, COLOR_RETURN_SUCCESS);
return FALSE;
}

rh = COLOR_MAN_CHUNK_SIZE / width + 1;
color_man_correct_region(cm, cm->pixbuf, 0, cm->row, width, rh);
if (cm->incremental_sync && cm->imd) image_area_changed(cm->imd, 0, cm->row, width, rh);
cm->row += rh;

return TRUE;
}
#pragma GCC diagnostic pop

static ColorMan *color_man_new_real(ImageWindow *imd, GdkPixbuf *pixbuf,
ColorManProfileType input_type, const gchar *input_file,
guchar *input_data, guint input_data_len,
Expand Down Expand Up @@ -429,16 +372,6 @@ ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf,
screen_type, screen_file, screen_data, screen_data_len);
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
void color_man_start_bg_unused(ColorMan *cm, ColorMan::DoneFunc done_func, gpointer done_data)
{
cm->func_done = done_func;
cm->func_done_data = done_data;
cm->idle_id = g_idle_add(color_man_idle_cb_unused, cm);
}
#pragma GCC diagnostic pop

ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf,
guchar *input_data, guint input_data_len,
ColorManProfileType screen_type, const gchar *screen_file,
Expand Down
31 changes: 0 additions & 31 deletions src/dnd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,37 +84,6 @@ static void pixbuf_draw_border(GdkPixbuf *pixbuf, gint w, gint h)
}
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static void pixbuf_draw_rect_unused(GdkPixbuf *pixbuf, gint x, gint y, gint w, gint h, guint8 val)
{
gboolean alpha;
gint rs;
guchar *pix;
guchar *p;
gint i;
gint j;

alpha = gdk_pixbuf_get_has_alpha(pixbuf);
rs = gdk_pixbuf_get_rowstride(pixbuf);
pix = gdk_pixbuf_get_pixels(pixbuf);

const gint p_step = alpha ? 4 : 3;

for (j = 0; j < h; j++)
{
p = pix + (rs * (y + j)) + (x * p_step);
for (i = 0; i < w; i++)
{
*p = (*p * (256-val)) >> 8; p++;
*p = (*p * (256-val)) >> 8; p++;
*p = (*p * (256-val)) >> 8; p++;
if (alpha) { *p = 255; p++; }
}
}
}
#pragma GCC diagnostic pop

void dnd_set_drag_icon(GtkWidget *widget, GdkDragContext *context, GdkPixbuf *pixbuf, gint items)
{
GdkPixbuf *dest;
Expand Down
66 changes: 0 additions & 66 deletions src/dupe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -486,57 +486,6 @@ static void dupe_item_free(DupeItem *di)
g_free(di);
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static DupeItem *dupe_item_find_fd_by_list_unused(FileData *fd, GList *work)
{
while (work)
{
auto *di = static_cast<DupeItem *>(work->data);

if (di->fd == fd) return di;

work = work->next;
}

return nullptr;
}

static DupeItem *dupe_item_find_fd_unused(DupeWindow *dw, FileData *fd)
{
DupeItem *di;

di = dupe_item_find_fd_by_list_unused(fd, dw->list);
if (!di && dw->second_set) di = dupe_item_find_fd_by_list_unused(fd, dw->second_list);

return di;
}

static DupeItem *dupe_item_find_path_by_list_unused(const gchar *path, GList *work)
{
while (work)
{
auto *di = static_cast<DupeItem *>(work->data);

if (strcmp(di->fd->path, path) == 0) return di;

work = work->next;
}

return nullptr;
}

static DupeItem *dupe_item_find_path_unused(DupeWindow *dw, const gchar *path)
{
DupeItem *di;

di = dupe_item_find_path_by_list_unused(path, dw->list);
if (!di && dw->second_set) di = dupe_item_find_path_by_list_unused(path, dw->second_list);

return di;
}
#pragma GCC diagnostic pop

/*
* ------------------------------------------------------------------
* Image property cache
Expand Down Expand Up @@ -2729,21 +2678,6 @@ static void dupe_item_remove(DupeWindow *dw, DupeItem *di)
dupe_window_update_count(dw, FALSE);
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
static gboolean dupe_item_remove_by_path_unused(DupeWindow *dw, const gchar *path)
{
DupeItem *di;

di = dupe_item_find_path_unused(dw, path);
if (!di) return FALSE;

dupe_item_remove(dw, di);

return TRUE;
}
#pragma GCC diagnostic pop

static gboolean dupe_files_add_queue_cb(gpointer data)
{
DupeItem *di = nullptr;
Expand Down
Loading