[gtkhtml] Fix dead assignments found by clang.
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtkhtml] Fix dead assignments found by clang.
- Date: Fri, 15 Jan 2010 04:13:59 +0000 (UTC)
commit 16c2ce11376f62f3d3f9324fc5b5e73f71571169
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jan 14 22:45:26 2010 -0500
Fix dead assignments found by clang.
a11y/object.c | 13 +++++--------
components/editor/gtkhtml-editor-private.c | 4 ----
components/editor/gtkhtml-editor-signals.c | 4 +---
components/editor/gtkhtml-face-chooser-menu.c | 6 ------
components/editor/gtkhtml-spell-dialog.c | 2 --
gtkhtml/gtkhtml.c | 3 +--
gtkhtml/htmlclueflow.c | 4 ++--
gtkhtml/htmlclueh.c | 2 --
gtkhtml/htmlcluev.c | 8 ++++----
gtkhtml/htmlcursor.c | 2 --
gtkhtml/htmlengine-print.c | 1 -
gtkhtml/htmlengine.c | 7 +++----
gtkhtml/htmlgdkpainter.c | 6 +++---
gtkhtml/htmlpainter.c | 2 +-
gtkhtml/htmlprinter.c | 2 --
gtkhtml/htmltext.c | 11 +++++------
gtkhtml/htmltextslave.c | 2 +-
gtkhtml/htmltokenizer.c | 3 ---
gtkhtml/htmlundo.c | 11 +++++++----
19 files changed, 33 insertions(+), 60 deletions(-)
---
diff --git a/a11y/object.c b/a11y/object.c
index 6de0c5a..41d2c8e 100644
--- a/a11y/object.c
+++ b/a11y/object.c
@@ -320,11 +320,10 @@ gtk_html_a11y_grab_focus_cb(GtkWidget * widget)
static void
gtk_html_a11y_cursor_changed_cb (GtkWidget *widget)
{
- AtkObject *focus_object, *obj;
+ AtkObject *focus_object;
focus_object = gtk_html_a11y_get_focus_object (widget);
g_return_if_fail (focus_object != NULL);
- obj = gtk_widget_get_accessible (widget);
if (gtk_html_a11y_focus_object != focus_object) {
gtk_html_a11y_focus_object = focus_object;
@@ -335,18 +334,17 @@ gtk_html_a11y_cursor_changed_cb (GtkWidget *widget)
offset = (GTK_HTML(widget))->engine->cursor->offset;
g_signal_emit_by_name(focus_object, "text_caret_moved",offset);
- }
- }
+ }
+ }
}
static void
gtk_html_a11y_insert_object_cb (GtkWidget * widget, gint pos, gint len)
{
- AtkObject * a11y, *obj;
+ AtkObject * a11y;
HTMLCursor *cursor = GTK_HTML (widget)->engine->cursor;
- obj = gtk_widget_get_accessible (widget);
a11y = gtk_html_a11y_get_focus_object (widget);
g_return_if_fail (a11y != NULL);
@@ -364,9 +362,8 @@ gtk_html_a11y_insert_object_cb (GtkWidget * widget, gint pos, gint len)
static void
gtk_html_a11y_delete_object_cb (GtkWidget * widget, gint pos, gint len)
{
- AtkObject * a11y, *obj;
+ AtkObject * a11y;
- obj = gtk_widget_get_accessible (widget);
a11y = gtk_html_a11y_get_focus_object (widget);
g_return_if_fail (a11y != NULL);
diff --git a/components/editor/gtkhtml-editor-private.c b/components/editor/gtkhtml-editor-private.c
index beac781..0fed468 100644
--- a/components/editor/gtkhtml-editor-private.c
+++ b/components/editor/gtkhtml-editor-private.c
@@ -600,15 +600,11 @@ gtkhtml_editor_spell_check (GtkhtmlEditor *editor,
gboolean whole_document)
{
GtkHTML *html;
- guint position;
- gboolean inline_spelling;
gboolean spelling_errors;
g_return_if_fail (GTKHTML_IS_EDITOR (editor));
html = gtkhtml_editor_get_html (editor);
- position = html->engine->cursor->position;
- inline_spelling = gtk_html_get_inline_spelling (html);
if (whole_document) {
html_engine_disable_selection (html->engine);
diff --git a/components/editor/gtkhtml-editor-signals.c b/components/editor/gtkhtml-editor-signals.c
index 1d35750..38249a9 100644
--- a/components/editor/gtkhtml-editor-signals.c
+++ b/components/editor/gtkhtml-editor-signals.c
@@ -111,11 +111,9 @@ cell_properties_set_table (GtkhtmlEditor *editor,
{
GtkHTML *html;
HTMLObject *parent;
- HTMLTableCell *cell;
HTMLTableCell *iter;
html = gtkhtml_editor_get_html (editor);
- cell = HTML_TABLE_CELL (editor->priv->cell_object);
parent = editor->priv->cell_parent;
iter = html_engine_get_table_cell (html->engine);
@@ -253,7 +251,7 @@ cell_properties_set_horizontal_alignment_cb (GtkhtmlEditor *editor,
active = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
align = HTML_HALIGN_LEFT + (HTMLHAlignType) active;
- html_engine_table_cell_set_halign (html->engine, cell, active);
+ html_engine_table_cell_set_halign (html->engine, cell, align);
}
static void
diff --git a/components/editor/gtkhtml-face-chooser-menu.c b/components/editor/gtkhtml-face-chooser-menu.c
index 573e05e..86c2f23 100644
--- a/components/editor/gtkhtml-face-chooser-menu.c
+++ b/components/editor/gtkhtml-face-chooser-menu.c
@@ -73,11 +73,8 @@ face_chooser_menu_get_property (GObject *object,
static GtkhtmlFace *
face_chooser_menu_get_current_face (GtkhtmlFaceChooser *chooser)
{
- GtkhtmlFaceChooserMenuPrivate *priv;
GtkWidget *item;
- priv = GTKHTML_FACE_CHOOSER_MENU_GET_PRIVATE (chooser);
-
item = gtk_menu_get_active (GTK_MENU (chooser));
if (item == NULL)
return NULL;
@@ -89,11 +86,8 @@ static void
face_chooser_menu_set_current_face (GtkhtmlFaceChooser *chooser,
GtkhtmlFace *face)
{
- GtkhtmlFaceChooserMenuPrivate *priv;
GList *list, *iter;
- priv = GTKHTML_FACE_CHOOSER_MENU_GET_PRIVATE (chooser);
-
list = gtk_container_get_children (GTK_CONTAINER (chooser));
for (iter = list; iter != NULL; iter = iter->next) {
diff --git a/components/editor/gtkhtml-spell-dialog.c b/components/editor/gtkhtml-spell-dialog.c
index cdb3f5b..84e33d3 100644
--- a/components/editor/gtkhtml-spell-dialog.c
+++ b/components/editor/gtkhtml-spell-dialog.c
@@ -417,7 +417,6 @@ spell_dialog_init (GtkhtmlSpellDialog *dialog)
GtkTreeSelection *selection;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- GtkWidget *action_area;
GtkWidget *container;
GtkWidget *content_area;
GtkWidget *table;
@@ -440,7 +439,6 @@ spell_dialog_init (GtkhtmlSpellDialog *dialog)
/* Build the widgets. */
- action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_dialog_add_button (
diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
index 8815944..ebb908b 100644
--- a/gtkhtml/gtkhtml.c
+++ b/gtkhtml/gtkhtml.c
@@ -1533,7 +1533,7 @@ skip_host (const gchar *url)
host++;
if (*host == ':') {
- url = host++;
+ host++;
if (*host == '/')
host++;
@@ -4729,7 +4729,6 @@ scroll (GtkHTML *html,
break;
default:
g_warning ("invalid scroll parameters: %d %d %f\n", orientation, scroll_type, position);
- delta = 0.0;
return;
}
diff --git a/gtkhtml/htmlclueflow.c b/gtkhtml/htmlclueflow.c
index a042d30..116b244 100644
--- a/gtkhtml/htmlclueflow.c
+++ b/gtkhtml/htmlclueflow.c
@@ -1805,7 +1805,7 @@ save (HTMLObject *s,
if (HTML_IS_CLUEFLOW (HTML_OBJECT (self)->prev))
prev = HTML_CLUEFLOW (HTML_OBJECT (self)->prev);
- d = i = get_similar_depth (self, prev);
+ i = get_similar_depth (self, prev);
while (i < self->levels->len) {
const gchar *stag = get_start_indent_item (self->levels->data[i]);
@@ -2255,7 +2255,7 @@ search_text (HTMLObject **beg, HTMLSearch *info)
pp = (info->forward) ? par : par + text_bytes;
/* now fill par with text */
- head = cur = (info->forward) ? *beg : end;
+ head = (info->forward) ? *beg : end;
cur = *beg;
while (cur) {
if (html_object_is_text (cur)) {
diff --git a/gtkhtml/htmlclueh.c b/gtkhtml/htmlclueh.c
index 64c1841..df37b09 100644
--- a/gtkhtml/htmlclueh.c
+++ b/gtkhtml/htmlclueh.c
@@ -66,8 +66,6 @@ html_clueh_real_calc_size (HTMLObject *clue, HTMLPainter *painter, GList **chang
gint a = 0, d = 0;
gboolean changed;
- changed = FALSE;
-
/* Make sure the children are properly sized */
html_object_set_max_width (clue, painter, clue->max_width);
diff --git a/gtkhtml/htmlcluev.c b/gtkhtml/htmlcluev.c
index ee8c120..3d3c874 100644
--- a/gtkhtml/htmlcluev.c
+++ b/gtkhtml/htmlcluev.c
@@ -486,8 +486,8 @@ check_point (HTMLObject *self,
parent = HTML_OBJECT (clue)->parent;
obj = html_object_check_point (HTML_OBJECT (clue),
painter,
- x - HTML_OBJECT (clue)->parent->x,
- y - HTML_OBJECT (clue)->parent->y + HTML_OBJECT (clue)->parent->ascent,
+ x - parent->x,
+ y - parent->y + parent->ascent,
offset_return,
for_cursor);
if (obj != NULL) {
@@ -503,8 +503,8 @@ check_point (HTMLObject *self,
parent = HTML_OBJECT (clue)->parent;
obj = html_object_check_point (HTML_OBJECT (clue),
painter,
- x - HTML_OBJECT (clue)->parent->x,
- y - HTML_OBJECT (clue)->parent->y + HTML_OBJECT (clue)->parent->ascent,
+ x - parent->x,
+ y - parent->y + parent->ascent,
offset_return,
for_cursor);
if (obj != NULL) {
diff --git a/gtkhtml/htmlcursor.c b/gtkhtml/htmlcursor.c
index df26625..8f4782c 100644
--- a/gtkhtml/htmlcursor.c
+++ b/gtkhtml/htmlcursor.c
@@ -1050,7 +1050,6 @@ left_in_flow (HTMLCursor *cursor, HTMLEngine *e)
{
gboolean retval;
- retval = TRUE;
if (cursor->offset != html_object_get_left_edge_offset (cursor->object, e->painter, cursor->offset) && html_object_is_container (cursor->object)) {
HTMLObject *obj;
@@ -1163,7 +1162,6 @@ right_in_flow (HTMLCursor *cursor, HTMLEngine *e)
{
gboolean retval;
- retval = TRUE;
if (cursor->offset != html_object_get_right_edge_offset (cursor->object, e->painter, cursor->offset)) {
if (html_object_is_container (cursor->object)) {
HTMLObject *obj;
diff --git a/gtkhtml/htmlengine-print.c b/gtkhtml/htmlengine-print.c
index 17237e6..07dc261 100644
--- a/gtkhtml/htmlengine-print.c
+++ b/gtkhtml/htmlengine-print.c
@@ -328,7 +328,6 @@ engine_print_begin_print (GtkPrintOperation *operation,
}
page_height = html_printer_get_page_height (printer);
- page_width = html_printer_get_page_width (printer);
if (data->calc_header_height != NULL)
data->header_height = data->calc_header_height (
diff --git a/gtkhtml/htmlengine.c b/gtkhtml/htmlengine.c
index 77e3e0d..01775b3 100644
--- a/gtkhtml/htmlengine.c
+++ b/gtkhtml/htmlengine.c
@@ -235,7 +235,6 @@ parse_element_name (const gchar *str)
{
const gchar *ep = str;
- ep = str;
if (*ep == '/')
ep++;
@@ -1080,7 +1079,7 @@ pop_block (HTMLEngine *e, HTMLElement *elem)
HTMLElement *cur = l->data;
if (cur == elem) {
- l = remove_element (e, l);
+ remove_element (e, l);
return;
} else if (cur->style->display != DISPLAY_INLINE || elem->style->display > DISPLAY_BLOCK) {
l = remove_element (e, l);
@@ -1105,7 +1104,7 @@ pop_inline (HTMLEngine *e, HTMLElement *elem)
break;
if (cur == elem) {
- l = remove_element (e, l);
+ remove_element (e, l);
return;
} else {
l = l->next;
@@ -1526,7 +1525,7 @@ parse_object_params(HTMLEngine *p, HTMLObject *clue)
if (*str == '\0' ||
*str == '\n' ||
is_leading_space ((guchar *) str)) {
- str = html_tokenizer_next_token (p->ht);
+ /* str = html_tokenizer_next_token (p->ht); */
/* printf ("\"%s\": was the string\n", str); */
continue;
} else if (*str == TAG_ESCAPE) {
diff --git a/gtkhtml/htmlgdkpainter.c b/gtkhtml/htmlgdkpainter.c
index 4d24365..b361c66 100644
--- a/gtkhtml/htmlgdkpainter.c
+++ b/gtkhtml/htmlgdkpainter.c
@@ -603,13 +603,13 @@ draw_pixmap (HTMLPainter *painter,
255);
if (color != NULL) {
- guchar *p, *q;
+ guchar *q;
guint i, j;
n_channels = gdk_pixbuf_get_n_channels (tmp_pixbuf);
- p = q = gdk_pixbuf_get_pixels (tmp_pixbuf);
+ q = gdk_pixbuf_get_pixels (tmp_pixbuf);
for (i = 0; i < paint.height; i++) {
- p = q;
+ guchar *p = q;
for (j = 0; j < paint.width; j++) {
gint r, g, b, a;
diff --git a/gtkhtml/htmlpainter.c b/gtkhtml/htmlpainter.c
index dc6adfe..5080ed0 100644
--- a/gtkhtml/htmlpainter.c
+++ b/gtkhtml/htmlpainter.c
@@ -140,7 +140,7 @@ text_width (HTMLPainter *painter, PangoFontDescription *desc, const gchar *text,
if (pi && glyphs) {
GList *list;
gint i;
- for (list = glyphs, i = 0; list; list = list->next->next, i++) {
+ for (list = glyphs; list; list = list->next->next) {
PangoGlyphString *str = (PangoGlyphString *) list->data;
for (i=0; i < str->num_glyphs; i ++)
width += str->glyphs [i].geometry.width;
diff --git a/gtkhtml/htmlprinter.c b/gtkhtml/htmlprinter.c
index d510f39..374a498 100644
--- a/gtkhtml/htmlprinter.c
+++ b/gtkhtml/htmlprinter.c
@@ -394,13 +394,11 @@ draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, gint x, gint y, gint scale
HTMLPrinter *printer;
double print_x, print_y;
double print_scale_width, print_scale_height;
- double page_height;
cairo_t *cr;
printer = HTML_PRINTER (painter);
g_return_if_fail (printer->context != NULL);
cr = gtk_print_context_get_cairo_context (printer->context);
- page_height =(double) gtk_print_context_get_height (printer->context);
print_x = SCALE_ENGINE_TO_GNOME_PRINT (x);
print_y = SCALE_ENGINE_TO_GNOME_PRINT (y);
print_scale_width = SCALE_ENGINE_TO_GNOME_PRINT (scale_width);
diff --git a/gtkhtml/htmltext.c b/gtkhtml/htmltext.c
index 584db26..8d24c6f 100644
--- a/gtkhtml/htmltext.c
+++ b/gtkhtml/htmltext.c
@@ -946,7 +946,7 @@ html_text_calc_part_width (HTMLText *text, HTMLPainter *painter, gchar *start, g
HTMLTextPangoInfo *pi;
PangoLanguage *language = NULL;
PangoFont *font = NULL;
- gchar *s = start;
+ gchar *s;
if (offset < 0)
return 0;
@@ -969,6 +969,8 @@ html_text_calc_part_width (HTMLText *text, HTMLPainter *painter, gchar *start, g
if (start == NULL)
start = html_text_get_text (text, offset);
+ s = start;
+
pi = html_text_get_pango_info (text, painter);
idx = html_text_get_item_index (text, painter, offset, &offset);
@@ -2632,7 +2634,7 @@ html_text_cursor_backward (HTMLObject *self, HTMLCursor *cursor, HTMLEngine *eng
{
HTMLText *text;
HTMLTextPangoInfo *pi = NULL;
- gint len, attrpos = 0;
+ gint attrpos = 0;
gboolean retval = FALSE;
g_assert (self);
@@ -2643,7 +2645,6 @@ html_text_cursor_backward (HTMLObject *self, HTMLCursor *cursor, HTMLEngine *eng
text = HTML_TEXT (self);
pi = html_text_get_pango_info (text, engine->painter);
- len = html_object_get_length (self);
do {
attrpos = cursor->offset;
if (cursor->offset > 1 ||
@@ -3229,10 +3230,8 @@ html_text_magic_link (HTMLText *text, HTMLEngine *engine, guint offset)
offset--;
}
- if (uc == ' ' || uc == ENTITY_NBSP) {
+ if (uc == ' ' || uc == ENTITY_NBSP)
str = g_utf8_next_char (str);
- offset++;
- }
if (exec) {
for (i = 0; i < G_N_ELEMENTS (mim); i++) {
diff --git a/gtkhtml/htmltextslave.c b/gtkhtml/htmltextslave.c
index bbda4a0..bbfa7d3 100644
--- a/gtkhtml/htmltextslave.c
+++ b/gtkhtml/htmltextslave.c
@@ -1169,7 +1169,7 @@ html_text_slave_get_glyph_item_at_offset (HTMLTextSlave *slave, HTMLPainter *pai
GSList *cur;
gint index;
- prev_gi = next_gi = NULL;
+ next_gi = NULL;
index = g_utf8_offset_to_pointer (html_text_slave_get_text (slave), offset) - slave->owner->text;
if (index_out)
diff --git a/gtkhtml/htmltokenizer.c b/gtkhtml/htmltokenizer.c
index c033454..192e438 100644
--- a/gtkhtml/htmltokenizer.c
+++ b/gtkhtml/htmltokenizer.c
@@ -1262,8 +1262,6 @@ in_crlf (HTMLTokenizer *t, const gchar **src)
static void
in_space_or_tab (HTMLTokenizer *t, const gchar **src)
{
- gchar *ptr;
-
if (t->priv->tquote) {
if (t->priv->discard == NoneDiscard)
t->priv->pending = SpacePending;
@@ -1272,7 +1270,6 @@ in_space_or_tab (HTMLTokenizer *t, const gchar **src)
t->priv->searchCount = 0; /* Stop looking for <!-- sequence */
if (t->priv->discard == NoneDiscard)
t->priv->pending = SpacePending;
- ptr = t->priv->buffer;
}
else if (t->priv->pre || t->priv->textarea) {
if (t->priv->pending)
diff --git a/gtkhtml/htmlundo.c b/gtkhtml/htmlundo.c
index 0be0679..92973ba 100644
--- a/gtkhtml/htmlundo.c
+++ b/gtkhtml/htmlundo.c
@@ -442,10 +442,13 @@ redo_level_end (HTMLUndo *undo)
/* we use position from last redo action on the stack */
action = (HTMLUndoAction *) save_redo.stack->data;
- html_undo_add_redo_action (undo, action = html_undo_action_new (level->description [HTML_UNDO_REDO],
- undo_step_action,
- HTML_UNDO_DATA (level),
- action->position, action->position_after));
+ action = html_undo_action_new (
+ level->description[HTML_UNDO_REDO],
+ undo_step_action,
+ HTML_UNDO_DATA (level),
+ action->position,
+ action->position_after);
+ html_undo_add_redo_action (undo, action);
#ifdef UNDO_DEBUG
action->is_level = TRUE;
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]