}
#endif
-gboolean
+static gboolean
katze_net_local_cb (KatzeNetPriv* priv)
{
KatzeNetRequest* request;
return FALSE;
}
-gboolean
+static gboolean
katze_net_default_cb (KatzeNetPriv* priv)
{
KatzeNetRequest* request;
if (G_LIKELY (cols > 0 && rows > 0))
{
- gint index;
+ gint idx;
guint x, y;
katze_throbber_aligned_coords (widget, &ax, &ay);
- index = throbber->index % (cols * rows);
+ idx = throbber->index % (cols * rows);
if (G_LIKELY (throbber->timer_id >= 0))
- index = MAX (index, 1);
+ idx = MAX (idx, 1);
- x = (index % cols) * throbber->width;
- y = (index / cols) * throbber->height;
+ x = (idx % cols) * throbber->width;
+ y = (idx / cols) * throbber->height;
gdk_draw_pixbuf (event->window, NULL, throbber->pixbuf,
x, y, ax, ay,
}
else if (type == G_TYPE_PARAM_ENUM)
{
- gint i;
+ guint i;
GEnumClass* enum_class = G_ENUM_CLASS (
g_type_class_ref (pspec->value_type));
gint value = katze_object_get_enum (object, property);
return value->string;
}
-void
+static void
gjs_value_weak_notify_cb (GjsValue* attribute,
GjsValue* value)
{
guint n;
GParamSpec** pspecs = g_object_class_list_properties (
G_OBJECT_GET_CLASS (object), &n);
- gint i;
+ guint i;
for (i = 0; i < n; i++)
{
const gchar* property = g_param_spec_get_name (pspecs[i]);
guint* signals = g_signal_list_ids (type, &n);
for (i = 0; i < n; i++)
{
- const gchar* signal = g_signal_name (signals[i]);
- JSStringRef js_signal = JSStringCreateWithUTF8CString (signal);
+ const gchar* signal_ = g_signal_name (signals[i]);
+ JSStringRef js_signal = JSStringCreateWithUTF8CString (signal_);
JSPropertyNameAccumulatorAddName (js_properties, js_signal);
JSStringRelease (js_signal);
}
GValue* values = g_new0 (GValue, n_arguments + 1);
g_value_init (&values[0], G_OBJECT_TYPE (object));
g_value_set_instance (&values[0], object);
- gint i;
+ guint i;
for (i = 0; i < n_arguments; i++)
{
GValue value = {0, };
return result;
}
-JSObjectRef
+static JSObjectRef
gjs_module_new (JSContextRef js_context,
const gchar* namespace)
{
PROP_SENSITIVITY_SECONDARY
};
-static void gtk_icon_entry_class_init (GtkIconEntryClass *klass);
static void gtk_icon_entry_editable_init (GtkEditableClass *iface);
-static void gtk_icon_entry_init (GtkIconEntry *entry);
static void gtk_icon_entry_finalize (GObject *obj);
static void gtk_icon_entry_dispose (GObject *obj);
static void gtk_icon_entry_map (GtkWidget *widget);
{
typedef struct
{
- gchar* stock_id;
- gchar* label;
+ const gchar* stock_id;
+ const gchar* label;
GdkModifierType modifier;
guint keyval;
- gchar* fallback;
+ const gchar* fallback;
} FatStockItem;
GtkIconSource* icon_source;
GtkIconSet* icon_set;
GParamSpec* pspec;
GType type;
const gchar* property;
- gchar* string;
+ gchar* str;
gint integer;
gfloat number;
gboolean boolean;
property = g_param_spec_get_name (pspec);
if (type == G_TYPE_PARAM_STRING)
{
- string = sokoke_key_file_get_string_default (key_file,
+ str = sokoke_key_file_get_string_default (key_file,
"settings", property,
G_PARAM_SPEC_STRING (pspec)->default_value, NULL);
- g_object_set (settings, property, string, NULL);
- g_free (string);
+ g_object_set (settings, property, str, NULL);
+ g_free (str);
}
else if (type == G_TYPE_PARAM_INT)
{
g_type_class_ref (pspec->value_type));
GEnumValue* enum_value = g_enum_get_value (enum_class,
G_PARAM_SPEC_ENUM (pspec)->default_value);
- gchar* string = sokoke_key_file_get_string_default (key_file,
+ str = sokoke_key_file_get_string_default (key_file,
"settings", property,
enum_value->value_name, NULL);
- enum_value = g_enum_get_value_by_name (enum_class, string);
+ enum_value = g_enum_get_value_by_name (enum_class, str);
if (enum_value)
g_object_set (settings, property, enum_value->value, NULL);
else
g_warning (_("Value '%s' is invalid for %s"),
- string, property);
+ str, property);
- g_free (string);
+ g_free (str);
g_type_class_unref (enum_class);
}
else
property = g_param_spec_get_name (pspec);
if (!(pspec->flags & G_PARAM_WRITABLE))
{
- gchar* comment = g_strdup_printf ("# %s", property);
- g_key_file_set_string (key_file, "settings", comment, "");
- g_free (comment);
+ gchar* prop_comment = g_strdup_printf ("# %s", property);
+ g_key_file_set_string (key_file, "settings", prop_comment, "");
+ g_free (prop_comment);
continue;
}
if (type == G_TYPE_PARAM_STRING)
/* Test whether have the right number of columns */
g_return_val_if_fail (argc % ncols == 0, 1);
- for (i = 0; i <= (argc - ncols); i++)
+ for (i = 0; i < (argc - ncols) + 1; i++)
{
if (argv[i])
{
G_CALLBACK (midori_bookmarks_remove_item_cb), NULL);
if (!katze_array_is_empty (bookmarks))
{
- guint i, n;
+ guint n;
n = katze_array_get_length (bookmarks);
for (i = 0; i < n; i++)
{
- KatzeItem* item = katze_array_get_nth_item (bookmarks, i);
+ item = katze_array_get_nth_item (bookmarks, i);
if (KATZE_IS_ARRAY (item))
{
g_signal_connect_after (item, "add-item",
midori_app_quit (app);
}
-void
+static void
_midori_app_add_browser (MidoriApp* app,
MidoriBrowser* browser)
{
#endif
}
-void
+static void
_midori_app_quit (MidoriApp* app)
{
gtk_main_quit ();
midori_browser_message_received_cb (UniqueApp* instance,
UniqueCommand command,
UniqueMessageData* message,
- guint time,
+ guint timestamp,
MidoriApp* app)
{
UniqueResponse response;
static void
_action_location_active_changed (GtkAction* action,
- gint index,
+ gint idx,
MidoriBrowser* browser)
{
const gchar* uri;
- if (index > -1)
+ if (idx > -1)
{
uri = midori_location_action_get_uri (MIDORI_LOCATION_ACTION (action));
midori_browser_set_current_uri (browser, uri);
{
MidoriSearchAction* search_action;
KatzeItem* item;
- guint index;
+ guint idx;
search_action = MIDORI_SEARCH_ACTION (action);
item = midori_search_action_get_current_item (search_action);
if (item)
- index = katze_array_get_item_index (browser->search_engines, item);
+ idx = katze_array_get_item_index (browser->search_engines, item);
else
- index = 0;
+ idx = 0;
- g_object_set (browser->settings, "last-web-search", index, NULL);
+ g_object_set (browser->settings, "last-web-search", idx, NULL);
}
static void
static void
_action_about_activate_link (GtkAboutDialog* about,
- const gchar* link,
+ const gchar* uri,
gpointer user_data)
{
MidoriBrowser* browser;
gint n;
browser = MIDORI_BROWSER (user_data);
- n = midori_browser_add_uri (browser, link);
+ n = midori_browser_add_uri (browser, uri);
midori_browser_set_current_page (browser, n);
}
static void
_action_about_activate_email (GtkAboutDialog* about,
- const gchar* link,
+ const gchar* uri,
gpointer user_data)
{
- gchar* command = g_strconcat ("xdg-open ", link, NULL);
+ gchar* command = g_strconcat ("xdg-open ", uri, NULL);
g_spawn_command_line_async (command, NULL);
g_free (command);
}
gtk_tool_button_set_label (GTK_TOOL_BUTTON (toolitem), _("Close Findbar"));
g_signal_connect (toolitem, "clicked",
G_CALLBACK (midori_browser_find_button_close_clicked_cb), browser);
- #ifdef HAVE_OSX
+ #if HAVE_OSX
gtk_toolbar_insert (GTK_TOOLBAR (browser->find), toolitem, 0);
#else
gtk_toolbar_insert (GTK_TOOLBAR (browser->find), toolitem, -1);
g_type_class_add_private (class, sizeof (MidoriExtensionPrivate));
}
-void
+static void
midori_extension_activate_cb (MidoriExtension* extension,
MidoriApp* app)
{
GtkTreeModel* filter_model;
GtkTreeModel* model;
GtkTreeIter iter;
- GtkTreeIter index;
+ GtkTreeIter idx;
gint n;
gint visits = 0;
if (midori_location_action_iter_insert (location_action,
item->uri, &iter, 0))
{
- gtk_tree_model_get_iter_first (model, &index);
+ gtk_tree_model_get_iter_first (model, &idx);
gtk_tree_model_get (model, &iter, VISITS_COL, &visits, -1);
- gtk_list_store_move_before (GTK_LIST_STORE (model), &iter, &index);
+ gtk_list_store_move_before (GTK_LIST_STORE (model), &iter, &idx);
}
n = gtk_tree_model_iter_n_children (filter_model, NULL);
if (n > MAX_ITEMS)
{
- gtk_tree_model_iter_nth_child (model, &index, NULL, n - 1);
+ gtk_tree_model_iter_nth_child (model, &idx, NULL, n - 1);
gtk_list_store_set (GTK_LIST_STORE (model),
- &index, VISIBLE_COL, FALSE, -1);
+ &idx, VISIBLE_COL, FALSE, -1);
}
/* Only increment the visits when we add the uri */
*border = default_inner_border;
}
-void
+static void
gtk_entry_borders (GtkEntry* entry,
gint* xborder,
gint* yborder,
GtkAlignmentClass parent_class;
} MidoriDummyViewableClass;
+GType midori_dummy_viewable_get_type (void) G_GNUC_CONST;
#define MIDORI_TYPE_DUMMY_VIEWABLE (midori_dummy_viewable_get_type ())
#define MIDORI_DUMMY_VIEWABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
MIDORI_TYPE_DUMMY_VIEWABLE, MidoriDummyViewable))
}
#endif
-#ifdef HAVE_OSX
+#if HAVE_OSX
static void
midori_preferences_help_clicked_cb (GtkWidget* button,
GtkDialog* dialog)
const gchar* label,
GtkWidget* page)
{
-#ifdef HAVE_OSX
+#if HAVE_OSX
*toolbutton = GTK_WIDGET (*toolbutton ? gtk_radio_tool_button_new_from_widget (
GTK_RADIO_TOOL_BUTTON (*toolbutton)) : gtk_radio_tool_button_new (NULL));
gtk_tool_button_set_label (GTK_TOOL_BUTTON (*toolbutton), label);
preferences->notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (preferences->notebook), 6);
- #ifdef HAVE_OSX
+ #if HAVE_OSX
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (preferences->notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (preferences->notebook), FALSE);
toolbar = gtk_toolbar_new ();
g_object_unref (sizegroup);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox),
preferences->notebook, FALSE, FALSE, 4);
- #ifdef HAVE_OSX
+ #if HAVE_OSX
GtkWidget* icon;
hbox = gtk_hbox_new (FALSE, 0);
button = gtk_button_new ();
gtk_widget_set_sensitive (button, FALSE);
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
- #ifdef HAVE_OSX
+ #if HAVE_OSX
GtkWidget* icon;
hbox = gtk_hbox_new (FALSE, 0);
button = gtk_button_new ();
case 1:
if (!link_uri)
return FALSE;
- #ifdef HAVE_OSX
+ #if HAVE_OSX
/* FIXME: Test for Command key */
if (0)
#else
{
GtkWidget* parent;
+ /* FIXME: Disconnect orientation notification
if (old_parent)
- /* FIXME: Disconnect orientation notification */;
+ ; */
if (!(parent = gtk_widget_get_parent (tab_label)))
return;
static SokokeDesktop
sokoke_get_desktop (void)
{
- #ifdef HAVE_OSX
+ #if HAVE_OSX
return SOKOKE_DESKTOP_OSX;
#else
static SokokeDesktop desktop = SOKOKE_DESKTOP_UNTESTED;
return files;
}
-GtkTreePath*
+static GtkTreePath*
_treeview_first_selected_path (GtkTreeView *treeview)
{
GtkTreeSelection* selection;
check_pkg ('libxml-2.0', '2.6')
conf.check (header_name='unistd.h')
- if sys.platform == 'darwin':
- conf.define ('HAVE_OSX', 1)
+ conf.define ('HAVE_OSX', int(sys.platform == 'darwin'))
if conf.find_program ('rsvg-convert', var='RSVG_CONVERT'):
icons = 'yes'
conf.write_config_header ('config.h')
conf.env.append_value ('CCFLAGS', '-DHAVE_CONFIG_H')
debug_level = Options.options.debug_level
- if debug_level != '':
+ if debug_level != 'no':
compiler = conf.env['CC_NAME']
if compiler == 'gcc':
if debug_level == 'debug':
conf.env.append_value ('CCFLAGS', '-Wall -O0 -g')
+ elif debug_level == 'full':
+ # -Wdeclaration-after-statement
+ # -Wmissing-declarations -Wmissing-prototypes
+ # -Wwrite-strings
+ conf.env.append_value ('CCFLAGS',
+ '-Wall -Wextra -O1 -g '
+ '-Waggregate-return -Wno-unused-parameter '
+ '-Wno-missing-field-initializers '
+ '-Wunsafe-loop-optimizations '
+ '-Wredundant-decls -Wmissing-noreturn '
+ '-Wshadow -Wpointer-arith -Wcast-align '
+ '-Winline -Wformat-security '
+ '-Winit-self -Wmissing-include-dirs -Wundef '
+ '-Wmissing-format-attribute -Wnested-externs '
+ '-DG_ENABLE_DEBUG')
else:
conf.env.append_value ('CCFLAGS', '-O2')
else:
opt.tool_options ('compiler_cc')
opt.get_option_group ('--check-c-compiler').add_option('-d', '--debug-level',
- action = 'store', default = '',
- help = 'Specify the debugging level. [\'debug\', \'release\']',
- choices = ['', 'debug', 'release'], dest = 'debug_level')
+ action = 'store', default = 'debug',
+ help = 'Specify the debugging level. [\'no\', \'debug\', \'full\']',
+ choices = ['no', 'debug', 'full'], dest = 'debug_level')
opt.tool_options ('gnu_dirs')
opt.parser.remove_option ('--oldincludedir')
opt.parser.remove_option ('--htmldir')