[gtk+/gtk-2-90: 115/127] Remove unnecessary casting
- From: Javier Jardón <jjardon src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-90: 115/127] Remove unnecessary casting
- Date: Tue, 17 Nov 2009 19:34:27 +0000 (UTC)
commit 8807619b70386228be3f4df163634b80fc787e82
Author: Cody Russell <bratsche gnome org>
Date: Thu Oct 22 15:03:05 2009 -0500
Remove unnecessary casting
gtk/gtkaboutdialog.c | 106 +++++++++++++++++++------------------------------
1 files changed, 41 insertions(+), 65 deletions(-)
---
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 9cf8176..1aeae97 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -645,7 +645,7 @@ static void
gtk_about_dialog_finalize (GObject *object)
{
GtkAboutDialog *about = GTK_ABOUT_DIALOG (object);
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
g_free (priv->name);
g_free (priv->version);
@@ -676,7 +676,7 @@ gtk_about_dialog_set_property (GObject *object,
GParamSpec *pspec)
{
GtkAboutDialog *about = GTK_ABOUT_DIALOG (object);
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
switch (prop_id)
{
@@ -735,7 +735,7 @@ gtk_about_dialog_get_property (GObject *object,
GParamSpec *pspec)
{
GtkAboutDialog *about = GTK_ABOUT_DIALOG (object);
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
switch (prop_id)
{
@@ -801,7 +801,7 @@ gtk_about_dialog_get_property (GObject *object,
static void
update_website (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
if (priv->website_url && (!activate_url_hook_set || activate_url_hook != NULL))
{
@@ -854,7 +854,7 @@ gtk_about_dialog_get_program_name (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
return priv->name;
}
@@ -865,7 +865,7 @@ update_name_version (GtkAboutDialog *about)
GtkAboutDialogPrivate *priv;
gchar *title_string, *name_string;
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
title_string = g_strdup_printf (_("About %s"), priv->name);
gtk_window_set_title (GTK_WINDOW (about), title_string);
@@ -902,7 +902,7 @@ gtk_about_dialog_set_program_name (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->name;
priv->name = g_strdup (name ? name : g_get_application_name ());
g_free (tmp);
@@ -927,13 +927,9 @@ gtk_about_dialog_set_program_name (GtkAboutDialog *about,
G_CONST_RETURN gchar *
gtk_about_dialog_get_version (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv;
-
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
-
- return priv->version;
+ return about->priv->version;
}
/**
@@ -954,8 +950,8 @@ gtk_about_dialog_set_version (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
-
+ priv = about->priv;
+
tmp = priv->version;
priv->version = g_strdup (version);
g_free (tmp);
@@ -979,13 +975,9 @@ gtk_about_dialog_set_version (GtkAboutDialog *about,
G_CONST_RETURN gchar *
gtk_about_dialog_get_copyright (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv;
-
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
-
- return priv->copyright;
+ return about->priv->copyright;
}
/**
@@ -1007,8 +999,8 @@ gtk_about_dialog_set_copyright (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
-
+ priv = about->priv;
+
tmp = priv->copyright;
priv->copyright = g_strdup (copyright);
g_free (tmp);
@@ -1042,13 +1034,9 @@ gtk_about_dialog_set_copyright (GtkAboutDialog *about,
G_CONST_RETURN gchar *
gtk_about_dialog_get_comments (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv;
-
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
-
- return priv->comments;
+ return about->priv->comments;
}
/**
@@ -1071,7 +1059,7 @@ gtk_about_dialog_set_comments (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->comments;
if (comments)
@@ -1104,13 +1092,9 @@ gtk_about_dialog_set_comments (GtkAboutDialog *about,
G_CONST_RETURN gchar *
gtk_about_dialog_get_license (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv;
-
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
-
- return priv->license;
+ return about->priv->license;
}
/**
@@ -1133,7 +1117,7 @@ gtk_about_dialog_set_license (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->license;
if (license)
@@ -1165,13 +1149,9 @@ gtk_about_dialog_set_license (GtkAboutDialog *about,
gboolean
gtk_about_dialog_get_wrap_license (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv;
-
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), FALSE);
- priv = (GtkAboutDialogPrivate *)about->priv;
-
- return priv->wrap_license;
+ return about->priv->wrap_license;
}
/**
@@ -1192,7 +1172,7 @@ gtk_about_dialog_set_wrap_license (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
wrap_license = wrap_license != FALSE;
@@ -1222,7 +1202,7 @@ gtk_about_dialog_get_website (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
return priv->website_url;
}
@@ -1248,7 +1228,7 @@ gtk_about_dialog_set_website (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->website_url;
priv->website_url = g_strdup (website);
@@ -1277,7 +1257,7 @@ gtk_about_dialog_get_website_label (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
return priv->website_text;
}
@@ -1301,7 +1281,7 @@ gtk_about_dialog_set_website_label (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->website_text;
priv->website_text = g_strdup (website_label);
@@ -1332,7 +1312,7 @@ gtk_about_dialog_get_authors (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
return (const gchar * const *) priv->authors;
}
@@ -1374,7 +1354,7 @@ gtk_about_dialog_set_authors (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->authors;
priv->authors = g_strdupv ((gchar **)authors);
@@ -1405,7 +1385,7 @@ gtk_about_dialog_get_documenters (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
return (const gchar * const *)priv->documenters;
}
@@ -1429,7 +1409,7 @@ gtk_about_dialog_set_documenters (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->documenters;
priv->documenters = g_strdupv ((gchar **)documenters);
@@ -1460,7 +1440,7 @@ gtk_about_dialog_get_artists (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
return (const gchar * const *)priv->artists;
}
@@ -1484,7 +1464,7 @@ gtk_about_dialog_set_artists (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->artists;
priv->artists = g_strdupv ((gchar **)artists);
@@ -1510,13 +1490,9 @@ gtk_about_dialog_set_artists (GtkAboutDialog *about,
G_CONST_RETURN gchar *
gtk_about_dialog_get_translator_credits (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv;
-
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
-
- return priv->translator_credits;
+ return about->priv->translator_credits;
}
/**
@@ -1550,7 +1526,7 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
tmp = priv->translator_credits;
priv->translator_credits = g_strdup (translator_credits);
@@ -1580,7 +1556,7 @@ gtk_about_dialog_get_logo (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_PIXBUF)
return gtk_image_get_pixbuf (GTK_IMAGE (priv->logo_image));
@@ -1626,7 +1602,7 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
g_object_freeze_notify (G_OBJECT (about));
@@ -1676,7 +1652,7 @@ gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about)
g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_ICON_NAME)
gtk_image_get_icon_name (GTK_IMAGE (priv->logo_image), &icon_name, NULL);
@@ -1704,7 +1680,7 @@ gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- priv = (GtkAboutDialogPrivate *)about->priv;
+ priv = about->priv;
g_object_freeze_notify (G_OBJECT (about));
@@ -1724,7 +1700,7 @@ follow_if_link (GtkAboutDialog *about,
GtkTextIter *iter)
{
GSList *tags = NULL, *tagp = NULL;
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
gchar *url = NULL;
GtkAboutDialogActivateLinkFunc email_hook, url_hook;
gpointer email_hook_data, url_hook_data;
@@ -1865,7 +1841,7 @@ set_cursor_if_appropriate (GtkAboutDialog *about,
gint x,
gint y)
{
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
GSList *tags = NULL, *tagp = NULL;
GtkTextIter iter;
gboolean hovering_over_link = FALSE;
@@ -1954,7 +1930,7 @@ text_view_new (GtkAboutDialog *about,
GdkColor color;
GdkColor link_color;
GdkColor visited_link_color;
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
linkify_email = (!activate_email_hook_set || activate_email_hook != NULL);
linkify_urls = (!activate_url_hook_set || activate_url_hook != NULL);
@@ -2110,7 +2086,7 @@ display_credits_dialog (GtkWidget *button,
gpointer data)
{
GtkAboutDialog *about = (GtkAboutDialog *)data;
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
GtkWidget *dialog, *notebook;
GtkDialog *credits_dialog;
GtkWidget *content_area;
@@ -2192,7 +2168,7 @@ display_license_dialog (GtkWidget *button,
gpointer data)
{
GtkAboutDialog *about = (GtkAboutDialog *)data;
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
GtkWidget *dialog, *view, *sw;
GtkDialog *license_dialog;
GtkWidget *content_area;
@@ -2345,7 +2321,7 @@ gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func,
static void
close_cb (GtkAboutDialog *about)
{
- GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->priv;
+ GtkAboutDialogPrivate *priv = about->priv;
if (priv->license_dialog != NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]