[gcalctool] Fix compiler warnings



commit 1408c5e27dd2aa164523597d57b888ecdaa15f89
Author: Robert Ancell <robert ancell gmail com>
Date:   Fri Apr 16 17:28:35 2010 -0700

    Fix compiler warnings

 src/gcalctool.c        |    5 ++---
 src/math-buttons.c     |   20 +-------------------
 src/math-display.c     |    2 +-
 src/math-equation.c    |   29 ++---------------------------
 src/math-equation.h    |    7 ++++---
 src/math-preferences.c |    1 -
 src/math-window.c      |    2 --
 src/mp-equation.c      |    1 -
 8 files changed, 10 insertions(+), 57 deletions(-)
---
diff --git a/src/gcalctool.c b/src/gcalctool.c
index 3862e02..359bb14 100644
--- a/src/gcalctool.c
+++ b/src/gcalctool.c
@@ -338,10 +338,9 @@ int
 main(int argc, char **argv)
 {
     MathEquation *equation;
-    int accuracy = 9, base = 10, word_size = 64;
-    gchar *angle_units;
+    int accuracy = 9, word_size = 64;
     gboolean show_tsep = FALSE, show_zeroes = FALSE;
-    gchar *number_format, *angle_unit, *button_mode;
+    gchar *number_format, *angle_units, *button_mode;
   
     g_type_init();
 
diff --git a/src/math-buttons.c b/src/math-buttons.c
index db9c880..06fcd49 100644
--- a/src/math-buttons.c
+++ b/src/math-buttons.c
@@ -316,24 +316,6 @@ math_buttons_new(MathEquation *equation)
 }
 
 
-static GtkWidget *
-get_buttons(MathButtons *buttons, ButtonMode mode)
-{
-    switch (mode) {
-    case BASIC:
-        return buttons->priv->bas_panel;
-    case ADVANCED:
-        return buttons->priv->adv_panel;
-    case FINANCIAL:
-        return buttons->priv->fin_panel;
-    case PROGRAMMING:
-        return buttons->priv->prog_panel;
-    }
-  
-    return NULL;
-}
-
-
 static void
 set_tint (GtkWidget *widget, GdkColor *tint, gint alpha)
 {
@@ -1218,7 +1200,7 @@ character_code_dialog_response_cb(GtkWidget *dialog, gint response_id, MathButto
                 break;
         }
 
-        math_equation_insert_number(buttons->priv->equation, text);
+        math_equation_insert(buttons->priv->equation, text);
     }
 
     gtk_widget_hide(dialog);
diff --git a/src/math-display.c b/src/math-display.c
index 3452a17..8c37b59 100644
--- a/src/math-display.c
+++ b/src/math-display.c
@@ -243,7 +243,7 @@ status_changed_cb(MathEquation *equation, GParamSpec *spec, MathDisplay *display
 static void
 create_gui(MathDisplay *display)
 {
-    GtkWidget *event_box, *info_view;
+    GtkWidget *info_view;
     PangoFontDescription *font_desc;
   
     g_signal_connect(display, "key-press-event", G_CALLBACK(key_press_cb), display);
diff --git a/src/math-equation.c b/src/math-equation.c
index 416cf81..7dc2ab7 100644
--- a/src/math-equation.c
+++ b/src/math-equation.c
@@ -346,7 +346,7 @@ math_equation_get_accuracy(MathEquation *equation)
 void
 math_equation_set_show_thousands_separators(MathEquation *equation, gboolean visible)
 {
-    if (equation->priv->show_tsep && visible || !equation->priv->show_tsep && !visible)
+    if ((equation->priv->show_tsep && visible) || (!equation->priv->show_tsep && !visible))
         return;
     equation->priv->show_tsep = visible;
     reformat_display(equation);
@@ -364,7 +364,7 @@ math_equation_get_show_thousands_separators(MathEquation *equation)
 void
 math_equation_set_show_trailing_zeroes(MathEquation *equation, gboolean visible)
 {
-    if (equation->priv->show_zeroes && visible || !equation->priv->show_zeroes && !visible)
+    if ((equation->priv->show_zeroes && visible) || (!equation->priv->show_zeroes && !visible))
         return;
     equation->priv->show_zeroes = visible;
     reformat_display(equation);
@@ -1066,24 +1066,6 @@ math_equation_toggle_bit(MathEquation *equation, guint bit)
 }
 
 
-static gboolean
-display_get_integer(MathEquation *equation, gint64 *value)
-{
-    MPNumber t, min, max;
-
-    if (!math_equation_get_number(equation, &t))
-        return FALSE;
-
-    mp_set_from_integer(G_MININT64, &min);
-    mp_set_from_integer(G_MAXINT64, &max);
-    if (mp_is_less_than(&t, &min) || mp_is_greater_than(&t, &max))
-        return FALSE;
-
-    *value = mp_cast_to_int(&t);
-    return TRUE;
-}
-
-
 /* Convert engineering or scientific number in the given base. */
 // FIXME: Move into mp-convert.c
 static void
@@ -1391,13 +1373,6 @@ math_equation_class_init (MathEquationClass *klass)
 
 
 static void
-solve_cb (MathEquation *equation)
-{
-    math_equation_solve(equation);
-}
-
-
-static void
 pre_insert_text_cb (MathEquation  *equation,
                     GtkTextIter   *location,
                     gchar         *text,
diff --git a/src/math-equation.h b/src/math-equation.h
index 688aca7..a79943d 100644
--- a/src/math-equation.h
+++ b/src/math-equation.h
@@ -90,13 +90,13 @@ DisplayFormat math_equation_get_number_format(MathEquation *equation);
 void math_equation_set_word_size(MathEquation *equation, int word_size);
 int math_equation_get_word_size(MathEquation *equation);
 
-void math_equation_set_angle_unit(MathEquation *equation, MPAngleUnit angle_unit);
-MPAngleUnit math_equation_get_angle_unit(MathEquation *equation);
+void math_equation_set_angle_units(MathEquation *equation, MPAngleUnit angle_unit);
+MPAngleUnit math_equation_get_angle_units(MathEquation *equation);
 
 void math_equation_copy(MathEquation *equation);
 void math_equation_paste(MathEquation *equation);
 void math_equation_undo(MathEquation *equation);
-//FIXMEvoid math_equation_redo(MathEquation *equation);
+void math_equation_redo(MathEquation *equation);
 void math_equation_store(MathEquation *equation, const gchar *name);
 void math_equation_recall(MathEquation *equation, const gchar *name);
 void math_equation_set(MathEquation *equation, const gchar *text);
@@ -104,6 +104,7 @@ void math_equation_set_number(MathEquation *equation, const MPNumber *x);
 void math_equation_insert(MathEquation *equation, const gchar *text);
 void math_equation_insert_digit(MathEquation *equation, guint digit);
 void math_equation_insert_numeric_point(MathEquation *equation);
+void math_equation_insert_number(MathEquation *equation, const MPNumber *x);
 void math_equation_insert_subtract(MathEquation *equation);
 void math_equation_insert_exponent(MathEquation *equation);
 void math_equation_solve(MathEquation *equation);
diff --git a/src/math-preferences.c b/src/math-preferences.c
index ee25c30..243b54b 100644
--- a/src/math-preferences.c
+++ b/src/math-preferences.c
@@ -151,7 +151,6 @@ set_combo_box_from_int(GtkWidget *combo, int value)
 
     while (valid) {
         gint v;
-        gboolean matched = FALSE;
 
         gtk_tree_model_get(model, &iter, 1, &v, -1);
         if (v == value)
diff --git a/src/math-window.c b/src/math-window.c
index 2c29740..893c896 100644
--- a/src/math-window.c
+++ b/src/math-window.c
@@ -401,8 +401,6 @@ create_gui(MathWindow *window)
 {
     GtkWidget *main_vbox, *vbox;
     GtkWidget *scrolled_window;
-    GError *error = NULL;
-    int i;
 
     main_vbox = gtk_vbox_new(FALSE, 0);
     gtk_container_add(GTK_CONTAINER(window), main_vbox);
diff --git a/src/mp-equation.c b/src/mp-equation.c
index 8ac80bc..d443fb4 100644
--- a/src/mp-equation.c
+++ b/src/mp-equation.c
@@ -118,7 +118,6 @@ static int
 function_is_defined(MPEquationParserState *state, const char *name)
 {
     char *c, *lower_name;
-    int result = 1;
 
     lower_name = strdup(name);
     for (c = lower_name; *c; c++)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]