[genius] Mon Dec 26 12:17:41 2016 Jiri (George) Lebl <jirka 5z com>
- From: George Lebl <jirka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [genius] Mon Dec 26 12:17:41 2016 Jiri (George) Lebl <jirka 5z com>
- Date: Mon, 26 Dec 2016 18:18:32 +0000 (UTC)
commit 5fcb3b2703b556be7bd15dffbba52ab9630b8c55
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date: Mon Dec 26 12:18:08 2016 -0600
Mon Dec 26 12:17:41 2016 Jiri (George) Lebl <jirka 5z com>
* configure.ac, NEWS: prepare for 1.0.22
* src/calc.c, src/lexer.l: appears that flex changed its behavior
leading to infinite loops on parse. Fix.
* gtkextra/gtkplotdt.c: fix warnings
* src/longtest.gel: test Evaluate from inside loaded files (from
inside the string evaluate that's done in geniustest.pl
ChangeLog | 12 ++++++++++++
NEWS | 5 ++++-
configure.ac | 2 +-
gtkextra/gtkplotdt.c | 6 ++++--
src/calc.c | 8 +++++---
src/examples.c | 1 -
src/lexer.l | 4 +++-
src/longtest.gel | 13 +++++++++++++
8 files changed, 42 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 66001ea..1171aac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Dec 26 12:17:41 2016 Jiri (George) Lebl <jirka 5z com>
+
+ * configure.ac, NEWS: prepare for 1.0.22
+
+ * src/calc.c, src/lexer.l: appears that flex changed its behavior
+ leading to infinite loops on parse. Fix.
+
+ * gtkextra/gtkplotdt.c: fix warnings
+
+ * src/longtest.gel: test Evaluate from inside loaded files (from
+ inside the string evaluate that's done in geniustest.pl
+
Fri Dec 23 00:43:15 2016 Jiri (George) Lebl <jirka 5z com>
* examples/*.gel: reset variable names for surfaces. For shocks also
diff --git a/NEWS b/NEWS
index 1ddcd24..1d8f309 100644
--- a/NEWS
+++ b/NEWS
@@ -23,7 +23,10 @@ Changes to 1.0.22
DoubleFactorial apply over matrix.
* Fix some inverse trig functions with complex arguments.
* Other minor fixes including some crashes
-* Translation updates (FIXME)
+* Translation updates (Miguel Rodríguez Núñez, Marek Černocký, Anders Jonsson,
+ Ask Hjorth Larsen, Alan Mortensen, Balázs Úr, Mario Blättermann,
+ Christian Kirbach, Мирослав Николић, Daniel Șerbănescu, Rafael Fontenelle,
+ Piotr Drąg, Tiago Santos, Enrico Nicoletto, Daniel Mustieles, moi)
* During making of these changes the author (Jiri) was partially supported by
NSF grant DMS 1362337 and the Oklahoma State University
diff --git a/configure.ac b/configure.ac
index 815a3c0..c5d531e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([genius], [1.0.21])
+AC_INIT([genius], [1.0.22])
AC_CONFIG_SRCDIR([src/calc.c])
AM_INIT_AUTOMAKE([dist-xz])
diff --git a/gtkextra/gtkplotdt.c b/gtkextra/gtkplotdt.c
index e7f0cae..e47d6b9 100644
--- a/gtkextra/gtkplotdt.c
+++ b/gtkextra/gtkplotdt.c
@@ -228,8 +228,10 @@ static void
gtk_plot_dt_real_clear(GtkPlotDT *data)
{
if (!data) return;
- if (data->nodes) g_free(data->nodes); data->nodes= NULL;
- if (data->tmp_nodes) g_free(data->tmp_nodes); data->tmp_nodes= NULL;
+ if (data->nodes) g_free(data->nodes);
+ data->nodes= NULL;
+ if (data->tmp_nodes) g_free(data->tmp_nodes);
+ data->tmp_nodes= NULL;
data->node_cnt= data->node_max= data->node_0= 0;
gtk_plot_dt_clear_triangles(data);
diff --git a/src/calc.c b/src/calc.c
index 75c3a5d..5b11548 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -1,5 +1,5 @@
/* GENIUS Calculator
- * Copyright (C) 1997-2014 Jiri (George) Lebl
+ * Copyright (C) 1997-2016 Jiri (George) Lebl
*
* Author: Jiri (George) Lebl
*
@@ -109,6 +109,7 @@ static GHashTable *gel_bodyhash = NULL;
/*from lexer.l*/
int my_yyinput(void);
+int my_yy_flush_buffer(void);
static int
function_sort (gconstpointer data1, gconstpointer data2)
@@ -3326,6 +3327,7 @@ gel_parseexp (const char *str, FILE *infile, gboolean exec_commands,
if(str) {
int l = strlen(str);
+
errno = 0;
if G_UNLIKELY (pipe(gel_lex_fd) != 0) {
gel_errorout (_("ERROR: 'pipe' failed: %s"),
@@ -3365,8 +3367,8 @@ gel_parseexp (const char *str, FILE *infile, gboolean exec_commands,
;*/
if(str) {
- while(my_yyinput()!=EOF)
- ;
+ my_yy_flush_buffer ();
+
close(gel_lex_fd[0]);
fflush(infile);
gel_lexer_close(infile);
diff --git a/src/examples.c b/src/examples.c
index f0b0632..9dd8f39 100644
--- a/src/examples.c
+++ b/src/examples.c
@@ -59,7 +59,6 @@ static GelExampleCategory *
gel_get_example_category (const char *name)
{
GSList *li;
- static int k = 0;
static GelExampleCategory *last = NULL;
GelExampleCategory *cat;
diff --git a/src/lexer.l b/src/lexer.l
index cbef505..10ac95d 100644
--- a/src/lexer.l
+++ b/src/lexer.l
@@ -1,5 +1,5 @@
/* GENIUS Calculator
- * Copyright (C) 1997-2011 Jiri (George) Lebl
+ * Copyright (C) 1997-2016 Jiri (George) Lebl
*
* Author: Jiri (George) Lebl
*
@@ -489,6 +489,8 @@ local { DO_RET; return LOCAL; }
int my_yyinput(void);
int my_yyinput(void) { return input(); }
+void my_yy_flush_buffer(void);
+void my_yy_flush_buffer(void) { YY_FLUSH_BUFFER; }
/* avoid unused warnings, kind of bogus */
/* Apparently this no worky, so don't do it */
diff --git a/src/longtest.gel b/src/longtest.gel
index 382508b..42b5291 100644
--- a/src/longtest.gel
+++ b/src/longtest.gel
@@ -228,6 +228,19 @@ function LongTest() = (
# polynomial division
if not polydivtest() then (error("error on poly div test");errors = errors + 1);
+ # test evaluation of strings in the middle of file load
+ if Evaluate ("6^7") != 279936 then (
+ error("error on Evaluate test 1");
+ increment errors
+ );
+
+ # test evaluation of strings in the middle of file load
+ Evaluate ("function gugu(x) = x^2");
+ if gugu(5) != 25 then (
+ error("error on Evaluate test 2");
+ increment errors
+ );
+
# We print instead of return since we normally use load to run this
# and load doesn't output the return value
if errors > 0 then
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]