Commit 7b82bb58 authored by Pierre Wieser's avatar Pierre Wieser

Compiling with '-pedantic' gcc option

Fix na-compiler-flags.m4 macro to correctly handle provided default values.
make distcheck now defaults to compile with '--enable-iso-c' configure option.
parent c9b2005d
2009-08-24 Pierre Wieser <pwieser@trychlos.org>
* Makefile.am:
make distcheck uses now '--enable-iso-c' option.
* configure.ac:
Add '-pedantic' as '--enable-iso-c' default option.
Add also '-Wno-overlength-strings' to handle long strings in
src/common/xml-names.h.
* m4/na-compiler-flags.m4:
Fix '--enable-iso-c' macro to correctly handle provided values.
* src/common/na-about.c:
* src/common/na-action-profile.c:
* src/common/na-action.c:
* src/common/na-gconf.c:
* src/common/na-iduplicable.c:
* src/common/na-iio-provider.c:
* src/common/na-iio-provider.h:
* src/common/na-ipivot-consumer.c:
* src/common/na-iprefs.c:
* src/common/na-object.c:
* src/common/na-pivot.c:
* src/common/na-utils.c:
* src/common/na-xml-writer.c:
* src/nact/base-application.c:
* src/nact/base-window.c:
* src/nact/nact-application.c:
* src/nact/nact-assistant-export.c:
* src/nact/nact-assistant-import.c:
* src/nact/nact-assistant.c:
* src/nact/nact-iaction-tab.c:
* src/nact/nact-iactions-list.c:
* src/nact/nact-iadvanced-tab.c:
* src/nact/nact-icommand-tab.c:
* src/nact/nact-iconditions-tab.c:
* src/nact/nact-imenubar.c:
* src/nact/nact-iprefs.c:
* src/nact/nact-main-window.c:
* src/nact/nact-preferences-editor.c:
* src/nact/nact-window.c:
* src/nact/nact-xml-reader.c:
* src/plugin/nautilus-actions.c:
* src/plugin/nautilus-module.c:
* src/test/test-parse-uris.c:
* src/utils/nautilus-actions-new.c:
* src/utils/nautilus-actions-schemas.c:
Compile with -pedantic gcc option.
* src/common/na-xml-names.h:
Long names are rewritten on several lines for more readability.
2009-08-23 Pierre Wieser <pwieser@trychlos.org>
Get rid of unwanted notifications.
......
......@@ -44,7 +44,9 @@ DISTCHECK_CONFIGURE_FLAGS = \
# do not try to install schemas when making distcheck
DISTCHECK_CONFIGURE_FLAGS += \
--disable-schemas-install
--disable-schemas-install \
--enable-iso-c \
$(NULL)
EXTRA_DIST = \
intltool-extract.in \
......
......@@ -16,6 +16,8 @@ Version xxxxxx
Use Gtk+ UI Manager.
Whole program is now compiled with '-pedantic' option.
New and updated translations
Version 1.12.0
......
......@@ -79,7 +79,7 @@ AC_PROG_MAKE_SET
# Gnome stuff
GNOME_COMMON_INIT
GNOME_MAINTAINER_MODE_DEFINES
NA_GNOME_COMPILE_WARNINGS([error],[-ansi])
NA_GNOME_COMPILE_WARNINGS([error],[-ansi -pedantic -Wno-overlength-strings])
AC_SUBST([AM_CPPFLAGS],["${AM_CPPFLAGS} ${DISABLE_DEPRECATED}"])
# unique 1.0.8 doesn't satisfy this
#AC_SUBST([AM_CPPFLAGS],["${AM_CPPFLAGS} \
......
......@@ -2,7 +2,7 @@ dnl GNOME_COMPILE_WARNINGS
dnl Turn on many useful compiler warnings
dnl For now, only works on GCC
# serial 2 change NACT_ prefix to NA_ (Nautilus Actions)
# serial 3 Fix to correctly handle provided default values
#
# pwi 2009-05-15 shamelessly copied from gnome-compiler-flags.m4
......@@ -12,7 +12,7 @@ dnl For now, only works on GCC
AC_DEFUN([NA_GNOME_COMPILE_WARNINGS],[
_ac_warning_def=m4_default([$1],[yes])
_ac_compliant_def=m4_default([$2],[no])
_ac_compliant_def=m4_default(["$2"],[no])
dnl ******************************
dnl More compiler warnings
......@@ -21,7 +21,7 @@ AC_DEFUN([NA_GNOME_COMPILE_WARNINGS],[
AC_ARG_ENABLE(compile-warnings,
AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
[Turn on compiler warnings]),,
[enable_compile_warnings=${_ac_warning_def}])
[enable_compile_warnings="${_ac_warning_def}"])
warnCFLAGS=
if test "x$GCC" != xyes; then
......@@ -75,13 +75,13 @@ AC_DEFUN([NA_GNOME_COMPILE_WARNINGS],[
AC_ARG_ENABLE(iso-c,
AC_HELP_STRING([--enable-iso-c],
[Try to warn if code is not ISO C ]),,
[enable_iso_c=${_ac_compliant_def}])
[enable_iso_c="${_ac_compliant_def}"])
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
complCFLAGS=
if test "x$enable_iso_c" != "xno"; then
if test "x$GCC" = "xyes"; then
if test "${enable_iso_c}" = "yes"; then
if test "x${_ac_compliant_def}" = "x"; then
case " $CFLAGS " in
*[\ \ ]-ansi[\ \ ]*) ;;
*) complCFLAGS="$complCFLAGS -ansi" ;;
......@@ -91,7 +91,7 @@ AC_DEFUN([NA_GNOME_COMPILE_WARNINGS],[
*) complCFLAGS="$complCFLAGS -pedantic" ;;
esac
else
complCFLAGS="$complCFLAGS ${enable_iso_c}"
complCFLAGS="$complCFLAGS ${_ac_compliant_def}"
fi
fi
fi
......
......@@ -50,9 +50,7 @@ void
na_about_display( GObject *toplevel )
{
static const gchar *thisfn = "na_about_display";
g_debug( "%s: toplevel=%p", thisfn, toplevel );
gchar *icon_name = na_about_get_icon_name();
gchar *icon_name, *license_i18n;
static const gchar *artists[] = {
N_( "Ulisse Perusin <uli.peru@gmail.com>" ),
......@@ -85,7 +83,12 @@ na_about_display( GObject *toplevel )
"MA 02110-1301, USA." ),
NULL
};
gchar *license_i18n = g_strjoinv( "\n\n", license );
g_debug( "%s: toplevel=%p", thisfn, ( void * ) toplevel );
icon_name = na_about_get_icon_name();
license_i18n = g_strjoinv( "\n\n", license );
/*GtkWindow *toplevel = base_window_get_toplevel_dialog( BASE_WINDOW( window ));*/
if( toplevel ){
......
......@@ -44,6 +44,7 @@
/* private class data
*/
struct NAActionProfileClassPrivate {
void *empty; /* so that gcc -pedantic is happy */
};
/* private instance data
......@@ -133,7 +134,6 @@ static GType
register_type( void )
{
static const gchar *thisfn = "na_action_profile_register_type";
g_debug( "%s", thisfn );
static GTypeInfo info = {
sizeof( NAActionProfileClass ),
......@@ -147,6 +147,8 @@ register_type( void )
( GInstanceInitFunc ) instance_init
};
g_debug( "%s", thisfn );
return( g_type_register_static( NA_OBJECT_TYPE, "NAActionProfile", &info, 0 ));
}
......@@ -154,17 +156,19 @@ static void
class_init( NAActionProfileClass *klass )
{
static const gchar *thisfn = "na_action_profile_class_init";
g_debug( "%s: klass=%p", thisfn, klass );
GObjectClass *object_class;
GParamSpec *spec;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
st_parent_class = g_type_class_peek_parent( klass );
GObjectClass *object_class = G_OBJECT_CLASS( klass );
object_class = G_OBJECT_CLASS( klass );
object_class->dispose = instance_dispose;
object_class->finalize = instance_finalize;
object_class->set_property = instance_set_property;
object_class->get_property = instance_get_property;
GParamSpec *spec;
spec = g_param_spec_pointer(
PROP_NAPROFILE_ACTION_STR,
"NAAction attachment",
......@@ -264,8 +268,10 @@ instance_init( GTypeInstance *instance, gpointer klass )
/*static const gchar *thisfn = "na_action_profile_instance_init";
g_debug( "%s: instance=%p, klass=%p", thisfn, instance, klass );*/
NAActionProfile *self;
g_assert( NA_IS_ACTION_PROFILE( instance ));
NAActionProfile* self = NA_ACTION_PROFILE( instance );
self = NA_ACTION_PROFILE( instance );
self->private = g_new0( NAActionProfilePrivate, 1 );
......@@ -290,11 +296,12 @@ instance_init( GTypeInstance *instance, gpointer klass )
static void
instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec )
{
g_assert( NA_IS_ACTION_PROFILE( object ));
NAActionProfile *self = NA_ACTION_PROFILE( object );
NAActionProfile *self;
GSList *list;
g_assert( NA_IS_ACTION_PROFILE( object ));
self = NA_ACTION_PROFILE( object );
switch( property_id ){
case PROP_NAPROFILE_ACTION:
g_value_set_pointer( value, self->private->action );
......@@ -356,8 +363,10 @@ instance_get_property( GObject *object, guint property_id, GValue *value, GParam
static void
instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec )
{
NAActionProfile *self;
g_assert( NA_IS_ACTION_PROFILE( object ));
NAActionProfile *self = NA_ACTION_PROFILE( object );
self = NA_ACTION_PROFILE( object );
switch( property_id ){
case PROP_NAPROFILE_ACTION:
......@@ -423,10 +432,12 @@ static void
instance_dispose( GObject *object )
{
static const gchar *thisfn = "na_action_profile_instance_dispose";
g_debug( "%s: object=%p", thisfn, object );
NAActionProfile *self;
g_debug( "%s: object=%p", thisfn, ( void * ) object );
g_assert( NA_IS_ACTION_PROFILE( object ));
NAActionProfile *self = NA_ACTION_PROFILE( object );
self = NA_ACTION_PROFILE( object );
if( !self->private->dispose_has_run ){
......@@ -441,10 +452,12 @@ static void
instance_finalize( GObject *object )
{
static const gchar *thisfn = "na_action_profile_instance_finalize";
g_debug( "%s: object=%p", thisfn, object );
NAActionProfile *self;
g_debug( "%s: object=%p", thisfn, (void * ) object );
g_assert( NA_IS_ACTION_PROFILE( object ));
NAActionProfile *self = ( NAActionProfile * ) object;
self = ( NAActionProfile * ) object;
g_free( self->private->path );
g_free( self->private->parameters );
......@@ -495,9 +508,10 @@ na_action_profile_new( void )
NAAction *
na_action_profile_get_action( const NAActionProfile *profile )
{
NAAction *action;
g_assert( NA_IS_ACTION_PROFILE( profile ));
NAAction *action;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_ACTION_STR, &action, NULL );
return( action );
......@@ -517,10 +531,12 @@ na_action_profile_get_action( const NAActionProfile *profile )
gchar *
na_action_profile_get_name( const NAActionProfile *profile )
{
gchar *id;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gchar *id;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_NAME_STR, &id, NULL );
return( id );
}
......@@ -538,10 +554,12 @@ na_action_profile_get_name( const NAActionProfile *profile )
gchar *
na_action_profile_get_label( const NAActionProfile *profile )
{
gchar *label;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gchar *label;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_LABEL_STR, &label, NULL );
return( label );
}
......@@ -557,9 +575,10 @@ na_action_profile_get_label( const NAActionProfile *profile )
gchar *
na_action_profile_get_path( const NAActionProfile *profile )
{
gchar *path;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gchar *path;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_PATH_STR, &path, NULL );
return( path );
......@@ -577,9 +596,10 @@ na_action_profile_get_path( const NAActionProfile *profile )
gchar *
na_action_profile_get_parameters( const NAActionProfile *profile )
{
gchar *parameters;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gchar *parameters;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_PARAMETERS_STR, &parameters, NULL );
return( parameters );
......@@ -600,9 +620,10 @@ na_action_profile_get_parameters( const NAActionProfile *profile )
GSList *
na_action_profile_get_basenames( const NAActionProfile *profile )
{
GSList *basenames;
g_assert( NA_IS_ACTION_PROFILE( profile ));
GSList *basenames;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_BASENAMES_STR, &basenames, NULL );
return( basenames );
......@@ -623,9 +644,10 @@ na_action_profile_get_basenames( const NAActionProfile *profile )
gboolean
na_action_profile_get_matchcase( const NAActionProfile *profile )
{
gboolean matchcase;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gboolean matchcase;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_MATCHCASE_STR, &matchcase, NULL );
return( matchcase );
......@@ -646,9 +668,10 @@ na_action_profile_get_matchcase( const NAActionProfile *profile )
GSList *
na_action_profile_get_mimetypes( const NAActionProfile *profile )
{
GSList *mimetypes;
g_assert( NA_IS_ACTION_PROFILE( profile ));
GSList *mimetypes;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_MIMETYPES_STR, &mimetypes, NULL );
return( mimetypes );
......@@ -668,9 +691,10 @@ na_action_profile_get_mimetypes( const NAActionProfile *profile )
gboolean
na_action_profile_get_is_file( const NAActionProfile *profile )
{
gboolean isfile;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gboolean isfile;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_ISFILE_STR, &isfile, NULL );
return( isfile );
......@@ -690,9 +714,10 @@ na_action_profile_get_is_file( const NAActionProfile *profile )
gboolean
na_action_profile_get_is_dir( const NAActionProfile *profile )
{
gboolean isdir;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gboolean isdir;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_ISDIR_STR, &isdir, NULL );
return( isdir );
......@@ -713,9 +738,10 @@ na_action_profile_get_is_dir( const NAActionProfile *profile )
gboolean
na_action_profile_get_multiple( const NAActionProfile *profile )
{
gboolean multiple;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gboolean multiple;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_ACCEPT_MULTIPLE_STR, &multiple, NULL );
return( multiple );
......@@ -736,9 +762,10 @@ na_action_profile_get_multiple( const NAActionProfile *profile )
GSList *
na_action_profile_get_schemes( const NAActionProfile *profile )
{
GSList *schemes;
g_assert( NA_IS_ACTION_PROFILE( profile ));
GSList *schemes;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_SCHEMES_STR, &schemes, NULL );
return( schemes );
......@@ -984,10 +1011,11 @@ void
na_action_profile_set_scheme( NAActionProfile *profile, const gchar *scheme, gboolean selected )
{
/*static const gchar *thisfn = "na_action_profile_set_scheme";*/
gboolean exist;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gboolean exist = na_utils_find_in_list( profile->private->schemes, scheme );
exist = na_utils_find_in_list( profile->private->schemes, scheme );
/*g_debug( "%s: scheme=%s exist=%s", thisfn, scheme, exist ? "True":"False" );*/
if( selected && !exist ){
......@@ -1036,8 +1064,6 @@ na_action_profile_set_schemes( NAActionProfile *profile, GSList *schemes )
gboolean
na_action_profile_is_candidate( const NAActionProfile *profile, GList* files )
{
g_assert( NA_IS_ACTION_PROFILE( profile ));
gboolean retv = FALSE;
gboolean test_multiple_file = FALSE;
gboolean test_file_type = FALSE;
......@@ -1057,6 +1083,9 @@ na_action_profile_is_candidate( const NAActionProfile *profile, GList* files )
guint mime_glob_ok_count = 0;
gboolean basename_match_ok = FALSE;
gboolean mimetype_match_ok = FALSE;
gchar *tmp_pattern, *tmp_filename, *tmp_filename2, *tmp_mimetype, *tmp_mimetype2;
g_assert( NA_IS_ACTION_PROFILE( profile ));
if (profile->private->basenames && profile->private->basenames->next != NULL &&
g_ascii_strcasecmp ((gchar*)(profile->private->basenames->data), "*") == 0)
......@@ -1070,7 +1099,7 @@ na_action_profile_is_candidate( const NAActionProfile *profile, GList* files )
{
for (iter = profile->private->basenames; iter; iter = iter->next)
{
gchar* tmp_pattern = (gchar*)iter->data;
tmp_pattern = (gchar*)iter->data;
if (!profile->private->match_case)
{
/* --> if case-insensitive asked, lower all the string
......@@ -1108,11 +1137,11 @@ na_action_profile_is_candidate( const NAActionProfile *profile, GList* files )
for (iter1 = files; iter1; iter1 = iter1->next)
{
gchar* tmp_filename = nautilus_file_info_get_name ((NautilusFileInfo *)iter1->data);
tmp_filename = nautilus_file_info_get_name ((NautilusFileInfo *)iter1->data);
if (tmp_filename)
{
gchar* tmp_mimetype = nautilus_file_info_get_mime_type ((NautilusFileInfo *)iter1->data);
tmp_mimetype = nautilus_file_info_get_mime_type ((NautilusFileInfo *)iter1->data);
if (!profile->private->match_case)
{
......@@ -1120,13 +1149,13 @@ na_action_profile_is_candidate( const NAActionProfile *profile, GList* files )
* since the pattern matching function don't manage it
* itself.
*/
gchar* tmp_filename2 = g_ascii_strdown (tmp_filename, strlen (tmp_filename));
tmp_filename2 = g_ascii_strdown (tmp_filename, strlen (tmp_filename));
g_free (tmp_filename);
tmp_filename = tmp_filename2;
}
/* --> for the moment we deal with all mimetypes case-insensitively */
gchar* tmp_mimetype2 = g_ascii_strdown (tmp_mimetype, strlen (tmp_mimetype));
tmp_mimetype2 = g_ascii_strdown (tmp_mimetype, strlen (tmp_mimetype));
g_free (tmp_mimetype);
tmp_mimetype = tmp_mimetype2;
......@@ -1297,7 +1326,7 @@ na_action_profile_parse_parameters( const NAActionProfile *profile, GList* files
gchar *username = NULL;
gint port_number = 0;
GString *basename_list, *pathname_list, *uris_list;
gchar *tmp;
gchar *tmp, *iter, *old_iter;
NAGnomeVFSURI *vfs;
g_return_val_if_fail( NA_IS_ACTION_PROFILE( profile ), NULL );
......@@ -1350,8 +1379,8 @@ na_action_profile_parse_parameters( const NAActionProfile *profile, GList* files
g_free( iuri );
}
gchar *iter = g_strdup( profile->private->parameters );
gchar *old_iter = iter;
iter = g_strdup( profile->private->parameters );
old_iter = iter;
while(( iter = g_strstr_len( iter, strlen( iter ), "%" ))){
......@@ -1455,15 +1484,16 @@ static void
object_dump( const NAObject *object )
{
static const gchar *thisfn = "na_action_profile_object_dump";
NAActionProfile *self;
g_assert( NA_IS_ACTION_PROFILE( object ));
NAActionProfile *self = NA_ACTION_PROFILE( object );
self = NA_ACTION_PROFILE( object );
if( st_parent_class->dump ){
st_parent_class->dump( object );
}
g_debug( "%s: action=%p", thisfn, self->private->action );
g_debug( "%s: action=%p", thisfn, ( void * ) self->private->action );
g_debug( "%s: path='%s'", thisfn, self->private->path );
g_debug( "%s: parameters='%s'", thisfn, self->private->parameters );
g_debug( "%s: accept_multiple='%s'", thisfn, self->private->accept_multiple ? "True" : "False" );
......@@ -1486,9 +1516,11 @@ object_dump_list( const gchar *thisfn, const gchar *label, GSList *list )
static NAObject *
object_duplicate( const NAObject *profile )
{
NAObject *duplicate;
g_assert( NA_IS_ACTION_PROFILE( profile ));
NAObject *duplicate = NA_OBJECT( na_action_profile_new());
duplicate = NA_OBJECT( na_action_profile_new());
na_object_copy( duplicate, profile );
......@@ -1498,13 +1530,13 @@ object_duplicate( const NAObject *profile )
static void
object_copy( NAObject *target, const NAObject *source )
{
g_assert( NA_IS_ACTION_PROFILE( target ));
g_assert( NA_IS_ACTION_PROFILE( source ));
gchar *path, *parameters;
gboolean matchcase, isfile, isdir, multiple;
GSList *basenames, *mimetypes, *schemes;
g_assert( NA_IS_ACTION_PROFILE( target ));
g_assert( NA_IS_ACTION_PROFILE( source ));
g_object_get( G_OBJECT( source ),
PROP_NAPROFILE_PATH_STR, &path,
PROP_NAPROFILE_PARAMETERS_STR, &parameters,
......@@ -1543,13 +1575,14 @@ object_copy( NAObject *target, const NAObject *source )
gboolean
object_are_equal( const NAObject *a, const NAObject *b )
{
g_assert( NA_IS_ACTION_PROFILE( a ));
g_assert( NA_IS_ACTION_PROFILE( b ));
NAActionProfile *first = NA_ACTION_PROFILE( a );
NAActionProfile *second = NA_ACTION_PROFILE( b );
gboolean equal;
gboolean equal =
g_assert( NA_IS_ACTION_PROFILE( a ));
g_assert( NA_IS_ACTION_PROFILE( b ));
equal =
( g_utf8_collate( first->private->path, second->private->path ) == 0 ) &&
( g_utf8_collate( first->private->parameters, second->private->parameters ) == 0 );
......@@ -1582,11 +1615,13 @@ object_are_equal( const NAObject *a, const NAObject *b )
gboolean
object_is_valid( const NAObject *profile )
{
gchar *label;
gboolean is_valid;
g_assert( NA_IS_ACTION_PROFILE( profile ));
gchar *label;
g_object_get( G_OBJECT( profile ), PROP_NAPROFILE_LABEL_STR, &label, NULL );
gboolean is_valid = ( label && g_utf8_strlen( label, -1 ) > 0 );
is_valid = ( label && g_utf8_strlen( label, -1 ) > 0 );
g_free( label );
if( is_valid ){
......@@ -1604,11 +1639,12 @@ validate_schemes( GSList* schemes2test, NautilusFileInfo* file )
int retv = 0;
GSList* iter;
gboolean found = FALSE;
gchar *scheme;
iter = schemes2test;
while (iter && !found)
{
gchar* scheme = nautilus_file_info_get_uri_scheme (file);
scheme = nautilus_file_info_get_uri_scheme (file);
if (g_ascii_strncasecmp (scheme, (gchar*)iter->data, strlen ((gchar*)iter->data)) == 0)
{
......
......@@ -42,6 +42,7 @@
/* private class data
*/
struct NAActionClassPrivate {
void *empty; /* so that gcc -pedantic is happy */
};
/* private instance data
......@@ -132,7 +133,6 @@ static GType
register_type( void )
{
static const gchar *thisfn = "na_action_register_type";
g_debug( "%s", thisfn );
static GTypeInfo info = {
sizeof( NAActionClass ),
......@@ -146,6 +146,8 @@ register_type( void )
( GInstanceInitFunc ) instance_init
};
g_debug( "%s", thisfn );
return( g_type_register_static( NA_OBJECT_TYPE, "NAAction", &info, 0 ));
}
......@@ -153,17 +155,19 @@ static void
class_init( NAActionClass *klass )
{
static const gchar *thisfn = "na_action_class_init";
g_debug( "%s: klass=%p", thisfn, klass );
GObjectClass *object_class;
GParamSpec *spec;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
st_parent_class = g_type_class_peek_parent( klass );
GObjectClass *object_class = G_OBJECT_CLASS( klass );
object_class = G_OBJECT_CLASS( klass );
object_class->dispose = instance_dispose;
object_class->finalize = instance_finalize;
object_class->set_property = instance_set_property;
object_class->get_property = instance_get_property;
GParamSpec *spec;
spec = g_param_spec_string(
PROP_NAACTION_UUID_STR,
"Action UUID",
......@@ -236,8 +240,10 @@ instance_init( GTypeInstance *instance, gpointer klass )
/*static const gchar *thisfn = "na_action_instance_init";
g_debug( "%s: instance=%p, klass=%p", thisfn, instance, klass );*/
NAAction *self;
g_assert( NA_IS_ACTION( instance ));
NAAction* self = NA_ACTION( instance );
self = NA_ACTION( instance );
self->private = g_new0( NAActionPrivate, 1 );
......@@ -256,8 +262,10 @@ instance_init( GTypeInstance *instance, gpointer klass )
static void
instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec )
{
NAAction *self;
g_assert( NA_IS_ACTION( object ));
NAAction *self = NA_ACTION( object );
self = NA_ACTION( object );
switch( property_id ){
case PROP_NAACTION_UUID:
......@@ -301,8 +309,10 @@ instance_get_property( GObject *object, guint property_id, GValue *value, GParam
static void
instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec )
{
NAAction *self;
g_assert( NA_IS_ACTION( object ));
NAAction *self = NA_ACTION( object );
self = NA_ACTION( object );
switch( property_id ){
case PROP_NAACTION_UUID:
......@@ -350,10 +360,12 @@ static void
instance_dispose( GObject *object )
{
static const gchar *thisfn = "na_action_instance_dispose";
g_debug( "%s: object=%p", thisfn, object );
NAAction *self;
g_debug( "%s: object=%p", thisfn, ( void * ) object );
g_assert( NA_IS_ACTION( object ));
NAAction *self = NA_ACTION( object );
self = NA_ACTION( object );
if( !self->private->dispose_has_run ){
......@@ -371,10 +383,12 @@ static void
instance_finalize( GObject *object )
{
static const gchar *thisfn = "na_action_instance_finalize";
g_debug( "%s: object=%p", thisfn, object );
NAAction *self;
g_debug( "%s: object=%p", thisfn, ( void * ) object );
g_assert( NA_IS_ACTION( object ));
NAAction *self = ( NAAction * ) object;
self = ( NAAction * ) object;
g_free( self->private->version );
g_free( self->private->tooltip );
......@@ -401,7 +415,9 @@ instance_finalize( GObject *object )
NAAction *
na_action_new( void )
{
NAAction *action = g_object_new( NA_ACTION_TYPE, NULL );
NAAction *action;
action = g_object_new( NA_ACTION_TYPE, NULL );
na_action_set_new_uuid( action );
......@@ -421,9 +437,12 @@ na_action_new( void )
NAAction *
na_action_new_with_profile( void )
{
NAAction *action = na_action_new();
NAAction *action;
NAActionProfile *profile;
action = na_action_new();
NAActionProfile *profile = na_action_profile_new();
profile = na_action_profile_new();
na_action_attach_profile( action, profile );
......@@ -444,9 +463,10 @@ na_action_new_with_profile( void )
gchar *
na_action_get_uuid( const NAAction *action )
{
gchar *id;