[genius] Fri Jul 29 09:03:53 2011 Jiri (George) Lebl <jirka 5z com>



commit 0f1dee0fcfd4d438dc8703b45288af4b0da051bc
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Fri Jul 29 09:04:06 2011 -0700

    Fri Jul 29 09:03:53 2011  Jiri (George) Lebl <jirka 5z com>
    
    	* src/eval.c, src/funclib.c, src/dict.c, src/calc.c,
    	  src/inter.c: Apply modified patch from Vincent Untz to fix
    	  compilation warnings
    
    	* */Makefile.am: use WARN_CFLAGS
    
    	* src/ve-miscui.c, src/ve-misc.h, src/matrixw.[ch], src/graphing.c,
    	  src/gnome-genius.c, src/genius-readline-helper.c, src/funclib.c:
    	  Fix warnings and fix a crasher bug in the process

 ChangeLog                    |   12 ++++++++++++
 NEWS                         |    6 ++++++
 gtkextra/Makefile.am         |    1 +
 src/Makefile.am              |    1 +
 src/calc.c                   |    2 +-
 src/compil.c                 |    4 ++--
 src/dict.c                   |    2 --
 src/eval.c                   |   20 +++++++-------------
 src/funclib.c                |    5 ++---
 src/genius-readline-helper.c |    3 +--
 src/gnome-genius.c           |    9 +++++----
 src/graphing.c               |    6 ++----
 src/inter.c                  |    3 +--
 src/matrixw.c                |   14 +++++---------
 src/matrixw.h                |   20 ++++++++++----------
 ve/Makefile.am               |    1 +
 ve/ve-misc.h                 |    1 +
 ve/ve-miscui.c               |    1 -
 18 files changed, 58 insertions(+), 53 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5e80204..660d620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Fri Jul 29 09:03:53 2011  Jiri (George) Lebl <jirka 5z com>
+
+	* src/eval.c, src/funclib.c, src/dict.c, src/calc.c,
+	  src/inter.c: Apply modified patch from Vincent Untz to fix
+	  compilation warnings
+
+	* */Makefile.am: use WARN_CFLAGS
+
+	* src/ve-miscui.c, src/ve-misc.h, src/matrixw.[ch], src/graphing.c,
+	  src/gnome-genius.c, src/genius-readline-helper.c, src/funclib.c:
+	  Fix warnings and fix a crasher bug in the process
+
 Thu Jul 28 12:44:05 2011  Jiri (George) Lebl <jirka 5z com>
 
 	* Release 1.0.13
diff --git a/NEWS b/NEWS
index cb8f59d..d34ce23 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Changes to 1.0.14
+
+* Fix some compilation warnings (Vincent Untz, me)
+* Fix a crasher
+* Optimize and quantize the new pngs for a smaller file
+
 Changes to 1.0.13
 
 * Add ShuffleVector
diff --git a/gtkextra/Makefile.am b/gtkextra/Makefile.am
index 73205c6..8df7bf5 100644
--- a/gtkextra/Makefile.am
+++ b/gtkextra/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = \
 	-I$(top_builddir)/ve					\
 	-I$(top_builddir)/gtkextra				\
 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\"		\
+	$(WARN_CFLAGS)						\
 	$(GENIUS_CFLAGS)
 
 AM_CFLAGS = $(PGO_CFLAGS)
diff --git a/src/Makefile.am b/src/Makefile.am
index ac9793b..392546a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,6 +22,7 @@ INCLUDES = \
 	-I$(top_builddir)/ve					\
 	-I$(top_builddir)/gtkextra				\
 	-I$(includedir)						\
+	$(WARN_CFLAGS)						\
 	$(BINRELOC_CFLAGS)					\
 	$(GMP_INCLUDEDIR)					\
 	$(GENIUS_CFLAGS)					\
diff --git a/src/calc.c b/src/calc.c
index 89501e4..80b4f40 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -1997,7 +1997,7 @@ load_compiled_fp (const char *file, FILE *fp)
 		GelToken *tok, *symbolic_tok = NULL;
 		int size, nargs, vararg, propagate_mod, no_mod_all_args;
 		int local_all, never_on_subst_list, built_subst_dict;
-		GSList *local_idents, *subst_dict;
+		GSList *local_idents = NULL, *subst_dict = NULL;
 		gboolean extra_dict = FALSE;
 		gboolean parameter = FALSE;
 		int i;
diff --git a/src/compil.c b/src/compil.c
index 785e306..74d8515 100644
--- a/src/compil.c
+++ b/src/compil.c
@@ -48,7 +48,7 @@ gel_decode_string (const char *s)
 		return g_strdup (&(s[1]));
 	} else if (s[0] == 'B') {
 		gsize len;
-		char *p = g_base64_decode (&(s[1]), &len);
+		char *p = (char *)g_base64_decode (&(s[1]), &len);
 		if (p == NULL || len < 0) /* error was probably logged by now */
 			return NULL;
 		p = g_realloc (p, len+1);
@@ -85,7 +85,7 @@ gel_encode_string (const char *s)
 	if (is_ok_ascii (s)) {
 		return g_strconcat ("A", s, NULL);
 	} else {
-		char *p = g_base64_encode (s, strlen (s));
+		char *p = g_base64_encode ((const unsigned char *)s, strlen (s));
 		char *ret = g_strconcat ("B", p, NULL);
 		g_free (p);
 		return ret;
diff --git a/src/dict.c b/src/dict.c
index 6f3572a..123355b 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -439,7 +439,6 @@ d_lookup_local(GelToken *id)
 GelEFunc *
 d_lookup_global_up1(GelToken *id)
 {
-	GelEFunc *func;
 	GSList *li;
 
 	if G_UNLIKELY (id == NULL || id->refs == NULL)
@@ -485,7 +484,6 @@ d_lookup_only_global (GelToken *id)
 GelEFunc *
 d_lookup_global (GelToken *id)
 {
-	GelEFunc *func;
 	GSList *li;
 	
 	if G_UNLIKELY (id == NULL || id->refs == NULL)
diff --git a/src/eval.c b/src/eval.c
index bd0b9a1..2f08244 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1764,15 +1764,12 @@ matrix_scalar_matrix_op(GelCtx *ctx, GelETree *n, GelETree *l, GelETree *r)
 	GelMatrixW *m;
 	GelETree *node;
 	int order = 0;
-	int quote = 0;
 	if(l->type == GEL_MATRIX_NODE) {
 		m = l->mat.matrix;
-		quote = l->mat.quoted;
 		node = r;
 	} else {
 		order = 1;
 		m = r->mat.matrix;
-		quote = r->mat.quoted;
 		node = l;
 	}
 
@@ -1817,15 +1814,12 @@ matrix_addsub_scalar_matrix_op (GelCtx *ctx, GelETree *n, GelETree *l, GelETree
 	int i;
 	GelMatrixW *m;
 	GelETree *node;
-	int quote = 0;
 
 	if (l->type == GEL_MATRIX_NODE) {
 		m = l->mat.matrix;
-		quote = l->mat.quoted;
 		node = r;
 	} else {
 		m = r->mat.matrix;
-		quote = r->mat.quoted;
 		node = l;
 	}
 
@@ -5001,9 +4995,9 @@ static inline void
 iter_loop (GelCtx *ctx, GelETree *n, gboolean body_first, gboolean is_while)
 {
 	GelEvalLoop *evl;
-	GelETree *l, *r;
+	GelETree *l;
 	
-	GEL_GET_LR(n,l,r);
+	GEL_GET_L(n,l);
 	
 	EDEBUG("   ITER LOOP");
 	
@@ -5641,7 +5635,7 @@ iter_equalsop(GelETree *n)
 
 		if (index->type == GEL_VALUE_NODE ||
 		    index->type == GEL_MATRIX_NODE) {
-			int *regx, *regy;
+			int *regx = NULL, *regy = NULL;
 			int lx, ly;
 			int i;
 
@@ -5954,8 +5948,8 @@ iter_incrementop (GelETree *n)
 static void
 do_swapwithop (GelETree *l, GelETree *r)
 {
-	int lx, ly;
-	int rx, ry;
+	int lx = 0, ly = 0;
+	int rx = 0, ry = 0;
 	GelMatrixW *matr, *matl;
 	GelETree *tmp;
 
@@ -6034,7 +6028,7 @@ do_swapwithop (GelETree *l, GelETree *r)
 					return;
 
 
-				GEL_MATRIXW_VINDEX_TO_INDEX (matl, i, x, y);
+				GEL_MATRIXW_VINDEX_TO_INDEX (mat, i, x, y);
 
 				gel_matrixw_set_at_least_size (mat, x+1, y+1);
 				gel_matrixw_make_private (mat, TRUE /* kill_type_caches */);
@@ -6277,7 +6271,7 @@ iter_push_left_indexes_only(GelCtx *ctx, GelETree *n)
 static inline void
 iter_push_indexes_both (GelCtx *ctx, GelETree *n)
 {
-	GelETree *l,*r,*ident;
+	GelETree *l,*r;
 
 	GEL_GET_LR(n,l,r);
 
diff --git a/src/funclib.c b/src/funclib.c
index cc8ff12..987fd58 100644
--- a/src/funclib.c
+++ b/src/funclib.c
@@ -5243,7 +5243,7 @@ perm_switch_all_above (int *perm, char *arrow, int pos, int n)
 	}
 }
 
-int
+static int
 nPr (unsigned int n, unsigned int k)
 {
 	/* assume k+1 <= n */
@@ -5257,7 +5257,7 @@ nPr (unsigned int n, unsigned int k)
 	return (int)m;
 }
 
-int
+static int
 nCr (unsigned int n, unsigned int k)
 {
 	mpz_t ret;
@@ -5339,7 +5339,6 @@ static GelETree *
 Permutations_op (GelCtx *ctx, GelETree * * a, gboolean *exception)
 {
 	GelETree *r;
-	GQueue queue = G_QUEUE_INIT;
 	long k, n, len;
 	int *comb;
 	int *perm;
diff --git a/src/genius-readline-helper.c b/src/genius-readline-helper.c
index 187c887..7e9e84b 100644
--- a/src/genius-readline-helper.c
+++ b/src/genius-readline-helper.c
@@ -45,12 +45,11 @@ extern const char *genius_operators[];
 static char *
 command_generator (const char *text, int state)
 {
-	static int oi,ti,pi,len;
+	static int oi, ti, len;
 	static GList *fli = NULL;
 
 	if(!state) {
 		oi = 0;
-		pi = 0;
 		if(addtoplevels)
 			ti = 0;
 		else
diff --git a/src/gnome-genius.c b/src/gnome-genius.c
index 7778123..22a83d3 100644
--- a/src/gnome-genius.c
+++ b/src/gnome-genius.c
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <sys/time.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/wait.h>
 #include <signal.h>
 #include <fcntl.h>
@@ -605,7 +606,7 @@ stock_init (void)
 	g_object_unref (factory);
 }
 
-GtkWidget *
+static GtkWidget *
 recent_create_menu (void)
 {
         GtkWidget *recent_menu;
@@ -628,7 +629,7 @@ recent_create_menu (void)
         return recent_menu;
 }
 
-void 
+static void 
 file_open_recent (GtkRecentChooser *chooser, gpointer data)
 {
         GtkRecentInfo *item;
@@ -647,7 +648,7 @@ file_open_recent (GtkRecentChooser *chooser, gpointer data)
         gtk_recent_info_unref (item);
 }
 
-void
+static void
 recent_add (const char *uri)
 {
 	GtkRecentData *data;
@@ -3167,7 +3168,7 @@ save_contents_vfs (const char *filename, const char *str, int size)
 {
 	GFile* file;
 	GFileOutputStream* stream;
-	gssize bytes;
+	gsize bytes;
 
 	file = g_file_new_for_uri (filename);
 	stream = g_file_replace (file, NULL, TRUE, G_FILE_CREATE_NONE, NULL, NULL);
diff --git a/src/graphing.c b/src/graphing.c
index 704be83..996b991 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -4643,7 +4643,6 @@ change_surface_varnames (GtkWidget *button, gpointer data)
 	GtkWidget *xe;
 	GtkWidget *ye;
 	GtkWidget *ze;
-	GtkWidget *te;
 	GtkWidget *errlabel;
         GtkSizeGroup *sg;
 
@@ -4705,7 +4704,7 @@ run_dialog_again:
 
 	if (gtk_dialog_run (GTK_DIALOG (req)) == GTK_RESPONSE_OK) {
 		gboolean ex = FALSE;
-		char *xn, *yn, *zn, *tn;
+		char *xn, *yn, *zn;
 
 		xn = get_varname_from_entry (GTK_ENTRY (xe), "x", &ex);
 		yn = get_varname_from_entry (GTK_ENTRY (ye), "y", &ex);
@@ -4742,7 +4741,6 @@ create_lineplot_box (void)
 {
 	GtkWidget *mainbox, *frame;
 	GtkWidget *box, *hbox, *b, *fb, *w;
-	char *s;
 	int i;
 
 	init_var_names ();
@@ -5015,7 +5013,7 @@ static GtkWidget *
 create_surface_box (void)
 {
 	GtkWidget *mainbox, *frame;
-	GtkWidget *hbox, *box, *b, *w;
+	GtkWidget *hbox, *box, *b;
 
 	init_var_names ();
 
diff --git a/src/inter.c b/src/inter.c
index 073c5ab..926753e 100644
--- a/src/inter.c
+++ b/src/inter.c
@@ -257,12 +257,11 @@ extern const char *genius_operators[];
 static char *
 command_generator (const char *text, int state)
 {
-	static int oi,ti,pi,len;
+	static int oi,ti,len;
 	static GSList *fli;
 
 	if(!state) {
 		oi = 0;
-		pi = 0;
 		if(addtoplevels)
 			ti = 0;
 		else
diff --git a/src/matrixw.c b/src/matrixw.c
index 749b58d..b1a2786 100644
--- a/src/matrixw.c
+++ b/src/matrixw.c
@@ -588,7 +588,7 @@ gel_matrixw_set_element (GelMatrixW *m, int x, int y, gpointer data)
 }
 
 /*increment element*/
-int
+void
 gel_matrixw_incr_element (GelMatrixW *m, int x, int y, mpw_ptr by)
 {
 	GelETree *t;
@@ -620,9 +620,7 @@ gel_matrixw_incr_element (GelMatrixW *m, int x, int y, mpw_ptr by)
 			mpw_add (t->val.value, t->val.value, by);
 	} else {
 		gel_errorout (_("Trying to increment a nonvalue"));
-		return FALSE;
 	}
-	return TRUE;
 }
 
 /*set vector element*/
@@ -664,7 +662,7 @@ gel_matrixw_set_velement (GelMatrixW *m, int i, gpointer data)
 }
 
 /*increment vector element*/
-int
+void
 gel_matrixw_incr_velement (GelMatrixW *m, int i, mpw_ptr by)
 {
 	GelETree *t;
@@ -708,12 +706,10 @@ gel_matrixw_incr_velement (GelMatrixW *m, int i, mpw_ptr by)
 			mpw_add (t->val.value, t->val.value, by);
 	} else {
 		gel_errorout (_("Trying to increment a nonvalue"));
-		return FALSE;
 	}
-	return TRUE;
 }
 
-int
+void
 gel_matrixw_incr_region (GelMatrixW *m,
 			 int *destx, int *desty,
 			 int w, int h,
@@ -728,7 +724,7 @@ gel_matrixw_incr_region (GelMatrixW *m,
 	}
 }
 
-int
+void
 gel_matrixw_incr (GelMatrixW *m, mpw_ptr by)
 {
 	int i, j, w, h;
@@ -743,7 +739,7 @@ gel_matrixw_incr (GelMatrixW *m, mpw_ptr by)
 	}
 }
 
-int
+void
 gel_matrixw_incr_vregion (GelMatrixW *m,
 			  int *desti, int len, mpw_ptr by)
 {
diff --git a/src/matrixw.h b/src/matrixw.h
index 84954e1..593c6c5 100644
--- a/src/matrixw.h
+++ b/src/matrixw.h
@@ -67,17 +67,17 @@ void gel_matrixw_set_at_least_size(GelMatrixW *m, int width, int height);
 void gel_matrixw_set_element(GelMatrixW *m, int x, int y, gpointer data);
 void gel_matrixw_set_velement(GelMatrixW *m, int i, gpointer data);
 
-/*increment element (returns true on success) */
+/*increment element */
 /* NULL by means increment by 1 */
-int gel_matrixw_incr_element(GelMatrixW *m, int x, int y, mpw_ptr by);
-int gel_matrixw_incr_velement(GelMatrixW *m, int i, mpw_ptr by);
-int gel_matrixw_incr_region (GelMatrixW *m,
-			     int *destx, int *desty,
-			     int w, int h, mpw_ptr by);
-int gel_matrixw_incr_vregion (GelMatrixW *m,
-			     int *desti, int len,
-			     mpw_ptr by);
-int gel_matrixw_incr (GelMatrixW *m, mpw_ptr by);
+void gel_matrixw_incr_element(GelMatrixW *m, int x, int y, mpw_ptr by);
+void gel_matrixw_incr_velement(GelMatrixW *m, int i, mpw_ptr by);
+void gel_matrixw_incr_region (GelMatrixW *m,
+			      int *destx, int *desty,
+			      int w, int h, mpw_ptr by);
+void gel_matrixw_incr_vregion (GelMatrixW *m,
+			       int *desti, int len,
+			       mpw_ptr by);
+void gel_matrixw_incr (GelMatrixW *m, mpw_ptr by);
 
 
 /*copy a matrix*/
diff --git a/ve/Makefile.am b/ve/Makefile.am
index 117ab47..4497b1b 100644
--- a/ve/Makefile.am
+++ b/ve/Makefile.am
@@ -5,6 +5,7 @@ INCLUDES = \
  	-I.					\
 	-I..					\
 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
+	$(WARN_CFLAGS)				\
 	$(VICIOUS_CFLAGS)
 
 AM_CFLAGS = $(PGO_CFLAGS)
diff --git a/ve/ve-misc.h b/ve/ve-misc.h
index 1d77e39..c16e0e8 100644
--- a/ve/ve-misc.h
+++ b/ve/ve-misc.h
@@ -30,6 +30,7 @@
 
 char **	ve_split (const char *s);
 char *	ve_first_word (const char *s);
+gboolean ve_first_word_executable (const char *s, gboolean only_existance);
 char *  ve_rest (const char *s);
 char **	ve_vector_merge (char * const *v1, char * const *v2);
 int	ve_vector_len (char * const *v);
diff --git a/ve/ve-miscui.c b/ve/ve-miscui.c
index 6559758..2e1ac1d 100644
--- a/ve/ve-miscui.c
+++ b/ve/ve-miscui.c
@@ -299,7 +299,6 @@ int
 ve_dialog_run_nonmodal (GtkDialog *dialog)
 {
   RunInfo ri = { NULL, GTK_RESPONSE_NONE, NULL, FALSE };
-  gboolean was_modal;
   gulong response_handler;
   gulong unmap_handler;
   gulong destroy_handler;



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