Random fixes.

Mostly found by -Wextra.
This commit is contained in:
Přemysl Eric Janouch 2010-12-05 15:21:00 +01:00
parent 147cf2977a
commit 1d956964e2
4 changed files with 15 additions and 13 deletions

View File

@ -8,6 +8,8 @@
* *
*/ */
#include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "config.h" #include "config.h"
@ -71,7 +73,7 @@ ld_library_class_init (LdLibraryClass *klass)
* Contents of the library have changed. * Contents of the library have changed.
*/ */
klass->changed_signal = g_signal_new klass->changed_signal = g_signal_new
("changed", G_TYPE_FROM_CLASS (object_class), ("changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
@ -423,9 +425,12 @@ ld_library_remove_child (LdLibrary *self, GObject *child)
g_return_if_fail (LD_IS_LIBRARY (self)); g_return_if_fail (LD_IS_LIBRARY (self));
g_return_if_fail (G_IS_OBJECT (child)); g_return_if_fail (G_IS_OBJECT (child));
if (g_slist_find (self->priv->children, child))
{
g_object_unref (child); g_object_unref (child);
self->priv->children = g_slist_remove (self->priv->children, child); self->priv->children = g_slist_remove (self->priv->children, child);
} }
}
/** /**
* ld_library_get_children: * ld_library_get_children:

View File

@ -19,6 +19,7 @@
#include "ld-lua.h" #include "ld-lua.h"
#include "ld-lua-symbol.h" #include "ld-lua-symbol.h"
#include "ld-lua-private.h"
#include "ld-lua-symbol-private.h" #include "ld-lua-symbol-private.h"

View File

@ -327,6 +327,7 @@ ld_lua_private_draw_cb (lua_State *L)
/* Call the function do draw the symbol. */ /* Call the function do draw the symbol. */
push_cairo_object (L, data->cr); push_cairo_object (L, data->cr);
lua_pcall (L, 1, 0, 0); lua_pcall (L, 1, 0, 0);
return 0;
} }
/** /**
@ -418,7 +419,6 @@ static int
process_registration (lua_State *L) process_registration (lua_State *L)
{ {
LdLuaSymbol *symbol; LdLuaSymbol *symbol;
const gchar *name;
gchar *human_name; gchar *human_name;
int i, type, types[] = int i, type, types[] =
@ -439,7 +439,7 @@ process_registration (lua_State *L)
human_name = get_translation (L, 2); human_name = get_translation (L, 2);
if (!human_name) if (!human_name)
human_name = g_strdup (name); human_name = g_strdup (symbol->priv->name);
symbol->priv->human_name = human_name; symbol->priv->human_name = human_name;
if (!read_symbol_area (L, 3, &symbol->priv->area)) if (!read_symbol_area (L, 3, &symbol->priv->area))

View File

@ -88,16 +88,12 @@ enum
PROP_AREA PROP_AREA
}; };
static void static void ld_symbol_get_property (GObject *object, guint property_id,
ld_symbol_get_property (GObject *object, guint property_id,
GValue *value, GParamSpec *pspec); GValue *value, GParamSpec *pspec);
static void static void ld_symbol_set_property (GObject *object, guint property_id,
ld_symbol_set_property (GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec); const GValue *value, GParamSpec *pspec);
static void ld_symbol_finalize (GObject *gobject);
static void static void
ld_symbol_class_init (LdSymbolClass *klass) ld_symbol_class_init (LdSymbolClass *klass)
@ -192,7 +188,7 @@ ld_symbol_get_name (LdSymbol *self)
{ {
LdSymbolClass *klass; LdSymbolClass *klass;
g_return_if_fail (LD_IS_SYMBOL (self)); g_return_val_if_fail (LD_IS_SYMBOL (self), NULL);
klass = LD_SYMBOL_GET_CLASS (self); klass = LD_SYMBOL_GET_CLASS (self);
g_return_val_if_fail (klass->get_name != NULL, NULL); g_return_val_if_fail (klass->get_name != NULL, NULL);
@ -210,7 +206,7 @@ ld_symbol_get_human_name (LdSymbol *self)
{ {
LdSymbolClass *klass; LdSymbolClass *klass;
g_return_if_fail (LD_IS_SYMBOL (self)); g_return_val_if_fail (LD_IS_SYMBOL (self), NULL);
klass = LD_SYMBOL_GET_CLASS (self); klass = LD_SYMBOL_GET_CLASS (self);
g_return_val_if_fail (klass->get_human_name != NULL, NULL); g_return_val_if_fail (klass->get_human_name != NULL, NULL);