[Rawstudio-dev] [PATCH] sparse spotted errors and warnings

Edouard Gomez ed.gomez at free.fr
Wed Jan 3 14:50:46 CET 2007


Sparse spots quite a few errors in the code:
 - mixing declararyions and code
 - make static possible functions
 - declare extern functions that are meant to be extern
 - variables shadowing

This fixes all spotted errors and warnings as of today. I folded the ~10
patches all together to make it easier to apply, if you want to review
individual file fixes, ask for the series instead of the folded patch.

diff -r a9de2785421d -r 94b3505c6fdc src/arch-generic.c
--- a/src/arch-generic.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/arch-generic.c	Wed Jan 03 14:24:23 2007 +0100
@@ -23,7 +23,7 @@
 /* Default dsp function binder, defined for all archs so that a common C
  * implementation of every optimized function is shared among archs */
 void
-rs_bind_default_functions()
+rs_bind_default_functions(void)
 {
 	/* Bind all default C implementation fucntions */
 
@@ -42,7 +42,7 @@ rs_bind_default_functions()
 /* Optimized dsp function binder, defined for all archs that don't have 
  * custom code - a stub for the generic C arch */
 void
-rs_bind_optimized_functions()
+rs_bind_optimized_functions(void)
 {
 }
 #endif
diff -r a9de2785421d -r 94b3505c6fdc src/dcraw_api.c
--- a/src/dcraw_api.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/dcraw_api.c	Wed Jan 03 14:24:23 2007 +0100
@@ -21,9 +21,9 @@
 #include "dcraw_api.h"
 
 #ifdef WITH_MMAP_HACK
-FILE *rs_fopen(const char *path, const char *mode);
-int rs_fclose(FILE *fp);
-inline int rs_fseek(FILE *stream, long offset, int whence);
+extern FILE *rs_fopen(const char *path, const char *mode);
+extern int rs_fclose(FILE *fp);
+extern int rs_fseek(FILE *stream, long offset, int whence);
 
 #define fopen(a,b) rs_fopen(a,b)
 #define fclose(a) rs_fclose(a)
@@ -78,8 +78,8 @@ void fuji_rotate_INDI(gushort (**image_p
 void fuji_rotate_INDI(gushort (**image_p)[4], int *height_p, int *width_p,
     int *fuji_width_p, const int colors, const double step);
 
-char *messageBuffer = NULL;
-int lastStatus = DCRAW_SUCCESS;
+static char *messageBuffer = NULL;
+static int lastStatus = DCRAW_SUCCESS;
 
 int dcraw_open(dcraw_data *h,char *filename)
 {
@@ -163,6 +163,7 @@ int dcraw_load_raw(dcraw_data *h)
 {
     int i, j;
     double dmin;
+    double rgb_cam_transpose[4][3];
 
     g_free(messageBuffer);
     messageBuffer = NULL;
@@ -205,7 +206,6 @@ int dcraw_load_raw(dcraw_data *h)
     memcpy(h->cam_mul, cam_mul, sizeof cam_mul);
     memcpy(h->rgb_cam, rgb_cam, sizeof rgb_cam);
 
-    double rgb_cam_transpose[4][3];
     for (i=0; i<4; i++) for (j=0; j<3; j++)
 	rgb_cam_transpose[i][j] = rgb_cam[j][i];
     pseudoinverse (rgb_cam_transpose, h->cam_rgb, colors);
@@ -266,10 +266,12 @@ int dcraw_image_stretch(dcraw_image_data
 int dcraw_image_stretch(dcraw_image_data *image, int ymag)
 {
     int r;
+    int w = image->width;
+    dcraw_image_type *iBuf;
+
     if (ymag==1) return DCRAW_SUCCESS;
     if (ymag!=2) return DCRAW_ERROR;
-    int w = image->width;
-    dcraw_image_type *iBuf = g_new(dcraw_image_type,
+    iBuf = g_new(dcraw_image_type,
 	    image->height * 2  * w);
     for(r=0; r<image->height; r++) {
 	memcpy(iBuf[(2*r)*w], image->image[r*w], w*4*2);
diff -r a9de2785421d -r 94b3505c6fdc src/drawingarea.c
--- a/src/drawingarea.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/drawingarea.c	Wed Jan 03 14:24:23 2007 +0100
@@ -26,6 +26,7 @@
 #include "color.h"
 #include "gtk-interface.h"
 #include "conf_interface.h"
+#include "drawingarea.h"
 
 static gint start_x, start_y;
 static gboolean drawingarea_expose (GtkWidget *widget, GdkEventExpose *event, RS_BLOB *rs);
@@ -34,8 +35,8 @@ static gboolean gui_drawingarea_button(G
 static gboolean gui_drawingarea_button(GtkWidget *widget, GdkEventButton *event, RS_BLOB *rs);
 
 GdkPixmap *blitter = NULL;
-GdkCursor *cur_fleur;
-GdkCursor *cur_watch;
+static GdkCursor *cur_fleur;
+static GdkCursor *cur_watch;
 GdkCursor *cur_normal;
 GdkCursor *cur_n;
 GdkCursor *cur_e;
@@ -47,7 +48,7 @@ GdkCursor *cur_sw;
 GdkCursor *cur_sw;
 GdkCursor *cur_pencil;
 
-gboolean
+static gboolean
 drawingarea_expose (GtkWidget *widget, GdkEventExpose *event, RS_BLOB *rs)
 {
 	GtkAdjustment *vadj;
@@ -62,7 +63,7 @@ drawingarea_expose (GtkWidget *widget, G
 	return(TRUE);
 }
 
-gboolean
+static gboolean
 drawingarea_configure (GtkWidget *widget, GdkEventExpose *event, RS_BLOB *rs)
 {
 	if (rs->preview_backing)
@@ -80,7 +81,7 @@ drawingarea_configure (GtkWidget *widget
 	return(FALSE);
 }
 
-gboolean
+static gboolean
 gui_drawingarea_motion_callback(GtkWidget *widget, GdkEventMotion *event, RS_BLOB *rs)
 {
 	gint x = (gint) event->x;
@@ -90,7 +91,7 @@ gui_drawingarea_motion_callback(GtkWidge
 	return(FALSE);
 }
 
-gboolean
+static gboolean
 gui_drawingarea_move_callback(GtkWidget *widget, GdkEventMotion *event, RS_BLOB *rs)
 {
 	GtkAdjustment *vadj;
@@ -152,7 +153,7 @@ gui_drawingarea_popup_unstraighten(GtkMe
 	return;
 }
 
-gboolean
+static gboolean
 gui_drawingarea_button(GtkWidget *widget, GdkEventButton *event, RS_BLOB *rs)
 {
 	static gint operation = OP_NONE;
@@ -233,7 +234,7 @@ gui_drawingarea_button(GtkWidget *widget
 }
 
 /* hack to resize a bit nicer */
-gboolean
+static gboolean
 zoom_to_fit_helper(RS_BLOB *rs)
 {
 	if (gtk_events_pending())
@@ -245,7 +246,7 @@ zoom_to_fit_helper(RS_BLOB *rs)
 	}
 }
 
-void
+static void
 gui_scroller_size(GtkWidget *widget, GtkAllocation *allocation, RS_BLOB *rs)
 {
 	rs->preview_width = allocation->width;
diff -r a9de2785421d -r 94b3505c6fdc src/drawingarea.h
--- a/src/drawingarea.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/drawingarea.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,4 +17,21 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-GtkWidget *gui_drawingarea_make(RS_BLOB *rs);
+#ifndef DRAWINGAREA_H
+#define DRAWINGAREA_H
+
+extern GtkWidget *gui_drawingarea_make(RS_BLOB *rs);
+
+extern GdkPixmap *blitter;
+extern GdkCursor *cur_normal;
+extern GdkCursor *cur_n;
+extern GdkCursor *cur_e;
+extern GdkCursor *cur_s;
+extern GdkCursor *cur_w;
+extern GdkCursor *cur_nw;
+extern GdkCursor *cur_ne;
+extern GdkCursor *cur_se;
+extern GdkCursor *cur_sw;
+extern GdkCursor *cur_pencil;
+
+#endif /* DRAWINGAREA_H */
diff -r a9de2785421d -r 94b3505c6fdc src/filename.c
--- a/src/filename.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/filename.c	Wed Jan 03 14:24:23 2007 +0100
@@ -23,6 +23,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "rawstudio.h"
+#include "filename.h"
 
 gchar *
 filename_parse(gchar *in, RS_PHOTO *photo)
diff -r a9de2785421d -r 94b3505c6fdc src/filename.h
--- a/src/filename.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/filename.h	Wed Jan 03 14:24:23 2007 +0100
@@ -16,5 +16,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
+#ifndef FILENAME_H
+#define FILENAME_H
  
-gchar* filename_parse(gchar *in, RS_PHOTO *photo);
+extern gchar* filename_parse(gchar *in, RS_PHOTO *photo);
+
+#endif
diff -r a9de2785421d -r 94b3505c6fdc src/gtk-helper.c
--- a/src/gtk-helper.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/gtk-helper.c	Wed Jan 03 14:24:23 2007 +0100
@@ -35,7 +35,7 @@ static void gui_cms_di_profile_button_cl
 static void gui_cms_di_profile_button_clicked(GtkButton *button, gpointer user_data);
 static void gui_cms_ex_profile_button_clicked(GtkButton *button, gpointer user_data);
 
-gchar *color_profiles[] = {
+static gchar *color_profiles[] = {
 	"*.icc", 
 	"*.icm", 
 	"*.ICC", 
@@ -64,7 +64,7 @@ gui_filetype_combobox_get_ext(GtkComboBo
 }
 
 GtkWidget *
-gui_filetype_combobox()
+gui_filetype_combobox(void)
 {
 	extern RS_FILETYPE *filetypes;
 	RS_FILETYPE *filetype = filetypes;
@@ -247,7 +247,7 @@ gui_export_filename_entry_changed(GtkCom
 	return;
 }
 
-void
+static void
 cms_enable_toggled(GtkToggleButton *togglebutton, gpointer user_data)
 {
 	RS_BLOB *rs = (RS_BLOB *) user_data;
@@ -258,7 +258,7 @@ cms_enable_toggled(GtkToggleButton *togg
 	return;
 }
 
-void
+static void
 gui_cms_in_profile_combobox_changed(GtkComboBox *combobox, gpointer user_data)
 {
 	RS_BLOB *rs = (RS_BLOB *) user_data;
@@ -284,7 +284,7 @@ gui_cms_in_profile_combobox_changed(GtkC
 	return;
 }
 
-void
+static void
 gui_cms_di_profile_combobox_changed(GtkComboBox *combobox, gpointer user_data)
 {
 	RS_BLOB *rs = (RS_BLOB *) user_data;
@@ -310,7 +310,7 @@ gui_cms_di_profile_combobox_changed(GtkC
 	return;
 }
 
-void
+static void
 gui_cms_ex_profile_combobox_changed(GtkComboBox *combobox, gpointer user_data)
 {
 	RS_BLOB *rs = (RS_BLOB *) user_data;
@@ -344,7 +344,7 @@ gui_cms_ex_profile_combobox_changed(GtkC
 	return;
 }
 
-void
+static void
 gui_cms_intent_combobox_changed(GtkComboBox *combobox, gpointer user_data)
 {
 	RS_BLOB *rs = (RS_BLOB *) user_data;
@@ -356,7 +356,7 @@ gui_cms_intent_combobox_changed(GtkCombo
 	return;
 }
 
-gchar *
+static gchar *
 gui_cms_choose_profile(const gchar *path)
 {
 	gchar *ret = NULL;
@@ -419,7 +419,7 @@ gui_cms_choose_profile(const gchar *path
 	return(ret);
 }
 
-void
+static void
 gui_cms_in_profile_button_clicked(GtkButton *button, gpointer user_data)
 {
 	GtkWidget *combobox = GTK_WIDGET(user_data);
@@ -437,7 +437,7 @@ gui_cms_in_profile_button_clicked(GtkBut
 	return;
 }
 
-void
+static void
 gui_cms_di_profile_button_clicked(GtkButton *button, gpointer user_data)
 {
 	GtkWidget *combobox = GTK_WIDGET(user_data);
@@ -455,7 +455,7 @@ gui_cms_di_profile_button_clicked(GtkBut
 	return;
 }
 
-void
+static void
 gui_cms_ex_profile_button_clicked(GtkButton *button, gpointer user_data)
 {
 	GtkWidget *combobox = GTK_WIDGET(user_data);
diff -r a9de2785421d -r 94b3505c6fdc src/gtk-helper.h
--- a/src/gtk-helper.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/gtk-helper.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,19 +17,24 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-RS_FILETYPE *gui_filetype_combobox_get_filetype(GtkComboBox *widget);
-const gchar *gui_filetype_combobox_get_ext(GtkComboBox *widget);
-GtkWidget *gui_filetype_combobox();
-void gui_filetype_combobox_set_active(GtkWidget *combo, RS_FILETYPE *set);
-GtkWidget *gui_filetype_preference(GtkWidget *filetype_combo);
-void checkbox_set_conf(GtkToggleButton *togglebutton, gpointer user_data);
-GtkWidget *checkbox_from_conf(const gchar *conf, gchar *label, gboolean default_value);
-GtkWidget *gui_tooltip_no_window(GtkWidget *widget, gchar *tip_tip, gchar *tip_private);
-void gui_tooltip_window(GtkWidget *widget, gchar *tip_tip, gchar *tip_private);
-void gui_batch_directory_entry_changed(GtkEntry *entry, gpointer user_data);
-void gui_batch_filename_entry_changed(GtkEntry *entry, gpointer user_data);
-void gui_batch_filetype_entry_changed(GtkEntry *entry, gpointer user_data);
-void gui_export_changed_helper(GtkLabel *label);
-void gui_export_directory_entry_changed(GtkEntry *entry, gpointer user_data);
-void gui_export_filename_entry_changed(GtkComboBox *combobox, gpointer user_data);
-GtkWidget *gui_preferences_make_cms_page();
+#ifndef GTK_HELPER_H
+#define GTK_HELPER_H
+
+extern RS_FILETYPE *gui_filetype_combobox_get_filetype(GtkComboBox *widget);
+extern const gchar *gui_filetype_combobox_get_ext(GtkComboBox *widget);
+extern GtkWidget *gui_filetype_combobox();
+extern void gui_filetype_combobox_set_active(GtkWidget *combo, RS_FILETYPE *set);
+extern GtkWidget *gui_filetype_preference(GtkWidget *filetype_combo);
+extern void checkbox_set_conf(GtkToggleButton *togglebutton, gpointer user_data);
+extern GtkWidget *checkbox_from_conf(const gchar *conf, gchar *label, gboolean default_value);
+extern GtkWidget *gui_tooltip_no_window(GtkWidget *widget, gchar *tip_tip, gchar *tip_private);
+extern void gui_tooltip_window(GtkWidget *widget, gchar *tip_tip, gchar *tip_private);
+extern void gui_batch_directory_entry_changed(GtkEntry *entry, gpointer user_data);
+extern void gui_batch_filename_entry_changed(GtkEntry *entry, gpointer user_data);
+extern void gui_batch_filetype_entry_changed(GtkEntry *entry, gpointer user_data);
+extern void gui_export_changed_helper(GtkLabel *label);
+extern void gui_export_directory_entry_changed(GtkEntry *entry, gpointer user_data);
+extern void gui_export_filename_entry_changed(GtkComboBox *combobox, gpointer user_data);
+extern GtkWidget *gui_preferences_make_cms_page(RS_BLOB *rs);
+
+#endif /* GTK_HELPER_H */
diff -r a9de2785421d -r 94b3505c6fdc src/gtk-interface.c
--- a/src/gtk-interface.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/gtk-interface.c	Wed Jan 03 14:24:23 2007 +0100
@@ -76,7 +76,7 @@ static gint busycount = 0;
 static gint busycount = 0;
 static GtkWidget *valuefield;
 static gulong counthandler=0;
-GtkWidget *hbox;
+static GtkWidget *hbox;
 GdkGC *dashed;
 GdkGC *grid;
 
@@ -144,7 +144,7 @@ gui_set_busy(gboolean rawstudio_is_busy)
 }
 
 gboolean
-gui_is_busy()
+gui_is_busy(void)
 {
 	if (busycount)
 		return(TRUE);
@@ -152,7 +152,7 @@ gui_is_busy()
 		return(FALSE);
 }
 
-gboolean
+static gboolean
 gui_statusbar_remove_helper(guint *msgid)
 {
 	gtk_statusbar_remove(statusbar, gtk_statusbar_get_context_id(statusbar, "generic"), *msgid);
@@ -286,7 +286,7 @@ void update_histogram(RS_BLOB *rs)
 
 }
 
-gint
+static gint
 fill_model_compare_func (GtkTreeModel *model, GtkTreeIter *tia,
 	GtkTreeIter *tib, gpointer userdata)
 {
@@ -301,7 +301,7 @@ fill_model_compare_func (GtkTreeModel *m
 	return(ret);
 }
 
-void
+static void
 fill_model(GtkListStore *store, const gchar *inpath)
 {
 	static gchar *path=NULL;
@@ -319,10 +319,11 @@ fill_model(GtkListStore *store, const gc
 	gint items=0, n;
 	GtkTreePath *treepath;
 	guint msgid;
+	GdkPixbuf *missing_thumb;
 	if (locked == TRUE)
 		return;
 	locked = TRUE;
-	GdkPixbuf *missing_thumb = gtk_widget_render_icon(GTK_WIDGET(rawstudio_window),
+	missing_thumb = gtk_widget_render_icon(GTK_WIDGET(rawstudio_window),
 		GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_DIALOG, NULL);
 
 	if (inpath)
@@ -431,7 +432,7 @@ fill_model(GtkListStore *store, const gc
 	locked = FALSE;
 }
 
-void
+static void
 icon_activated_helper(GtkIconView *iconview, GtkTreePath *path, gpointer user_data)
 {
 	gchar *name;
@@ -447,7 +448,7 @@ icon_activated_helper(GtkIconView *iconv
 	}
 }
 
-void
+static void
 icon_activated(GtkIconView *iconview, RS_BLOB *rs)
 {
 	GtkTreeModel *model;
@@ -463,6 +464,7 @@ icon_activated(GtkIconView *iconview, RS
 	gtk_icon_view_selected_foreach(iconview, icon_activated_helper, &name);
 	if (name!=NULL)
 	{
+		GString *window_title;
 		gui_set_busy(TRUE);
 		msgid = gui_status_push(_("Opening image ..."));
 		GUI_CATCHUP();
@@ -559,7 +561,7 @@ icon_activated(GtkIconView *iconview, RS
 		update_previewtable_callback(NULL, rs);
 		gui_status_pop(msgid);
 		gui_status_notify(_("Image opened"));
-		GString *window_title = g_string_new(_("Rawstudio"));
+		window_title = g_string_new(_("Rawstudio"));
 		g_string_append(window_title, " - ");
 		g_string_append(window_title, rs->photo->filename);
 		gtk_window_set_title(GTK_WINDOW(rawstudio_window), window_title->str);
@@ -606,7 +608,7 @@ gui_tree_filter_helper(GtkTreeModel *mod
 	return(FALSE);
 }
 
-GtkWidget *
+static GtkWidget *
 make_iconview(RS_BLOB *rs, GtkWidget *iconview, GtkListStore *store, gint prio)
 {
 	GtkWidget *scroller;
@@ -625,7 +627,7 @@ make_iconview(RS_BLOB *rs, GtkWidget *ic
 	return(scroller);
 }
 
-void
+static void
 gui_icon_notebook_callback(GtkNotebook *notebook, GtkNotebookPage *page,
 	guint page_num, gpointer date)
 {
@@ -634,7 +636,7 @@ gui_icon_notebook_callback(GtkNotebook *
 	return;
 }
 
-void
+static void
 gui_icon_count_priorities_callback(GtkTreeModel *treemodel,
 	GtkTreePath *do_not_use1, GtkTreeIter *do_not_use2, gpointer data)
 {
@@ -701,7 +703,7 @@ gui_icon_count_priorities_callback(GtkTr
 	return;
 }
 
-GtkWidget *
+static GtkWidget *
 make_iconbox(RS_BLOB *rs, GtkListStore *store)
 {
 	GtkWidget *notebook;
@@ -786,7 +788,7 @@ make_iconbox(RS_BLOB *rs, GtkListStore *
 	return(notebook);
 }
 
-void
+static void
 gui_menu_open_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkWidget *fc;
@@ -818,7 +820,7 @@ gui_menu_open_callback(gpointer callback
 	return;
 }
 
-void
+static void
 gui_menu_reload_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkListStore *store = (GtkListStore *)((struct rs_callback_data_t *)callback_data)->specific;
@@ -826,7 +828,7 @@ gui_menu_reload_callback(gpointer callba
 	return;
 }
 
-void
+static void
 gui_menu_purge_d_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkTreeModel *model;
@@ -920,7 +922,7 @@ gui_menu_purge_d_callback(gpointer callb
 	return;
 }
 
-void
+static void
 gui_preview_bg_color_changed(GtkColorButton *widget, RS_BLOB *rs)
 {
 	GdkColor color;
@@ -931,7 +933,7 @@ gui_preview_bg_color_changed(GtkColorBut
 	return;
 }
 
-gboolean
+static gboolean
 gui_fullscreen_callback(GtkWidget *widget, GdkEventWindowState *event, GtkWidget *iconbox)
 {
 	if (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)
@@ -947,7 +949,7 @@ gui_fullscreen_callback(GtkWidget *widge
 	return(FALSE);
 }
 
-gboolean
+static gboolean
 gui_menu_prevnext_helper(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
 {
 	struct nextprev_helper *helper = user_data;
@@ -985,7 +987,7 @@ gui_menu_prevnext_helper(GtkTreeModel *m
     return FALSE;
 }
 
-void
+static void
 gui_menu_zoom_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1013,7 +1015,7 @@ gui_menu_zoom_callback(gpointer callback
 	return;
 }
 
-void
+static void
 gui_menu_prevnext_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkTreeModel *model;
@@ -1056,7 +1058,7 @@ gui_menu_prevnext_callback(gpointer call
 	return;
 }
 
-void
+static void
 gui_setprio(RS_BLOB *rs, guint prio)
 {
 	GtkTreeModel *model;
@@ -1073,7 +1075,7 @@ gui_setprio(RS_BLOB *rs, guint prio)
 	}
 }
 
-gboolean
+static gboolean
 gui_accel_setprio_callback(GtkAccelGroup *group, GObject *obj, guint keyval,
 	GdkModifierType mod, gpointer user_data)
 {
@@ -1084,7 +1086,7 @@ gui_accel_setprio_callback(GtkAccelGroup
 	return(TRUE);
 }
 
-void
+static void
 gui_menu_setprio_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1092,7 +1094,7 @@ gui_menu_setprio_callback(gpointer callb
 	return;
 }
 
-void
+static void
 gui_menu_crop_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1100,7 +1102,7 @@ gui_menu_crop_callback(gpointer callback
 	return;
 }
 
-void
+static void
 gui_menu_uncrop_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1108,7 +1110,7 @@ gui_menu_uncrop_callback(gpointer callba
 	return;
 }
 
-void
+static void
 gui_menu_widget_visible_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkWidget *target = (GtkWidget *)((struct rs_callback_data_t*)callback_data)->specific;
@@ -1120,7 +1122,7 @@ gui_menu_widget_visible_callback(gpointe
 	return;
 }
 
-void
+static void
 gui_menu_fullscreen_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkWindow * window = (GtkWindow *)((struct rs_callback_data_t*)callback_data)->specific;
@@ -1131,7 +1133,7 @@ gui_menu_fullscreen_callback(gpointer ca
 	return;
 }
 
-gboolean
+static gboolean
 gui_histogram_height_changed(GtkAdjustment *caller, RS_BLOB *rs)
 {
 	GdkPixbuf *pixbuf;
@@ -1143,7 +1145,7 @@ gui_histogram_height_changed(GtkAdjustme
 	return(FALSE);
 }
 
-void
+static void
 gui_export_filetype_combobox_changed(GtkWidget *widget, gpointer user_data)
 {
 	GtkTreeIter iter;
@@ -1160,7 +1162,7 @@ gui_export_filetype_combobox_changed(Gtk
 	return;
 }
 
-void
+static void
 gui_menu_preference_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkWidget *dialog;
@@ -1422,7 +1424,9 @@ gui_menu_preference_callback(gpointer ca
 	return;
 }
 
-void
+#if 0
+
+static void
 gui_menu_batch_run_queue_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1436,7 +1440,7 @@ gui_menu_batch_run_queue_callback(gpoint
 	return;
 }
 
-void
+static void
 gui_menu_add_to_batch_queue_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1449,7 +1453,7 @@ gui_menu_add_to_batch_queue_callback(gpo
 	}
 }
 
-void
+static void
 gui_menu_remove_from_batch_queue_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1462,7 +1466,7 @@ gui_menu_remove_from_batch_queue_callbac
 	}
 }
 
-void
+static void
 gui_menu_add_view_to_batch_queue_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	GtkTreeModel *model;
@@ -1485,8 +1489,10 @@ gui_menu_add_view_to_batch_queue_callbac
 	return;
 }
 
-void
-gui_about()
+#endif /* 0 */
+
+static void
+gui_about(void)
 {
 	const gchar *authors[] = {
 		"Anders Brander <anders at brander.dk>",
@@ -1524,7 +1530,7 @@ gui_dialog_simple(gchar *title, gchar *m
 	return;
 }
 
-void
+static void
 gui_menu_auto_wb_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1535,7 +1541,7 @@ gui_menu_auto_wb_callback(gpointer callb
 	gui_set_busy(FALSE);
 }
 
-void
+static void
 gui_menu_cam_wb_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1548,7 +1554,7 @@ gui_menu_cam_wb_callback(gpointer callba
 	}
 }
 
-void
+static void
 gui_save_file_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1556,7 +1562,7 @@ gui_save_file_callback(gpointer callback
 	return;
 }
 
-void
+static void
 gui_quick_save_file_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1625,7 +1631,7 @@ gui_quick_save_file_callback(gpointer ca
 	return;
 }
 
-void
+static void
 gui_reset_current_settings_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1638,7 +1644,7 @@ gui_reset_current_settings_callback(gpoi
 	return;
 }
 
-void
+static void
 gui_menu_quit(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1651,7 +1657,7 @@ gui_menu_quit(gpointer callback_data, gu
 	return;
 }
 
-void
+static void
 gui_menu_show_exposure_mask_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1664,7 +1670,7 @@ gui_menu_show_exposure_mask_callback(gpo
 	return;
 }
 
-void
+static void
 gui_menu_revert_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1684,7 +1690,7 @@ gui_menu_revert_callback(gpointer callba
 	return;
 }
 
-void
+static void
 gui_menu_copy_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1699,7 +1705,7 @@ gui_menu_copy_callback(gpointer callback
 	return;
 }
 
-void
+static void
 gui_menu_paste_callback(gpointer callback_data, guint callback_action, GtkWidget *widget)
 {
 	RS_BLOB *rs = (RS_BLOB *)((struct rs_callback_data_t*)callback_data)->rs;
@@ -1783,60 +1789,60 @@ gui_menu_paste_callback(gpointer callbac
 	return;
 }
 
-GtkWidget *
+static GtkWidget *
 gui_make_menubar(RS_BLOB *rs, GtkWidget *window, GtkListStore *store, GtkWidget *iconbox, GtkWidget *toolbox)
 {
 	struct menu_item_t menu_items[] = {
 		{{ _("/_File"), NULL, NULL, 0, "<Branch>"}, NULL},
-		{{ _("/File/_Open directory..."), "<CTRL>O", gui_menu_open_callback, 1, "<StockItem>", GTK_STOCK_OPEN}, (gpointer)store},
-		{{ _("/File/_Export"), "<CTRL>S", gui_quick_save_file_callback, 1, "<StockItem>", GTK_STOCK_SAVE}, (gpointer)store},
-		{{ _("/File/_Export as..."), "<CTRL><SHIFT>S", gui_save_file_callback, 1, "<StockItem>", GTK_STOCK_SAVE_AS}, (gpointer)store},
-		{{ _("/File/_Reload"), "<CTRL>R", gui_menu_reload_callback, 1, "<StockItem>", GTK_STOCK_REFRESH}, (gpointer)store},
-		{{ _("/File/_Delete flagged photos"), "<CTRL><SHIFT>D", gui_menu_purge_d_callback, 0, "<StockItem>", GTK_STOCK_DELETE}, NULL},
-		{{ _("/File/_Quit"), "<CTRL>Q", gui_menu_quit, 0, "<StockItem>", GTK_STOCK_QUIT}, NULL},
+		{{ _("/File/_Open directory..."), "<CTRL>O", (gpointer)&gui_menu_open_callback, 1, "<StockItem>", GTK_STOCK_OPEN}, (gpointer)store},
+		{{ _("/File/_Export"), "<CTRL>S", (gpointer)&gui_quick_save_file_callback, 1, "<StockItem>", GTK_STOCK_SAVE}, (gpointer)store},
+		{{ _("/File/_Export as..."), "<CTRL><SHIFT>S", (gpointer)&gui_save_file_callback, 1, "<StockItem>", GTK_STOCK_SAVE_AS}, (gpointer)store},
+		{{ _("/File/_Reload"), "<CTRL>R", (gpointer)&gui_menu_reload_callback, 1, "<StockItem>", GTK_STOCK_REFRESH}, (gpointer)store},
+		{{ _("/File/_Delete flagged photos"), "<CTRL><SHIFT>D", (gpointer)&gui_menu_purge_d_callback, 0, "<StockItem>", GTK_STOCK_DELETE}, NULL},
+		{{ _("/File/_Quit"), "<CTRL>Q", (gpointer)&gui_menu_quit, 0, "<StockItem>", GTK_STOCK_QUIT}, NULL},
 		{{ _("/_Edit"), NULL, NULL, 0, "<Branch>"}, NULL},
-		{{ _("/_Edit/_Revert settings"),  "<CTRL>Z", gui_menu_revert_callback, 0, "<StockItem>", GTK_STOCK_UNDO}, NULL},
-		{{ _("/_Edit/_Copy settings"),  "<CTRL>C", gui_menu_copy_callback, 0, "<StockItem>", GTK_STOCK_COPY}, NULL},
-		{{ _("/_Edit/_Paste settings"),  "<CTRL>V", gui_menu_paste_callback, 0, "<StockItem>", GTK_STOCK_PASTE}, NULL},
-		{{ _("/_Edit/_Reset current settings"), NULL , gui_reset_current_settings_callback, 1}, (gpointer)store},
+		{{ _("/_Edit/_Revert settings"),  "<CTRL>Z", (gpointer)&gui_menu_revert_callback, 0, "<StockItem>", GTK_STOCK_UNDO}, NULL},
+		{{ _("/_Edit/_Copy settings"),  "<CTRL>C", (gpointer)&gui_menu_copy_callback, 0, "<StockItem>", GTK_STOCK_COPY}, NULL},
+		{{ _("/_Edit/_Paste settings"),  "<CTRL>V", (gpointer)&gui_menu_paste_callback, 0, "<StockItem>", GTK_STOCK_PASTE}, NULL},
+		{{ _("/_Edit/_Reset current settings"), NULL , (gpointer)&gui_reset_current_settings_callback, 1}, (gpointer)store},
 		{{ _("/_Edit/sep1"), NULL, NULL, 0, "<Separator>"}, NULL},
-		{{ _("/_Edit/_Flag photo for deletion"),  "Delete", gui_menu_setprio_callback, PRIO_D, "<StockItem>", GTK_STOCK_DELETE}, NULL},
-		{{ _("/_Edit/_Set priority/_1"),  "1", gui_menu_setprio_callback, PRIO_1}, NULL},
-		{{ _("/_Edit/_Set priority/_2"),  "2", gui_menu_setprio_callback, PRIO_2}, NULL},
-		{{ _("/_Edit/_Set priority/_3"),  "3", gui_menu_setprio_callback, PRIO_3}, NULL},
-		{{ _("/_Edit/_Set priority/_Remove priority"),  "0", gui_menu_setprio_callback, PRIO_U}, NULL},
-		{{ _("/_Edit/_White balance/_Auto"), "A", gui_menu_auto_wb_callback, 0 }, NULL},
-		{{ _("/_Edit/_White balance/_Camera"), "C", gui_menu_cam_wb_callback, 0 }, NULL},
-		{{ _("/_Edit/_Crop"),  "<Shift>C", gui_menu_crop_callback, PRIO_U}, NULL},
-		{{ _("/_Edit/_Uncrop"),  "<Shift>V", gui_menu_uncrop_callback, PRIO_U}, NULL},
+		{{ _("/_Edit/_Flag photo for deletion"),  "Delete", (gpointer)&gui_menu_setprio_callback, PRIO_D, "<StockItem>", GTK_STOCK_DELETE}, NULL},
+		{{ _("/_Edit/_Set priority/_1"),  "1", (gpointer)&gui_menu_setprio_callback, PRIO_1}, NULL},
+		{{ _("/_Edit/_Set priority/_2"),  "2", (gpointer)&gui_menu_setprio_callback, PRIO_2}, NULL},
+		{{ _("/_Edit/_Set priority/_3"),  "3", (gpointer)&gui_menu_setprio_callback, PRIO_3}, NULL},
+		{{ _("/_Edit/_Set priority/_Remove priority"),  "0", (gpointer)&gui_menu_setprio_callback, PRIO_U}, NULL},
+		{{ _("/_Edit/_White balance/_Auto"), "A", (gpointer)&gui_menu_auto_wb_callback, 0 }, NULL},
+		{{ _("/_Edit/_White balance/_Camera"), "C", (gpointer)&gui_menu_cam_wb_callback, 0 }, NULL},
+		{{ _("/_Edit/_Crop"),  "<Shift>C", (gpointer)&gui_menu_crop_callback, PRIO_U}, NULL},
+		{{ _("/_Edit/_Uncrop"),  "<Shift>V", (gpointer)&gui_menu_uncrop_callback, PRIO_U}, NULL},
 		{{ _("/_Edit/sep2"), NULL, NULL, 0, "<Separator>"}, NULL},
-		{{ _("/_Edit/_Preferences"), NULL, gui_menu_preference_callback, 0, "<StockItem>", GTK_STOCK_PREFERENCES}, NULL},
+		{{ _("/_Edit/_Preferences"), NULL, (gpointer)&gui_menu_preference_callback, 0, "<StockItem>", GTK_STOCK_PREFERENCES}, NULL},
 		{{ _("/_View"), NULL, NULL, 0, "<Branch>"}, NULL},
-		{{ _("/_View/_Previous image"), "<CTRL>Left", gui_menu_prevnext_callback, 1, "<StockItem>", GTK_STOCK_GO_BACK}, NULL},
-		{{ _("/_View/_Next image"), "<CTRL>Right", gui_menu_prevnext_callback, 2, "<StockItem>", GTK_STOCK_GO_FORWARD}, NULL},
+		{{ _("/_View/_Previous image"), "<CTRL>Left", (gpointer)&gui_menu_prevnext_callback, 1, "<StockItem>", GTK_STOCK_GO_BACK}, NULL},
+		{{ _("/_View/_Next image"), "<CTRL>Right", (gpointer)&gui_menu_prevnext_callback, 2, "<StockItem>", GTK_STOCK_GO_FORWARD}, NULL},
 		{{ _("/_View/sep1"), NULL, NULL, 0, "<Separator>"}, NULL},
-		{{ _("/_View/_Zoom in"), "plus", gui_menu_zoom_callback, 1, "<StockItem>", GTK_STOCK_ZOOM_IN}, NULL},
-		{{ _("/_View/_Zoom out"), "minus", gui_menu_zoom_callback, 2, "<StockItem>", GTK_STOCK_ZOOM_OUT}, NULL},
-		{{ _("/_View/_Zoom to fit"), "slash", gui_menu_zoom_callback, 0, "<StockItem>", GTK_STOCK_ZOOM_FIT}, NULL},
-		{{ _("/_View/_Zoom to 100%"), "asterisk", gui_menu_zoom_callback, 100, "<StockItem>", GTK_STOCK_ZOOM_100}, NULL},
+		{{ _("/_View/_Zoom in"), "plus", (gpointer)&gui_menu_zoom_callback, 1, "<StockItem>", GTK_STOCK_ZOOM_IN}, NULL},
+		{{ _("/_View/_Zoom out"), "minus", (gpointer)&gui_menu_zoom_callback, 2, "<StockItem>", GTK_STOCK_ZOOM_OUT}, NULL},
+		{{ _("/_View/_Zoom to fit"), "slash", (gpointer)&gui_menu_zoom_callback, 0, "<StockItem>", GTK_STOCK_ZOOM_FIT}, NULL},
+		{{ _("/_View/_Zoom to 100%"), "asterisk", (gpointer)&gui_menu_zoom_callback, 100, "<StockItem>", GTK_STOCK_ZOOM_100}, NULL},
 		{{ _("/_View/sep2"), NULL, NULL, 0, "<Separator>"}, NULL},
-		{{ _("/_View/_Icon Box"), "<CTRL>I", gui_menu_widget_visible_callback, 1}, (gpointer)iconbox},
-		{{ _("/_View/_Tool Box"), "<CTRL>T", gui_menu_widget_visible_callback, 1}, (gpointer)toolbox},
+		{{ _("/_View/_Icon Box"), "<CTRL>I", (gpointer)&gui_menu_widget_visible_callback, 1}, (gpointer)iconbox},
+		{{ _("/_View/_Tool Box"), "<CTRL>T", (gpointer)&gui_menu_widget_visible_callback, 1}, (gpointer)toolbox},
 		{{ _("/_View/sep3"), NULL, NULL, 0, "<Separator>"}, NULL},
 #if GTK_CHECK_VERSION(2,8,0)
-		{{ _("/_View/_Fullscreen"), "F11", gui_menu_fullscreen_callback, 1, "<StockItem>", GTK_STOCK_FULLSCREEN}, (gpointer)window},
+		{{ _("/_View/_Fullscreen"), "F11", (gpointer)&gui_menu_fullscreen_callback, 1, "<StockItem>", GTK_STOCK_FULLSCREEN}, (gpointer)window},
 #else
-		{{ _("/_View/_Fullscreen"), "F11", gui_menu_fullscreen_callback, 1}, (gpointer)window},
+		{{ _("/_View/_Fullscreen"), "F11", (gpointer)&gui_menu_fullscreen_callback, 1}, (gpointer)window},
 #endif
 		{{ _("/_View/sep1"), NULL, NULL, 0, "<Separator>"}, NULL},
-		{{ _("/_View/_Show exposure mask"), "<CTRL>E", gui_menu_show_exposure_mask_callback, 0, "<ToggleItem>"}, NULL},
+		{{ _("/_View/_Show exposure mask"), "<CTRL>E", (gpointer)&gui_menu_show_exposure_mask_callback, 0, "<ToggleItem>"}, NULL},
 //		{{ _("/_Batch"), NULL, NULL, 0, "<Branch>"}, NULL},
 //		{{ _("/_Batch/_Add to batch queue"),  "<CTRL>B", gui_menu_add_to_batch_queue_callback, 0 , "<StockItem>", GTK_STOCK_ADD}, NULL},
 //		{{ _("/_Batch/_Add current view to queue"), NULL, gui_menu_add_view_to_batch_queue_callback, 0 }, NULL},
 //		{{ _("/_Batch/_Remove from batch queue"),  "<CTRL><ALT>B", gui_menu_remove_from_batch_queue_callback, 0 , "<StockItem>", GTK_STOCK_REMOVE}, NULL},
 //		{{ _("/_Batch/_Run!"), NULL, gui_menu_batch_run_queue_callback, 0 }, NULL},
 		{{ _("/_Help"), NULL, NULL, 0, "<LastBranch>"}, NULL},
-		{{ _("/_Help/About"), NULL, gui_about, 0, "<StockItem>", GTK_STOCK_ABOUT}, NULL},
+		{{ _("/_Help/About"), NULL, (gpointer)&gui_about, 0, "<StockItem>", GTK_STOCK_ABOUT}, NULL},
 	};
 	static gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
 	GtkItemFactory *item_factory;
@@ -1883,7 +1889,7 @@ gui_make_menubar(RS_BLOB *rs, GtkWidget 
 	return(gtk_item_factory_get_widget (item_factory, "<main>"));
 }
 
-GtkWidget *
+static GtkWidget *
 gui_window_make(RS_BLOB *rs)
 {
 	rawstudio_window = GTK_WINDOW(gtk_window_new (GTK_WINDOW_TOPLEVEL));
@@ -1908,10 +1914,10 @@ gui_dialog_make_from_text(const gchar *s
 	return(gui_dialog_make_from_widget(stock_id, primary_text, secondary_label));
 }
 
-GtkWidget *
+static GtkWidget *
 gui_dialog_make_from_widget(const gchar *stock_id, gchar *primary_text, GtkWidget *widget)
 {
-	GtkWidget *dialog, *image, *hbox, *vbox;
+	GtkWidget *dialog, *image, *hhbox, *vvbox;
 	GtkWidget *primary_label;
 	gchar *str;
 
@@ -1935,14 +1941,14 @@ gui_dialog_make_from_widget(const gchar 
 	gtk_label_set_markup (GTK_LABEL (primary_label), str);
 	g_free(str);
 
-	hbox = gtk_hbox_new (FALSE, 12);
-	gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
-	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
-	vbox = gtk_vbox_new (FALSE, 12);
-	gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (vbox), primary_label, FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
+	hhbox = gtk_hbox_new (FALSE, 12);
+	gtk_container_set_border_width (GTK_CONTAINER (hhbox), 5);
+	gtk_box_pack_start (GTK_BOX (hhbox), image, FALSE, FALSE, 0);
+	vvbox = gtk_vbox_new (FALSE, 12);
+	gtk_box_pack_start (GTK_BOX (hhbox), vvbox, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (vvbox), primary_label, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (vvbox), widget, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hhbox, FALSE, FALSE, 0);
 
 	return(dialog);
 }
diff -r a9de2785421d -r 94b3505c6fdc src/gtk-interface.h
--- a/src/gtk-interface.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/gtk-interface.h	Wed Jan 03 14:24:23 2007 +0100
@@ -16,6 +16,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
+#ifndef GTK_INTERFACE_H
+#define GTK_INTERFACE_H
 
 enum { 
 	PIXBUF_COLUMN,
@@ -43,16 +46,22 @@ enum {
 
 #define GUI_CATCHUP() while (gtk_events_pending()) gtk_main_iteration()
 
-void gui_set_busy(gboolean rawstudio_is_busy);
-gboolean gui_is_busy();
-void gui_status_notify(const char *text);
-guint gui_status_push(const char *text);
-void gui_status_pop(const guint msgid);
-void update_histogram(RS_BLOB *rs);
-gboolean update_preview_callback(GtkAdjustment *caller, RS_BLOB *rs);
-gboolean update_previewtable_callback(GtkAdjustment *do_not_use_this, RS_BLOB *rs);
-gboolean update_scale_callback(GtkAdjustment *do_not_use_this, RS_BLOB *rs);
-void gui_dialog_simple(gchar *title, gchar *message);
-GtkWidget *gui_dialog_make_from_text(const gchar *stock_id, gchar *primary_text, gchar *secondary_text);
-void gui_set_values(RS_BLOB *rs, gint x, gint y);
-int gui_init(int argc, char **argv, RS_BLOB *rs);
+extern void gui_set_busy(gboolean rawstudio_is_busy);
+extern gboolean gui_is_busy();
+extern void gui_status_notify(const char *text);
+extern guint gui_status_push(const char *text);
+extern void gui_status_pop(const guint msgid);
+extern void update_histogram(RS_BLOB *rs);
+extern gboolean update_preview_callback(GtkAdjustment *caller, RS_BLOB *rs);
+extern gboolean update_previewtable_callback(GtkAdjustment *do_not_use_this, RS_BLOB *rs);
+extern gboolean update_scale_callback(GtkAdjustment *do_not_use_this, RS_BLOB *rs);
+extern void gui_dialog_simple(gchar *title, gchar *message);
+extern GtkWidget *gui_dialog_make_from_text(const gchar *stock_id, gchar *primary_text, gchar *secondary_text);
+extern void gui_set_values(RS_BLOB *rs, gint x, gint y);
+extern int gui_init(int argc, char **argv, RS_BLOB *rs);
+
+extern GtkWindow *rawstudio_window;
+extern GdkGC *dashed;
+extern GdkGC *grid;
+
+#endif /* GTK_INTERFACE_H */
diff -r a9de2785421d -r 94b3505c6fdc src/gtk-save-dialog.c
--- a/src/gtk-save-dialog.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/gtk-save-dialog.c	Wed Jan 03 14:24:23 2007 +0100
@@ -83,15 +83,15 @@ filetype_changed(GtkComboBox *filetype_c
 	return;
 }
 
-void
+static void
 jpeg_quality_changed(GtkAdjustment *adjustment, gpointer user_data)
 {
 	rs_conf_set_integer(CONF_EXPORT_JPEG_QUALITY, (gint) gtk_adjustment_get_value(adjustment));
 	return;
 }
 
-GtkWidget *
-jpeg_pref_new()
+static GtkWidget *
+jpeg_pref_new(void)
 {
 	GtkObject *jpeg_quality_adj;
 	GtkWidget *jpeg_quality_label;
@@ -117,8 +117,8 @@ jpeg_pref_new()
 	return(box);
 }
 
-GtkWidget *
-tiff_pref_new()
+static GtkWidget *
+tiff_pref_new(void)
 {
 	GtkWidget *tiff_uncompressed_checkbox;
 	tiff_uncompressed_checkbox = checkbox_from_conf(
@@ -198,7 +198,7 @@ spin_set_value(GtkSpinButton *spinbutton
 	return;
 }
 
-GtkWidget *
+static GtkWidget *
 size_pref_new(RS_PHOTO *photo, gint *w, gint *h)
 {
 	GtkWidget *vbox, *hbox;
diff -r a9de2785421d -r 94b3505c6fdc src/gtk-save-dialog.h
--- a/src/gtk-save-dialog.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/gtk-save-dialog.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,4 +17,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-void gui_save_file_dialog(RS_BLOB *rs);
+#ifndef GTK_SAVE_DIALOG_H
+#define GTK_SAVE_DIALOG_H
+
+extern void gui_save_file_dialog(RS_BLOB *rs);
+
+#endif /* GTK_SAVE_DIALOG_H */
diff -r a9de2785421d -r 94b3505c6fdc src/matrix.c
--- a/src/matrix.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/matrix.c	Wed Jan 03 14:24:23 2007 +0100
@@ -54,7 +54,7 @@ matrix4_identity (RS_MATRIX4 *matrix)
   *matrix = identity;
 }
 
-void
+static void
 matrix4_multiply(const RS_MATRIX4 *left, RS_MATRIX4 *right, RS_MATRIX4 *result)
 {
   int i, j;
@@ -79,7 +79,7 @@ matrix4_multiply(const RS_MATRIX4 *left,
   *result = tmp;
 }
 
-void
+static void
 matrix4_zshear (RS_MATRIX4 *matrix, double dx, double dy)
 {
   RS_MATRIX4 zshear;
@@ -117,7 +117,7 @@ matrix4_to_matrix4int(RS_MATRIX4 *matrix
   return;
 }
 
-void
+static void
 matrix4_xrotate(RS_MATRIX4 *matrix, double rs, double rc)
 {
   RS_MATRIX4 tmp;
@@ -145,7 +145,7 @@ matrix4_xrotate(RS_MATRIX4 *matrix, doub
   matrix4_multiply(&tmp, matrix, matrix);
 }
 
-void
+static void
 matrix4_yrotate(RS_MATRIX4 *matrix, double rs, double rc)
 {
   RS_MATRIX4 tmp;
@@ -173,7 +173,7 @@ matrix4_yrotate(RS_MATRIX4 *matrix, doub
   matrix4_multiply(&tmp, matrix, matrix);
 }
 
-void
+static void
 matrix4_zrotate(RS_MATRIX4 *matrix, double rs, double rc)
 {
   RS_MATRIX4 tmp;
@@ -230,7 +230,7 @@ matrix4_color_saturate(RS_MATRIX4 *mat, 
 	matrix4_multiply(mat, &tmp, mat);
 }
 
-void
+static void
 matrix4_affine_transform_3dpoint(RS_MATRIX4 *matrix, double x, double y, double z, double *tx, double *ty, double *tz)
 {
 	*tx = x*matrix->coeff[0][0] + y*matrix->coeff[0][1]
@@ -313,7 +313,7 @@ matrix3_identity (RS_MATRIX3 *matrix)
   *matrix = identity;
 }
 
-void
+static void
 matrix3_multiply(const RS_MATRIX3 *left, RS_MATRIX3 *right, RS_MATRIX3 *result)
 {
   int i, j;
diff -r a9de2785421d -r 94b3505c6fdc src/matrix.h
--- a/src/matrix.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/matrix.h	Wed Jan 03 14:24:23 2007 +0100
@@ -27,22 +27,22 @@ typedef struct {double coeff[4][4]; } RS
 typedef struct {double coeff[4][4]; } RS_MATRIX4;
 typedef struct {int coeff[4][4]; } RS_MATRIX4Int;
 
-void printmat(RS_MATRIX4 *mat);
-void matrix4_identity (RS_MATRIX4 *matrix);
-void matrix4_to_matrix4int(RS_MATRIX4 *matrix, RS_MATRIX4Int *matrixi);
-void matrix4_color_saturate(RS_MATRIX4 *mat, double sat);
-void matrix4_color_hue(RS_MATRIX4 *mat, double rot);
-void matrix4_color_exposure(RS_MATRIX4 *mat, double exp);
-void matrix3_to_matrix3int(RS_MATRIX3 *matrix, RS_MATRIX3Int *matrixi);
-void matrix3_identity (RS_MATRIX3 *matrix);
-float matrix3_weight(const RS_MATRIX3 *mat);
-void matrix3_affine_invert(RS_MATRIX3 *mat);
-void matrix3_affine_scale(RS_MATRIX3 *matrix, double xscale, double yscale);
-void matrix3_affine_translate(RS_MATRIX3 *matrix, double xtrans, double ytrans);
-void matrix3_affine_rotate(RS_MATRIX3 *matrix, double degrees);
-inline void matrix3_affine_transform_point(RS_MATRIX3 *matrix, double x, double y, double *x2, double *y2);
-inline void matrix3_affine_transform_point_int(RS_MATRIX3 *matrix, int x, int y, int *x2, int *y2);
-void matrix3_affine_get_minmax(RS_MATRIX3 *matrix, double *minx, double *miny, double *maxx, double *maxy,
+extern void printmat(RS_MATRIX4 *mat);
+extern void matrix4_identity (RS_MATRIX4 *matrix);
+extern void matrix4_to_matrix4int(RS_MATRIX4 *matrix, RS_MATRIX4Int *matrixi);
+extern void matrix4_color_saturate(RS_MATRIX4 *mat, double sat);
+extern void matrix4_color_hue(RS_MATRIX4 *mat, double rot);
+extern void matrix4_color_exposure(RS_MATRIX4 *mat, double exp);
+extern void matrix3_to_matrix3int(RS_MATRIX3 *matrix, RS_MATRIX3Int *matrixi);
+extern void matrix3_identity (RS_MATRIX3 *matrix);
+extern float matrix3_weight(const RS_MATRIX3 *mat);
+extern void matrix3_affine_invert(RS_MATRIX3 *mat);
+extern void matrix3_affine_scale(RS_MATRIX3 *matrix, double xscale, double yscale);
+extern void matrix3_affine_translate(RS_MATRIX3 *matrix, double xtrans, double ytrans);
+extern void matrix3_affine_rotate(RS_MATRIX3 *matrix, double degrees);
+extern void matrix3_affine_transform_point(RS_MATRIX3 *matrix, double x, double y, double *x2, double *y2);
+extern void matrix3_affine_transform_point_int(RS_MATRIX3 *matrix, int x, int y, int *x2, int *y2);
+extern void matrix3_affine_get_minmax(RS_MATRIX3 *matrix, double *minx, double *miny, double *maxx, double *maxy,
 	double x1, double y1, double x2, double y2);
 
 #endif /* RS_MATRIX_H */
diff -r a9de2785421d -r 94b3505c6fdc src/mrw-meta.c
--- a/src/mrw-meta.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/mrw-meta.c	Wed Jan 03 14:24:23 2007 +0100
@@ -20,11 +20,12 @@
 #include <gtk/gtk.h>
 #include "rawstudio.h"
 #include "rawfile.h"
+#include "mrw-meta.h"
 #include "tiff-meta.h"
 
 static void raw_mrw_walker(RAWFILE *rawfile, guint offset, RS_METADATA *meta);
 
-void
+static void
 raw_mrw_walker(RAWFILE *rawfile, guint offset, RS_METADATA *meta)
 {
 	guint rawstart=0;
diff -r a9de2785421d -r 94b3505c6fdc src/mrw-meta.h
--- a/src/mrw-meta.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/mrw-meta.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,5 +17,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-void rs_mrw_load_meta(const gchar *filename, RS_METADATA *meta);
-GdkPixbuf *rs_mrw_load_thumb(const gchar *src);
+#ifndef MRW_META_H
+#define MRW_META_H
+
+extern void rs_mrw_load_meta(const gchar *filename, RS_METADATA *meta);
+extern GdkPixbuf *rs_mrw_load_thumb(const gchar *src);
+
+#endif
diff -r a9de2785421d -r 94b3505c6fdc src/rawfile.c
--- a/src/rawfile.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rawfile.c	Wed Jan 03 14:24:23 2007 +0100
@@ -34,7 +34,7 @@ const static gushort cpuorder = 0x4D4D;
 #endif
 
 void
-raw_init()
+raw_init(void)
 {
 	/* stub */
 	return;
diff -r a9de2785421d -r 94b3505c6fdc src/rawstudio.c
--- a/src/rawstudio.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rawstudio.c	Wed Jan 03 14:24:23 2007 +0100
@@ -78,7 +78,7 @@ static void rs_rect_rotate(RS_RECT *in, 
 
 RS_FILETYPE *filetypes;
 
-void
+static void
 rs_add_filetype(gchar *id, gint filetype, const gchar *ext, gchar *description,
 	RS_PHOTO *(*load)(const gchar *),
 	GdkPixbuf *(*thumb)(const gchar *),
@@ -106,8 +106,8 @@ rs_add_filetype(gchar *id, gint filetype
 	return;
 }
 
-void
-rs_init_filetypes()
+static void
+rs_init_filetypes(void)
 {
 	filetypes = NULL;
 	rs_add_filetype("cr2", FILETYPE_RAW, "cr2", _("Canon CR2"),
@@ -137,7 +137,7 @@ rs_init_filetypes()
 	return;
 }
 
-void
+static void
 make_gammatable16(gushort *table, gdouble gamma)
 {
 	gint n;
@@ -156,7 +156,7 @@ make_gammatable16(gushort *table, gdoubl
 	return;
 }
 
-void
+static void
 update_scaled(RS_BLOB *rs, gboolean force)
 {
 	/* scale if needed */
@@ -323,12 +323,12 @@ update_preview_region(RS_BLOB *rs, RS_RE
 		gint text_height;
 		static GString *text = NULL;
 		gint x1, x2, y1, y2;
+		extern GdkGC *dashed;
+		extern GdkGC *grid;
 		x1 = rs->roi_scaled.x1;
 		y1 = rs->roi_scaled.y1;
 		x2 = rs->roi_scaled.x2;
 		y2 = rs->roi_scaled.y2;
-		extern GdkGC *dashed;
-		extern GdkGC *grid;
 
 		if (unlikely(!text))
 			text = g_string_new("");
@@ -581,7 +581,7 @@ rs_run_batch_idle(RS_QUEUE *queue)
 	return(FALSE);
 }
 
-gboolean
+static gboolean
 rs_render_idle(RS_BLOB *rs)
 {
 	gint row;
@@ -633,7 +633,7 @@ rs_render_idle(RS_BLOB *rs)
 	return(FALSE);
 }
 
-void
+static void
 rs_render_overlay(RS_PHOTO *photo, gint width, gint height, gushort *in,
 	gint in_rowstride, gint in_channels, guchar *out, gint out_rowstride,
 	guchar *mask, gint mask_rowstride)
@@ -671,9 +671,9 @@ rs_reset(RS_BLOB *rs)
 rs_reset(RS_BLOB *rs)
 {
 	gboolean in_use = rs->in_use;
+	gint c;
 	rs->in_use = FALSE;
 	rs->preview_scale = 0;
-	gint c;
 	for(c=0;c<3;c++)
 		rs_settings_reset(rs->settings[c], MASK_ALL);
 	rs->in_use = in_use;
@@ -743,8 +743,8 @@ rs_settings_reset(RS_SETTINGS *rss, guin
 	return;
 }
 
-RS_SETTINGS *
-rs_settings_new()
+static RS_SETTINGS *
+rs_settings_new(void)
 {
 	RS_SETTINGS *rss;
 	rss = g_malloc(sizeof(RS_SETTINGS));
@@ -757,8 +757,8 @@ rs_settings_new()
 	return(rss);
 }
 
-RS_SETTINGS_DOUBLE
-*rs_settings_double_new()
+static RS_SETTINGS_DOUBLE
+*rs_settings_double_new(void)
 {
 	RS_SETTINGS_DOUBLE *rssd;
 	rssd = g_malloc(sizeof(RS_SETTINGS_DOUBLE));
@@ -771,7 +771,7 @@ RS_SETTINGS_DOUBLE
 	return rssd;
 }
 
-void
+static void
 rs_settings_double_free(RS_SETTINGS_DOUBLE *rssd)
 {
 	g_free(rssd);
@@ -779,7 +779,7 @@ rs_settings_double_free(RS_SETTINGS_DOUB
 }
 
 RS_METADATA *
-rs_metadata_new()
+rs_metadata_new(void)
 {
 	RS_METADATA *metadata;
 	metadata = g_malloc(sizeof(RS_METADATA));
@@ -821,7 +821,7 @@ rs_metadata_normalize_wb(RS_METADATA *me
 }
 
 RS_PHOTO *
-rs_photo_new()
+rs_photo_new(void)
 {
 	guint c;
 	RS_PHOTO *photo;
@@ -996,7 +996,7 @@ rs_photo_free(RS_PHOTO *photo)
 }
 
 RS_BLOB *
-rs_new()
+rs_new(void)
 {
 	RS_BLOB *rs;
 	guint c;
@@ -1044,7 +1044,7 @@ rs_photo_close(RS_PHOTO *photo)
 	return;
 }
 
-RS_PHOTO *
+static RS_PHOTO *
 rs_photo_open_dcraw(const gchar *filename)
 {
 	dcraw_data *raw;
@@ -1203,7 +1203,7 @@ rs_filetype_get(const gchar *filename, g
 	return(NULL);
 }
 
-RS_PHOTO *
+static RS_PHOTO *
 rs_photo_open_gdk(const gchar *filename)
 {
 	RS_PHOTO *photo=NULL;
@@ -1312,7 +1312,7 @@ rs_thumb_get_name(const gchar *src)
 	return(ret);
 }
 
-GdkPixbuf *
+static GdkPixbuf *
 rs_thumb_gdk(const gchar *src)
 {
 	GdkPixbuf *pixbuf=NULL;
@@ -1670,7 +1670,7 @@ rs_roi_orientation(RS_BLOB *rs)
 	return;
 }
 
-gboolean
+static gboolean
 rs_mark_roi_configure (GtkWidget *widget, GdkEventExpose *event, RS_BLOB *rs)
 {
 	if (rs->preview_backing_notroi)
@@ -1752,7 +1752,7 @@ rs_cms_is_profile_valid(const gchar *pat
 	return(ret);
 }
 
-gdouble
+static gdouble
 rs_cms_guess_gamma(void *transform)
 {
 	gushort buffer[27];
@@ -1868,7 +1868,7 @@ rs_cms_prepare_transforms(RS_BLOB *rs)
 	return;
 }
 
-void
+static void
 rs_cms_init(RS_BLOB *rs)
 {
 	gchar *custom_cms_in_profile;
@@ -1961,6 +1961,8 @@ int
 int
 main(int argc, char **argv)
 {
+	RS_BLOB *rs;
+
 	/* Bind default C functions */
 	rs_bind_default_functions();
 
@@ -1972,7 +1974,6 @@ main(int argc, char **argv)
 	bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
 	textdomain(GETTEXT_PACKAGE);
 #endif
-	RS_BLOB *rs;
 	rs_init_filetypes();
 	gtk_init(&argc, &argv);
 	rs = rs_new();
diff -r a9de2785421d -r 94b3505c6fdc src/rawstudio.h
--- a/src/rawstudio.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rawstudio.h	Wed Jan 03 14:24:23 2007 +0100
@@ -297,4 +297,7 @@ rs_photo_open_dcraw_apply_black_and_shif
 rs_photo_open_dcraw_apply_black_and_shift_mmx(dcraw_data *raw, RS_PHOTO *photo);
 #endif
 
+/* Contains a list of supported filetypes */
+extern RS_FILETYPE *filetypes;
+
 #endif /* RS_RAWSTUDIO_H */
diff -r a9de2785421d -r 94b3505c6fdc src/rs-batch.c
--- a/src/rs-batch.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-batch.c	Wed Jan 03 14:24:23 2007 +0100
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include "rs-batch.h"
 
-RS_QUEUE* batch_new_queue()
+RS_QUEUE* batch_new_queue(void)
 {
 	RS_QUEUE *queue;
 	queue = g_malloc(sizeof(RS_QUEUE));
diff -r a9de2785421d -r 94b3505c6fdc src/rs-cache.c
--- a/src/rs-cache.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-cache.c	Wed Jan 03 14:24:23 2007 +0100
@@ -21,6 +21,7 @@
 #include <libxml/encoding.h>
 #include <libxml/xmlwriter.h>
 #include "rawstudio.h"
+#include "rs-cache.h"
 
 static void rs_cache_load_setting(RS_SETTINGS_DOUBLE *rss, xmlDocPtr doc, xmlNodePtr cur);
 
@@ -44,16 +45,6 @@ rs_cache_get_name(const gchar *src)
 	}
 	g_free(filename);
 	return(ret);
-}
-
-void
-rs_cache_init()
-{
-	static gboolean init=FALSE;
-	if (!init)
-		LIBXML_TEST_VERSION /* yep, it should look like this */
-	init = TRUE;
-	return;
 }
 
 void
diff -r a9de2785421d -r 94b3505c6fdc src/rs-cache.h
--- a/src/rs-cache.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-cache.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,7 +17,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-gchar *rs_cache_get_name(const gchar *src);
-void rs_cache_save(RS_PHOTO *photo);
-gboolean rs_cache_load(RS_PHOTO *photo);
-void rs_cache_load_quick(const gchar *filename, gint *priority);
+#ifndef RS_CACHE_H
+#define RS_CACHE_H
+
+extern gchar *rs_cache_get_name(const gchar *src);
+extern void rs_cache_save(RS_PHOTO *photo);
+extern gboolean rs_cache_load(RS_PHOTO *photo);
+extern void rs_cache_load_quick(const gchar *filename, gint *priority);
+
+#endif /* RS_CACHE_H */
diff -r a9de2785421d -r 94b3505c6fdc src/rs-crop.c
--- a/src/rs-crop.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-crop.c	Wed Jan 03 14:24:23 2007 +0100
@@ -23,15 +23,16 @@
 #include "gtk-interface.h"
 #include "toolbox.h"
 #include "conf_interface.h"
+#include "rs-crop.h"
 
 gboolean rs_crop_motion_callback(GtkWidget *widget, GdkEventMotion *event, RS_BLOB *rs);
 gboolean rs_crop_button_callback(GtkWidget *widget, GdkEventButton *event, RS_BLOB *rs);
 gboolean rs_crop_resize_callback(GtkWidget *widget, GdkEventMotion *event, RS_BLOB *rs);
-GtkWidget * rs_crop_tool_widget();
+GtkWidget * rs_crop_tool_widget(RS_BLOB *rs);
 void gui_roi_grid_changed(GtkComboBox *combobox, gpointer user_data);
 void rs_crop_tool_widget_update(RS_BLOB *rs);
 
-gint state;
+static gint state;
 static gint motion, button_press, button_release;
 static gint start_x, start_y;
 static RS_RECT last = {0,0,0,0}; /* Initialize with more meaningfull values */
diff -r a9de2785421d -r 94b3505c6fdc src/rs-crop.h
--- a/src/rs-crop.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-crop.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,5 +17,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-void rs_crop_start(RS_BLOB *rs);
-void rs_crop_uncrop(RS_BLOB *rs);
+#ifndef RS_CROP_H
+#define RS_CROP_H
+
+extern void rs_crop_start(RS_BLOB *rs);
+extern void rs_crop_uncrop(RS_BLOB *rs);
+
+#endif
diff -r a9de2785421d -r 94b3505c6fdc src/rs-image.c
--- a/src/rs-image.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-image.c	Wed Jan 03 14:24:23 2007 +0100
@@ -33,8 +33,8 @@ static void rs_image16_rotate(RS_IMAGE16
 static void rs_image16_rotate(RS_IMAGE16 *rsi, gint quarterturns);
 static void rs_image16_mirror(RS_IMAGE16 *rsi);
 static void rs_image16_flip(RS_IMAGE16 *rsi);
-inline void rs_image16_nearest(RS_IMAGE16 *in, gushort *out, gdouble x, gdouble y);
-inline void rs_image16_bilinear(RS_IMAGE16 *in, gushort *out, gdouble x, gdouble y);
+inline static void rs_image16_nearest(RS_IMAGE16 *in, gushort *out, gdouble x, gdouble y);
+inline static void rs_image16_bilinear(RS_IMAGE16 *in, gushort *out, gdouble x, gdouble y);
 
 void
 rs_image16_orientation(RS_IMAGE16 *rsi, const gint orientation)
@@ -48,7 +48,7 @@ rs_image16_orientation(RS_IMAGE16 *rsi, 
 	return;
 }
 
-void
+static void
 rs_image16_rotate(RS_IMAGE16 *rsi, gint quarterturns)
 {
 	gint width, height, pitch;
@@ -126,7 +126,7 @@ rs_image16_rotate(RS_IMAGE16 *rsi, gint 
 	return;
 }
 
-void
+static void
 rs_image16_mirror(RS_IMAGE16 *rsi)
 {
 	gint row,col;
@@ -150,7 +150,7 @@ rs_image16_mirror(RS_IMAGE16 *rsi)
 	ORIENTATION_MIRROR(rsi->orientation);
 }
 
-void
+static void
 rs_image16_flip(RS_IMAGE16 *rsi)
 {
 	gint row;
@@ -170,7 +170,7 @@ rs_image16_flip(RS_IMAGE16 *rsi)
 	return;
 }
 
-inline void
+static void inline
 rs_image16_nearest(RS_IMAGE16 *in, gushort *out, gdouble x, gdouble y)
 {
 	const gint nx = lrint(x);
@@ -182,7 +182,7 @@ rs_image16_nearest(RS_IMAGE16 *in, gusho
 	out[G2] = a[G2];
 }
 
-inline void
+static void inline
 rs_image16_bilinear(RS_IMAGE16 *in, gushort *out, const gdouble x, const gdouble y)
 {
 	const gint fx = floor(x);
diff -r a9de2785421d -r 94b3505c6fdc src/rs-image.h
--- a/src/rs-image.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-image.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,6 +17,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+#ifndef RS_IMAGE_H
+#define RS_IMAGE_H
+
 #define rs_image16_scale(in, out, scale) rs_image16_scale_double(in, out, scale)
 
 #define IS_PIXEL_WITHIN_IMAGE(image, x, y) (((x)<(image)->w)&&((y)<(image)->h))
@@ -24,16 +27,18 @@
 (IS_PIXEL_WITHIN_IMAGE(image, rect->x1, rect->y1) \
 &&IS_PIXEL_WITHIN_IMAGE(image, rect->x2, rect->y2))
 
-RS_IMAGE16 *rs_image16_new(const guint width, const guint height, const guint channels, const guint pixelsize);
-void rs_image16_free(RS_IMAGE16 *rsi);
-RS_IMAGE8 *rs_image8_new(const guint width, const guint height, const guint channels, const guint pixelsize);
-void rs_image8_free(RS_IMAGE8 *rsi);
-void rs_image16_orientation(RS_IMAGE16 *rsi, gint orientation);
-void rs_image16_transform_getwh(RS_IMAGE16 *in, RS_RECT *crop, gdouble angle, gint orientation, gint *w, gint *h);
-RS_IMAGE16 *rs_image16_transform(RS_IMAGE16 *in, RS_IMAGE16 *out, RS_MATRIX3 *inverse_affine,
+extern RS_IMAGE16 *rs_image16_new(const guint width, const guint height, const guint channels, const guint pixelsize);
+extern void rs_image16_free(RS_IMAGE16 *rsi);
+extern RS_IMAGE8 *rs_image8_new(const guint width, const guint height, const guint channels, const guint pixelsize);
+extern void rs_image8_free(RS_IMAGE8 *rsi);
+extern void rs_image16_orientation(RS_IMAGE16 *rsi, gint orientation);
+extern void rs_image16_transform_getwh(RS_IMAGE16 *in, RS_RECT *crop, gdouble angle, gint orientation, gint *w, gint *h);
+extern RS_IMAGE16 *rs_image16_transform(RS_IMAGE16 *in, RS_IMAGE16 *out, RS_MATRIX3 *inverse_affine,
 	RS_RECT *crop, gint width, gint height, gboolean keep_aspect, gdouble scale, gdouble angle, gint orientation);
-RS_IMAGE16 *rs_image16_scale_double(RS_IMAGE16 *in, RS_IMAGE16 *out, gdouble scale);
-RS_IMAGE16 *rs_image16_copy(RS_IMAGE16 *rsi);
-void rs_image16_crop(RS_IMAGE16 **rsi, RS_RECT *rect);
-void rs_image16_uncrop(RS_IMAGE16 **image);
-gboolean rs_image16_8_cmp_size(RS_IMAGE16 *a, RS_IMAGE8 *b);
+extern RS_IMAGE16 *rs_image16_scale_double(RS_IMAGE16 *in, RS_IMAGE16 *out, gdouble scale);
+extern RS_IMAGE16 *rs_image16_copy(RS_IMAGE16 *rsi);
+extern void rs_image16_crop(RS_IMAGE16 **rsi, RS_RECT *rect);
+extern void rs_image16_uncrop(RS_IMAGE16 **image);
+extern gboolean rs_image16_8_cmp_size(RS_IMAGE16 *a, RS_IMAGE8 *b);
+
+#endif
diff -r a9de2785421d -r 94b3505c6fdc src/rs-jpeg.c
--- a/src/rs-jpeg.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-jpeg.c	Wed Jan 03 14:24:23 2007 +0100
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <jpeglib.h>
 #include "rawstudio.h"
+#include "rs-jpeg.h"
 
 /* This function is an almost verbatim copy from little cms. Thanks Marti, you rock! */
 
diff -r a9de2785421d -r 94b3505c6fdc src/rs-jpeg.h
--- a/src/rs-jpeg.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-jpeg.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,5 +17,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-gboolean rs_jpeg_save(RS_IMAGE8 *image, const gchar *filename,
+#ifndef RS_JPEG_H
+#define RS_JPEG_H
+
+extern gboolean rs_jpeg_save(RS_IMAGE8 *image, const gchar *filename,
 	const gint quality, const gchar *profile_filename);
+
+#endif
diff -r a9de2785421d -r 94b3505c6fdc src/rs-render.c
--- a/src/rs-render.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-render.c	Wed Jan 03 14:24:23 2007 +0100
@@ -23,8 +23,8 @@
 #include "rawstudio.h"
 #include "rs-render.h"
 
-guchar previewtable8[65536];
-gushort previewtable16[65536];
+static guchar previewtable8[65536];
+static gushort previewtable16[65536];
 
 /* CMS or no CMS dependant function pointers - initialized by
  * rs_render_select(bool) */
@@ -385,9 +385,9 @@ DEFINE_RENDER(rs_render_nocms_c)
 		pre_mul[x] = (gint) (photo->pre_mul[x]*128.0);
 	for(y=0 ; y<height ; y++)
 	{
+		guchar *d = out + y * out_rowstride;
 		destoffset = 0;
 		srcoffset = y * in_rowstride;
-		guchar *d = out + y * out_rowstride;
 		for(x=0 ; x<width ; x++)
 		{
 			rr = (in[srcoffset+R]*pre_mul[R]+64)>>7;
@@ -424,9 +424,9 @@ DEFINE_RENDER16(rs_render16_nocms_c)
 		pre_mul[x] = (gint) (photo->pre_mul[x]*128.0);
 	for(y=0 ; y<height ; y++)
 	{
+		gushort *d = out + y * out_rowstride;
 		destoffset = 0;
 		srcoffset = y * in_rowstride;
-		gushort *d = out + y * out_rowstride;
 		for(x=0 ; x<width ; x++)
 		{
 			rr = (in[srcoffset+R]*pre_mul[R])>>7;
diff -r a9de2785421d -r 94b3505c6fdc src/rs-straighten.c
--- a/src/rs-straighten.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-straighten.c	Wed Jan 03 14:24:23 2007 +0100
@@ -19,6 +19,7 @@
 
 #include <gtk/gtk.h>
 #include "rawstudio.h"
+#include "rs-straighten.h"
 
 static gboolean rs_straighten_motion_callback(GtkWidget *widget, GdkEventMotion *event, RS_BLOB *rs);
 static gboolean rs_straighten_button(GtkWidget *widget, GdkEventButton *event, RS_BLOB *rs);
diff -r a9de2785421d -r 94b3505c6fdc src/rs-straighten.h
--- a/src/rs-straighten.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-straighten.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,5 +17,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-void rs_straighten_start(RS_BLOB *rs);
-void rs_straighten_unstraighten(RS_BLOB *rs);
+#ifndef RS_STRAIGHTEN_H
+#define RS_STRAIGHTEN_H
+
+extern void rs_straighten_start(RS_BLOB *rs);
+extern void rs_straighten_unstraighten(RS_BLOB *rs);
+
+#endif
diff -r a9de2785421d -r 94b3505c6fdc src/rs-tiff.c
--- a/src/rs-tiff.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-tiff.c	Wed Jan 03 14:24:23 2007 +0100
@@ -26,10 +26,11 @@
 #include <sys/mman.h>
 #include <tiffio.h>
 #include "rawstudio.h"
+#include "rs-tiff.h"
 
 static void rs_tiff_generic_init(TIFF *output, guint w, guint h, const gchar *profile_filename, gboolean uncompressed);
 
-void
+static void
 rs_tiff_generic_init(TIFF *output, guint w, guint h, const gchar *profile_filename, gboolean uncompressed)
 {
 	TIFFSetField(output, TIFFTAG_IMAGEWIDTH, w);
diff -r a9de2785421d -r 94b3505c6fdc src/rs-tiff.h
--- a/src/rs-tiff.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/rs-tiff.h	Wed Jan 03 14:24:23 2007 +0100
@@ -17,5 +17,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-gboolean rs_tiff8_save(RS_IMAGE8 *image, const gchar *filename, const gchar *profile_filename, gboolean uncompressed);
-gboolean rs_tiff16_save(RS_IMAGE16 *image, const gchar *filename, const gchar *profile_filename, gboolean uncompressed);
+#ifndef RS_TIFF_H
+#define RS_TIFF_H
+
+extern gboolean rs_tiff8_save(RS_IMAGE8 *image, const gchar *filename, const gchar *profile_filename, gboolean uncompressed);
+extern gboolean rs_tiff16_save(RS_IMAGE16 *image, const gchar *filename, const gchar *profile_filename, gboolean uncompressed);
+
+#endif
diff -r a9de2785421d -r 94b3505c6fdc src/tiff-meta.c
--- a/src/tiff-meta.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/tiff-meta.c	Wed Jan 03 14:24:23 2007 +0100
@@ -30,7 +30,7 @@
 
 static void raw_nikon_makernote(RAWFILE *rawfile, guint offset, RS_METADATA *meta);
 
-void
+static void
 raw_nikon_makernote(RAWFILE *rawfile, guint offset, RS_METADATA *meta)
 {
 	static const guchar xlat[2][256] = {
@@ -176,13 +176,13 @@ raw_nikon_makernote(RAWFILE *rawfile, gu
 			case 0x00a7: /* white balance */
 				if (ver97 >> 8 == 2)
 				{
-					guchar tmp[4];
-					raw_get_uchar(rawfile, offset++, tmp);
-					raw_get_uchar(rawfile, offset++, tmp+1);
-					raw_get_uchar(rawfile, offset++, tmp+2);
-					raw_get_uchar(rawfile, offset, tmp+3);
+					guchar ctmp[4];
+					raw_get_uchar(rawfile, offset++, ctmp);
+					raw_get_uchar(rawfile, offset++, ctmp+1);
+					raw_get_uchar(rawfile, offset++, ctmp+2);
+					raw_get_uchar(rawfile, offset, ctmp+3);
 					ci = xlat[0][serial & 0xff];
-					cj = xlat[1][tmp[0]^tmp[1]^tmp[2]^tmp[3]];
+					cj = xlat[1][ctmp[0]^ctmp[1]^ctmp[2]^ctmp[3]];
 					ck = 0x60;
 					for (i=0; i < 324; i++)
 						buf97[i] ^= (cj += ci * ck++);
diff -r a9de2785421d -r 94b3505c6fdc src/toolbox.c
--- a/src/toolbox.c	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/toolbox.c	Wed Jan 03 14:24:23 2007 +0100
@@ -52,7 +52,7 @@ static void gui_notebook_callback(GtkNot
 static void gui_notebook_callback(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, RS_BLOB *rs);
 static void scale_expand_callback(GObject *object, GParamSpec *param_spec, gpointer user_data);
 
-GtkWidget *
+static GtkWidget *
 gui_hist(RS_BLOB *rs, const gchar *label)
 {
 	GdkPixbuf *pixbuf;
@@ -78,7 +78,7 @@ gui_hist(RS_BLOB *rs, const gchar *label
 	return(gui_box(label, (GtkWidget *)rs->histogram_image, TRUE));
 }
 
-GtkWidget *
+static GtkWidget *
 gui_box(const gchar *title, GtkWidget *in, gboolean expanded)
 {
 	GtkWidget *expander, *label;
@@ -95,7 +95,7 @@ gui_box(const gchar *title, GtkWidget *i
 	return(expander);
 }
 
-void
+static void
 gui_transform_rot90_clicked(GtkWidget *w, RS_BLOB *rs)
 {
 	if (!rs->photo) return;
@@ -103,7 +103,7 @@ gui_transform_rot90_clicked(GtkWidget *w
 	update_preview(rs, FALSE, TRUE);
 }
 
-void
+static void
 gui_transform_rot180_clicked(GtkWidget *w, RS_BLOB *rs)
 {
 	if (!rs->photo) return;
@@ -111,7 +111,7 @@ gui_transform_rot180_clicked(GtkWidget *
 	update_preview(rs, FALSE, TRUE);
 }
 
-void
+static void
 gui_transform_rot270_clicked(GtkWidget *w, RS_BLOB *rs)
 {
 	if (!rs->photo) return;
@@ -119,7 +119,7 @@ gui_transform_rot270_clicked(GtkWidget *
 	update_preview(rs, FALSE, TRUE);
 }
 
-void
+static void
 gui_transform_mirror_clicked(GtkWidget *w, RS_BLOB *rs)
 {
 	if (!rs->photo) return;
@@ -127,7 +127,7 @@ gui_transform_mirror_clicked(GtkWidget *
 	update_preview(rs, FALSE, TRUE);
 }
 
-void
+static void
 gui_transform_flip_clicked(GtkWidget *w, RS_BLOB *rs)
 {
 	if (!rs->photo) return;
@@ -135,7 +135,7 @@ gui_transform_flip_clicked(GtkWidget *w,
 	update_preview(rs, FALSE, TRUE);
 }
 
-GtkWidget *
+static GtkWidget *
 gui_transform(RS_BLOB *rs)
 {
 	GtkWidget *hbox;
@@ -174,7 +174,7 @@ gui_transform(RS_BLOB *rs)
 	return(gui_box(_("Transforms"), hbox, TRUE));
 }
 
-GtkWidget *
+static GtkWidget *
 gui_tool_warmth(RS_BLOB *rs, gint n)
 {
 	GtkWidget *box;
@@ -190,7 +190,7 @@ gui_tool_warmth(RS_BLOB *rs, gint n)
 	return(gui_box(_("Warmth/tint"), box, TRUE));
 }
 
-GtkWidget *
+static GtkWidget *
 gui_slider(GtkObject *adj, const gchar *label, gboolean expanded)
 {
 	GtkWidget *hscale;
@@ -200,14 +200,14 @@ gui_slider(GtkObject *adj, const gchar *
 	return(gui_box(label, hscale, expanded));
 }
 
-gboolean
+static gboolean
 gui_adj_reset_callback(GtkWidget *widget, GdkEventButton *event, struct reset_carrier *rc)
 {
 	rs_settings_reset(rc->rs->settings[rc->rs->current_setting], rc->mask);
 	return(TRUE);
 }
 
-GtkWidget *
+static GtkWidget *
 gui_make_scale_from_adj(RS_BLOB *rs, GCallback cb, GtkObject *adj, gint mask)
 {
 	GtkWidget *hscale, *box, *rimage, *revent;
@@ -238,30 +238,30 @@ gui_make_scale_from_adj(RS_BLOB *rs, GCa
 	return(box);
 }
 
-GtkWidget *
+static GtkWidget *
 gui_make_tools(RS_BLOB *rs, gint n)
 {
-	GtkWidget *toolbox;
-
-	toolbox = gtk_vbox_new (FALSE, 0);
-	gtk_widget_show (toolbox);
-	gtk_box_pack_start (GTK_BOX (toolbox), gui_box(_("Exposure"),
+	GtkWidget *tbox;
+
+	tbox = gtk_vbox_new (FALSE, 0);
+	gtk_widget_show (tbox);
+	gtk_box_pack_start (GTK_BOX (tbox), gui_box(_("Exposure"),
 		gui_make_scale_from_adj(rs, G_CALLBACK(update_preview_callback),
 		rs->settings[n]->exposure, MASK_EXPOSURE), TRUE), FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (toolbox), gui_box(_("Saturation"),
+	gtk_box_pack_start (GTK_BOX (tbox), gui_box(_("Saturation"),
 		gui_make_scale_from_adj(rs, G_CALLBACK(update_preview_callback),
 		rs->settings[n]->saturation, MASK_SATURATION), TRUE), FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (toolbox), gui_box(_("Hue"),
+	gtk_box_pack_start (GTK_BOX (tbox), gui_box(_("Hue"),
 		gui_make_scale_from_adj(rs, G_CALLBACK(update_preview_callback),
 		rs->settings[n]->hue, MASK_HUE), TRUE), FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (toolbox), gui_box(_("Contrast"),
+	gtk_box_pack_start (GTK_BOX (tbox), gui_box(_("Contrast"),
 		gui_make_scale_from_adj(rs, G_CALLBACK(update_previewtable_callback),
 		rs->settings[n]->contrast, MASK_CONTRAST), TRUE), FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (toolbox), gui_tool_warmth(rs, n), FALSE, FALSE, 0);
-	return(toolbox);
-}
-
-void
+	gtk_box_pack_start (GTK_BOX (tbox), gui_tool_warmth(rs, n), FALSE, FALSE, 0);
+	return(tbox);
+}
+
+static void
 gui_notebook_callback(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, RS_BLOB *rs)
 {
 	rs->current_setting = page_num;
diff -r a9de2785421d -r 94b3505c6fdc src/toolbox.h
--- a/src/toolbox.h	Wed Jan 03 04:47:58 2007 +0100
+++ b/src/toolbox.h	Wed Jan 03 14:24:23 2007 +0100
@@ -16,8 +16,15 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
+#ifndef TOOLBOX_H
+#define TOOLBOX_H
  
-void scale_expand_set(gboolean expanded);
-void gui_toolbox_add_widget(GtkWidget *widget);
-GtkWidget * gui_toolbox_add_tool_frame(GtkWidget *widget, gchar *title);
- GtkWidget *make_toolbox(RS_BLOB *rs);
+extern void scale_expand_set(gboolean expanded);
+extern void gui_toolbox_add_widget(GtkWidget *widget);
+extern GtkWidget * gui_toolbox_add_tool_frame(GtkWidget *widget, gchar *title);
+extern GtkWidget *make_toolbox(RS_BLOB *rs);
+
+extern GtkLabel *infolabel;
+
+#endif /* TOOLBOX_H */


-- 
Edouard Gomez



More information about the Rawstudio-dev mailing list