[gtkhtml] Coding style cleanups.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkhtml] Coding style cleanups.
- Date: Sun, 8 May 2011 16:52:06 +0000 (UTC)
commit eda46c95451c714ef95b90e7da9240634958f0aa
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun May 8 12:43:09 2011 -0400
Coding style cleanups.
a11y/html.c | 2 +-
components/editor/gtkhtml-spell-language.c | 2 +-
gtkhtml/gtkhtml-embedded.c | 2 +-
gtkhtml/gtkhtml.c | 16 ++++++++--------
gtkhtml/htmlclueflow.c | 6 +++---
gtkhtml/htmldrawqueue.c | 2 +-
gtkhtml/htmlengine-save.c | 10 +++++-----
gtkhtml/htmlengine.c | 10 +++++-----
gtkhtml/htmlentity.c | 10 +++++-----
gtkhtml/htmlform.c | 2 +-
gtkhtml/htmlimage.c | 4 ++--
gtkhtml/htmlobject.h | 2 +-
gtkhtml/htmlpainter.c | 8 ++++----
gtkhtml/htmlprinter.c | 6 +++---
gtkhtml/htmlshape.c | 2 +-
gtkhtml/htmltext.c | 2 +-
gtkhtml/test.c | 8 ++++----
gtkhtml/testgtkhtml.c | 12 ++++++------
18 files changed, 53 insertions(+), 53 deletions(-)
---
diff --git a/a11y/html.c b/a11y/html.c
index 72674dd..eb26eaa 100644
--- a/a11y/html.c
+++ b/a11y/html.c
@@ -292,7 +292,7 @@ html_a11y_get_top_gtkhtml_parent (HTMLA11Y *a11y)
gtkhtml = gtk_html_get_top_html (gtkhtml);
- return (GtkHTMLA11Y *)gtk_widget_get_accessible (GTK_WIDGET (gtkhtml));
+ return (GtkHTMLA11Y *) gtk_widget_get_accessible (GTK_WIDGET (gtkhtml));
}
void
diff --git a/components/editor/gtkhtml-spell-language.c b/components/editor/gtkhtml-spell-language.c
index befcce3..d700dce 100644
--- a/components/editor/gtkhtml-spell-language.c
+++ b/components/editor/gtkhtml-spell-language.c
@@ -77,7 +77,7 @@ _get_iso_codes_prefix (void)
if (beenhere)
return retval;
- if (!(temp_dir = g_win32_get_package_installation_directory_of_module ((gpointer)hmodule))) {
+ if (!(temp_dir = g_win32_get_package_installation_directory_of_module ((gpointer) hmodule))) {
strcpy (retval, ISO_CODES_PREFIX);
return retval;
}
diff --git a/gtkhtml/gtkhtml-embedded.c b/gtkhtml/gtkhtml-embedded.c
index be5ec32..bd50290 100644
--- a/gtkhtml/gtkhtml-embedded.c
+++ b/gtkhtml/gtkhtml-embedded.c
@@ -287,7 +287,7 @@ gtk_html_embedded_new (gchar *classid, gchar *name, gchar *type, gchar *data, gi
em->name = g_strdup (name);
em->data = g_strdup (data);
- return (GtkWidget *)em;
+ return (GtkWidget *) em;
}
/**
diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
index 9fd4486..e8e60eb 100644
--- a/gtkhtml/gtkhtml.c
+++ b/gtkhtml/gtkhtml.c
@@ -970,7 +970,7 @@ gtk_html_set_fonts (GtkHTML *html, HTMLPainter *painter)
}
html_font_manager_set_default (&painter->font_manager,
- (gchar *)font_var, (gchar *)fixed_family,
+ (gchar *) font_var, (gchar *) fixed_family,
font_var_size, font_var_points,
fixed_size, fixed_points);
if (fixed_desc)
@@ -2348,7 +2348,7 @@ get_selection_string (GtkHTML *html, gint *len, gboolean selection, gboolean pri
GString *buffer;
state = html_engine_save_buffer_new (html->engine, TRUE);
- buffer = (GString *)state->user_data;
+ buffer = (GString *) state->user_data;
html_object_save (selection_object, state);
g_string_append_unichar (buffer, 0x0000);
@@ -4373,7 +4373,7 @@ gtk_html_modify_indent_by_delta (GtkHTML *html,
void
gtk_html_indent_push_level (GtkHTML *html, HTMLListType level_type)
{
- guint8 type = (guint8)level_type;
+ guint8 type = (guint8) level_type;
gtk_html_modify_indent_by_delta (html, +1, &type);
}
@@ -4476,11 +4476,11 @@ clipboard_get_contents_cb (GtkClipboard *clipboard,
gtk_selection_data_set (selection_data,
gdk_atom_intern ("text/html", FALSE), 8,
(const guchar *) contents->html_text,
- (gint )strlen (contents->html_text));
+ (gint ) strlen (contents->html_text));
} else if (contents->plain_text) {
gtk_selection_data_set_text (selection_data,
contents->plain_text,
- (gint )strlen (contents->plain_text));
+ (gint ) strlen (contents->plain_text));
}
}
@@ -6192,7 +6192,7 @@ gtk_html_insert_html_generic (GtkHTML *html, GtkHTML *tmp, const gchar *html_src
html_image_factory_move_images (html->engine->image_factory, tmp->engine->image_factory);
/* copy the forms */
- g_list_foreach (tmp->engine->formList, (GFunc)html_form_set_engine, html->engine);
+ g_list_foreach (tmp->engine->formList, (GFunc) html_form_set_engine, html->engine);
/* move top level iframes and embedded widgets from tmp to html */
html_object_forall (tmp->engine->clue, html->engine, reparent_embedded, html);
@@ -6486,7 +6486,7 @@ gtk_html_get_image_src_at (GtkHTML *html, gint x, gint y)
obj = html_engine_get_object_at (html->engine, x, y, (guint *) &offset, FALSE);
if (obj && HTML_IS_IMAGE (obj)) {
- HTMLImage *image = (HTMLImage*)obj;
+ HTMLImage *image = (HTMLImage*) obj;
if (!image->image_ptr)
return NULL;
@@ -6512,7 +6512,7 @@ gtk_html_get_cursor_image_src (GtkHTML *html)
obj = html_engine_get_focus_object (html->engine, &offset);
if (obj && HTML_IS_IMAGE (obj)) {
- HTMLImage *image = (HTMLImage*)obj;
+ HTMLImage *image = (HTMLImage*) obj;
if (!image->image_ptr)
return NULL;
diff --git a/gtkhtml/htmlclueflow.c b/gtkhtml/htmlclueflow.c
index fffae76..50e8fd3 100644
--- a/gtkhtml/htmlclueflow.c
+++ b/gtkhtml/htmlclueflow.c
@@ -2290,9 +2290,9 @@ search_text (HTMLObject **beg, HTMLSearch *info)
eq_bytes = 0;
if (info->found) {
if (info->start_pos > 0)
- index = ((guchar *)g_utf8_offset_to_pointer ((gchar *) par, info->start_pos + ((info->forward) ? 0 : -1))) - par;
+ index = ((guchar *) g_utf8_offset_to_pointer ((gchar *) par, info->start_pos + ((info->forward) ? 0 : -1))) - par;
else
- index = info->forward ? ((guchar *)g_utf8_offset_to_pointer ((gchar *) par, info->start_pos) - par) : -1;
+ index = info->forward ? ((guchar *) g_utf8_offset_to_pointer ((gchar *) par, info->start_pos) - par) : -1;
} else {
index = (info->forward) ? 0 : text_bytes;
}
@@ -2368,7 +2368,7 @@ search_text (HTMLObject **beg, HTMLSearch *info)
}
if (unicode_info == unicode_par) {
- eq_bytes += (guchar *)g_utf8_next_char (par + index) - par - index;
+ eq_bytes += (guchar *) g_utf8_next_char (par + index) - par - index;
if (eq_bytes == info->text_bytes) {
/* The above par + index is always at the beginning of the last character matched */
diff --git a/gtkhtml/htmldrawqueue.c b/gtkhtml/htmldrawqueue.c
index 85f5950..8d5c655 100644
--- a/gtkhtml/htmldrawqueue.c
+++ b/gtkhtml/htmldrawqueue.c
@@ -234,7 +234,7 @@ html_draw_queue_clear (HTMLDrawQueue *queue)
obj->redraw_pending = FALSE;
if (obj->free_pending) {
g_free (obj);
- p->data = (gpointer)0xdeadbeef;
+ p->data = (gpointer) 0xdeadbeef;
}
}
diff --git a/gtkhtml/htmlengine-save.c b/gtkhtml/htmlengine-save.c
index c6c1318..7ee37c6 100644
--- a/gtkhtml/htmlengine-save.c
+++ b/gtkhtml/htmlengine-save.c
@@ -403,7 +403,7 @@ html_engine_save_buffer_receiver (const HTMLEngine *engine,
guint len,
gpointer user_data)
{
- g_string_append ((GString *)user_data, (gchar *)data);
+ g_string_append ((GString *) user_data, (gchar *) data);
return TRUE;
}
@@ -415,7 +415,7 @@ html_engine_save_buffer_free (HTMLEngineSaveState *state, gboolean free_string)
gchar *rv = NULL;
g_return_val_if_fail (state != NULL, NULL);
- string = (GString *)state->user_data;
+ string = (GString *) state->user_data;
if (!free_string)
rv = string->str;
@@ -432,7 +432,7 @@ html_engine_save_buffer_peek_text (HTMLEngineSaveState *state)
GString *string;
g_return_val_if_fail (state != NULL, NULL);
- string = (GString *)state->user_data;
+ string = (GString *) state->user_data;
return (guchar *) string->str;
}
@@ -443,7 +443,7 @@ html_engine_save_buffer_peek_text_bytes (HTMLEngineSaveState *state)
GString *string;
g_return_val_if_fail (state != NULL, 0);
- string = (GString *)state->user_data;
+ string = (GString *) state->user_data;
return string->len;
}
@@ -455,7 +455,7 @@ html_engine_save_buffer_new (HTMLEngine *engine, gboolean inline_frames)
if (state) {
state->engine = engine;
- state->receiver = (HTMLEngineSaveReceiverFn)html_engine_save_buffer_receiver;
+ state->receiver = (HTMLEngineSaveReceiverFn) html_engine_save_buffer_receiver;
state->br_count = 0;
state->error = FALSE;
state->inline_frames = inline_frames;
diff --git a/gtkhtml/htmlengine.c b/gtkhtml/htmlengine.c
index 8be71c7..35e4df2 100644
--- a/gtkhtml/htmlengine.c
+++ b/gtkhtml/htmlengine.c
@@ -743,7 +743,7 @@ flow_new (HTMLEngine *e, HTMLClueFlowStyle style, HTMLListType item_type, gint i
if (e->listStack && e->listStack->list) {
l = e->listStack->list;
while (l) {
- guint8 val = ((HTMLList *)l->data)->type;
+ guint8 val = ((HTMLList *) l->data)->type;
g_byte_array_prepend (levels, &val, 1);
l = l->next;
@@ -3261,7 +3261,7 @@ push_clue_style_for_table (HTMLEngine *e)
push_clue_style (e);
html_stack_push (e->body_stack, e->listStack);
- e->listStack = html_stack_new ((HTMLStackFreeFunc)html_list_destroy);
+ e->listStack = html_stack_new ((HTMLStackFreeFunc) html_list_destroy);
}
static void
@@ -3332,7 +3332,7 @@ element_parse_table (HTMLEngine *e, HTMLObject *clue, const gchar *str)
html_element_set_coreattr_to_object (element, HTML_OBJECT (table), e);
if (element->style->bg_color)
- table->bgColor = gdk_color_copy ((GdkColor *)element->style->bg_color);
+ table->bgColor = gdk_color_copy ((GdkColor *) element->style->bg_color);
if (element->style->bg_image)
table->bgPixmap = html_image_factory_register (e->image_factory, NULL, element->style->bg_image, FALSE);
@@ -3356,7 +3356,7 @@ element_parse_table (HTMLEngine *e, HTMLObject *clue, const gchar *str)
padding, spacing, border));
if (element->style->bg_color)
- table->bgColor = gdk_color_copy ((GdkColor *)element->style->bg_color);
+ table->bgColor = gdk_color_copy ((GdkColor *) element->style->bg_color);
if (element->style->bg_image)
table->bgPixmap = html_image_factory_register (e->image_factory, NULL, element->style->bg_image, FALSE);
@@ -5762,7 +5762,7 @@ get_changed_objects (HTMLEngine *e, cairo_region_t *region, GList *changed_objs)
} else {
cur = cur->next;
if (e->window) {
- HTMLObjectClearRectangle *cr = (HTMLObjectClearRectangle *)cur->data;
+ HTMLObjectClearRectangle *cr = (HTMLObjectClearRectangle *) cur->data;
HTMLObject *o;
GdkRectangle paint;
gint tx, ty;
diff --git a/gtkhtml/htmlentity.c b/gtkhtml/htmlentity.c
index 7eea461..81d7331 100644
--- a/gtkhtml/htmlentity.c
+++ b/gtkhtml/htmlentity.c
@@ -120,20 +120,20 @@ hash (register const gchar *str, register guint len)
switch (hval)
{
default:
- hval += asso_values[(guchar)str[4]];
+ hval += asso_values[(guchar) str[4]];
/*FALLTHROUGH*/
case 4:
case 3:
- hval += asso_values[(guchar)str[2]];
+ hval += asso_values[(guchar) str[2]];
/*FALLTHROUGH*/
case 2:
- hval += asso_values[(guchar)str[1]+1];
+ hval += asso_values[(guchar) str[1]+1];
/*FALLTHROUGH*/
case 1:
- hval += asso_values[(guchar)str[0]];
+ hval += asso_values[(guchar) str[0]];
break;
}
- return hval + asso_values[(guchar)str[len - 1]];
+ return hval + asso_values[(guchar) str[len - 1]];
}
#ifdef __GNUC__
diff --git a/gtkhtml/htmlform.c b/gtkhtml/htmlform.c
index d0e685e..77bdc22 100644
--- a/gtkhtml/htmlform.c
+++ b/gtkhtml/htmlform.c
@@ -110,7 +110,7 @@ html_form_destroy (HTMLForm *form)
g_list_free (form->elements);
g_list_free (form->hidden);
- g_hash_table_foreach (form->radio_group, (GHFunc)destroy_radio, NULL);
+ g_hash_table_foreach (form->radio_group, (GHFunc) destroy_radio, NULL);
g_hash_table_destroy (form->radio_group);
g_free (form->action);
diff --git a/gtkhtml/htmlimage.c b/gtkhtml/htmlimage.c
index 48ebd09..802e974 100644
--- a/gtkhtml/htmlimage.c
+++ b/gtkhtml/htmlimage.c
@@ -1319,7 +1319,7 @@ html_image_pointer_new (const gchar *filename, HTMLImageFactory *factory)
retval->factory = factory;
retval->stall = FALSE;
retval->stall_timeout = g_timeout_add (STALL_INTERVAL,
- (GSourceFunc)html_image_pointer_timeout,
+ (GSourceFunc) html_image_pointer_timeout,
retval);
retval->animation_timeout = 0;
return retval;
@@ -1344,7 +1344,7 @@ html_image_pointer_timeout (HTMLImagePointer *ip)
*/
if (ip->animation == NULL) {
while (list) {
- image = (HTMLImage *)list->data;
+ image = (HTMLImage *) list->data;
if (image)
html_engine_queue_draw (ip->factory->engine,
diff --git a/gtkhtml/htmlobject.h b/gtkhtml/htmlobject.h
index 1c4cccd..305f33f 100644
--- a/gtkhtml/htmlobject.h
+++ b/gtkhtml/htmlobject.h
@@ -61,7 +61,7 @@ struct _HTMLObject {
guint selected : 1;
/* If an object has a redraw pending and is being destroyed, this flag
- is set to TRUE instead of g_free ()ing the object. When the draw
+ is set to TRUE instead of g_free () ing the object. When the draw
queue is flushed, the g_free () is performed. */
guint free_pending : 1;
diff --git a/gtkhtml/htmlpainter.c b/gtkhtml/htmlpainter.c
index adcdbba..dd2b432 100644
--- a/gtkhtml/htmlpainter.c
+++ b/gtkhtml/htmlpainter.c
@@ -1060,19 +1060,19 @@ html_pango_get_item_properties (PangoItem *item, HTMLPangoProperties *properties
switch (attr->klass->type) {
case PANGO_ATTR_UNDERLINE:
- properties->underline = ((PangoAttrInt *)attr)->value != PANGO_UNDERLINE_NONE;
+ properties->underline = ((PangoAttrInt *) attr)->value != PANGO_UNDERLINE_NONE;
break;
case PANGO_ATTR_STRIKETHROUGH:
- properties->strikethrough = ((PangoAttrInt *)attr)->value;
+ properties->strikethrough = ((PangoAttrInt *) attr)->value;
break;
case PANGO_ATTR_FOREGROUND:
- properties->fg_color = &((PangoAttrColor *)attr)->color;
+ properties->fg_color = &((PangoAttrColor *) attr)->color;
break;
case PANGO_ATTR_BACKGROUND:
- properties->bg_color = &((PangoAttrColor *)attr)->color;
+ properties->bg_color = &((PangoAttrColor *) attr)->color;
break;
default:
diff --git a/gtkhtml/htmlprinter.c b/gtkhtml/htmlprinter.c
index 0091dc5..0a55051 100644
--- a/gtkhtml/htmlprinter.c
+++ b/gtkhtml/htmlprinter.c
@@ -377,12 +377,12 @@ print_pixbuf (GtkPrintContext *pc, GdkPixbuf *pixbuf)
cr = gtk_print_context_get_cairo_context (pc);
if (gdk_pixbuf_get_has_alpha (pixbuf)) {
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
- cairo_rectangle (cr, 0, 0, (double)gdk_pixbuf_get_width (pixbuf), (double)gdk_pixbuf_get_height (pixbuf)); cairo_clip (cr);
+ cairo_rectangle (cr, 0, 0, (double) gdk_pixbuf_get_width (pixbuf), (double) gdk_pixbuf_get_height (pixbuf)); cairo_clip (cr);
cairo_paint (cr);
} else {
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
- cairo_rectangle (cr, 0, 0, (double)gdk_pixbuf_get_width (pixbuf), (double)gdk_pixbuf_get_height (pixbuf));
+ cairo_rectangle (cr, 0, 0, (double) gdk_pixbuf_get_width (pixbuf), (double) gdk_pixbuf_get_height (pixbuf));
cairo_clip (cr);
cairo_paint (cr);
}
@@ -405,7 +405,7 @@ draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, gint x, gint y, gint scale
print_scale_height = SCALE_ENGINE_TO_GNOME_PRINT (scale_height);
cairo_save (cr);
cairo_translate (cr, print_x, print_y);
- cairo_scale (cr, print_scale_width / (double)gdk_pixbuf_get_width (pixbuf), print_scale_height / (double)gdk_pixbuf_get_height (pixbuf));
+ cairo_scale (cr, print_scale_width / (double) gdk_pixbuf_get_width (pixbuf), print_scale_height / (double) gdk_pixbuf_get_height (pixbuf));
print_pixbuf (printer->context, pixbuf);
cairo_restore (cr);
}
diff --git a/gtkhtml/htmlshape.c b/gtkhtml/htmlshape.c
index f5cdc1d..dbf722a 100644
--- a/gtkhtml/htmlshape.c
+++ b/gtkhtml/htmlshape.c
@@ -108,7 +108,7 @@ html_shape_point (HTMLShape *shape, gint x, gint y)
gint j = 0;
gint odd = 0;
- HTMLLength **poly = (HTMLLength **)shape->coords->pdata;
+ HTMLLength **poly = (HTMLLength **) shape->coords->pdata;
/*
* TODO: Add support for percentage lengths, The information is stored
diff --git a/gtkhtml/htmltext.c b/gtkhtml/htmltext.c
index e4c5905..eed8218 100644
--- a/gtkhtml/htmltext.c
+++ b/gtkhtml/htmltext.c
@@ -2442,7 +2442,7 @@ append_selection_string (HTMLObject *self,
text->select_start + text->select_length);
*/
html_engine_save_string_append_nonbsp (buffer,
- (guchar *)p,
+ (guchar *) p,
last - p);
}
diff --git a/gtkhtml/test.c b/gtkhtml/test.c
index 5ad4b03..a9619ac 100644
--- a/gtkhtml/test.c
+++ b/gtkhtml/test.c
@@ -182,8 +182,8 @@ static gint
compare_examples (gconstpointer a,
gconstpointer b)
{
- const Example *example_a = *(const Example *const *)a;
- const Example *example_b = *(const Example *const *)b;
+ const Example *example_a = *(const Example *const *) a;
+ const Example *example_b = *(const Example *const *) b;
gchar *a_fold, *b_fold;
const guchar *p, *q;
gint result = 0;
@@ -196,8 +196,8 @@ compare_examples (gconstpointer a,
a_fold = g_utf8_casefold (example_a->title, -1);
b_fold = g_utf8_casefold (example_b->title, -1);
- p = (const guchar *)a_fold;
- q = (const guchar *)b_fold;
+ p = (const guchar *) a_fold;
+ q = (const guchar *) b_fold;
while (*p && *q) {
gboolean p_digit = g_ascii_isdigit (*p);
diff --git a/gtkhtml/testgtkhtml.c b/gtkhtml/testgtkhtml.c
index 20d379a..7de67ca 100644
--- a/gtkhtml/testgtkhtml.c
+++ b/gtkhtml/testgtkhtml.c
@@ -221,8 +221,8 @@ static gint
compare_examples (gconstpointer a,
gconstpointer b)
{
- const Example *example_a = *(const Example *const *)a;
- const Example *example_b = *(const Example *const *)b;
+ const Example *example_a = *(const Example *const *) a;
+ const Example *example_b = *(const Example *const *) b;
gchar *a_fold, *b_fold;
const guchar *p, *q;
gint result = 0;
@@ -235,8 +235,8 @@ compare_examples (gconstpointer a,
a_fold = g_utf8_casefold (example_a->title, -1);
b_fold = g_utf8_casefold (example_b->title, -1);
- p = (const guchar *)a_fold;
- q = (const guchar *)b_fold;
+ p = (const guchar *) a_fold;
+ q = (const guchar *) b_fold;
while (*p && *q) {
gboolean p_digit = g_ascii_isdigit (*p);
@@ -1018,7 +1018,7 @@ go_list_cb (GtkWidget *widget, gpointer data)
}
static void remove_go_list (gpointer data, gpointer user_data) {
- go_item *item = (go_item *)data;
+ go_item *item = (go_item *) data;
if (item->widget)
gtk_widget_destroy (item->widget);
@@ -1045,7 +1045,7 @@ goto_url (const gchar *url, gint back_or_forward)
}
/* TODO2 animator start */
- html_stream_handle = gtk_html_begin_content (html, (gchar *)gtk_html_get_default_content_type (html));
+ html_stream_handle = gtk_html_begin_content (html, (gchar *) gtk_html_get_default_content_type (html));
/* Yuck yuck yuck. Well this code is butt-ugly already
anyway. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]