Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37048155
en ru br
ALT Linux repos
S:4.1.1-alt2
5.0: 0.9.6-alt2.1
4.1: 0.9.6-alt1
4.0: 0.9.5-alt1
3.0: 0.8.1.1-alt1

Group :: Office
RPM: qalculate

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: libqalculate-gcc43-cln1.2.2.alt.patch
Download


 configure.in               |    9 +++------
 libqalculate/Calculator.cc |    2 +-
 libqalculate/Calculator.h  |    6 ++++--
 libqalculate/DataSet.h     |    2 +-
 libqalculate/Function.cc   |    4 ++--
 libqalculate/Function.h    |    2 +-
 libqalculate/Number.cc     |    9 +--------
 libqalculate/includes.h    |    4 +++-
 8 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/configure.in b/configure.in
index dc18e2c..be3a6f0 100644
--- a/configure.in
+++ b/configure.in
@@ -91,16 +91,13 @@ AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"])
 
 AC_LANG([C++])
 
-AC_PATH_CLN(1.1.0, [
-     	LIBS="$LIBS $CLN_LIBS"
-     	CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS"
-  	AC_DEFINE(HAVE_LIBCLN,1,[If CLN can be used])
-], AC_MSG_ERROR([No suitable installed version of CLN could be found.]))
-
+PKG_CHECK_MODULES([CLN], [cln >= 1.2.2], [],
+				                     [AC_MSG_WARN([No suitable version of CLN can be found])])
 
 PKG_CHECK_MODULES(GLIB, [
 	glib-2.0
 	libxml-2.0 >= 2.3.8
+	cln >= 1.2.2
 	])
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
diff --git a/libqalculate/Calculator.cc b/libqalculate/Calculator.cc
index 50c74e1..d90a35b 100644
--- a/libqalculate/Calculator.cc
+++ b/libqalculate/Calculator.cc
@@ -1538,7 +1538,7 @@ void Calculator::saveState() {
 void Calculator::restoreState() {
 }
 void Calculator::clearBuffers() {
-	for(Sgi::hash_map<size_t, bool>::iterator it = ids_p.begin(); it != ids_p.end(); ++it) {
+	for(std::tr1::unordered_map<size_t, bool>::iterator it = ids_p.begin(); it != ids_p.end(); ++it) {
 		if(!it->second) {
 			freed_ids.push_back(it->first);
 			id_structs.erase(it->first);
diff --git a/libqalculate/Calculator.h b/libqalculate/Calculator.h
index 746e618..cdb9053 100644
--- a/libqalculate/Calculator.h
+++ b/libqalculate/Calculator.h
@@ -198,8 +198,10 @@ class Calculator {
 	
 	vector<DataSet*> data_sets;
 	
-	Sgi::hash_map<size_t, MathStructure*> id_structs;
-	Sgi::hash_map<size_t, bool> ids_p;
+	//Sgi::hash_map<size_t, MathStructure*> id_structs;
+	std::tr1::unordered_map<size_t, MathStructure*> id_structs;
+	//Sgi::hash_map<size_t, bool> ids_p;
+	std::tr1::unordered_map<size_t, bool> ids_p;
 	vector<size_t> freed_ids;	
 	size_t ids_i;
 	
diff --git a/libqalculate/DataSet.h b/libqalculate/DataSet.h
index 34a2961..8182ec4 100644
--- a/libqalculate/DataSet.h
+++ b/libqalculate/DataSet.h
@@ -17,7 +17,7 @@
 
 /** @file */
 
-typedef Sgi::vector<DataProperty*>::iterator DataObjectPropertyIter;
+typedef std::vector<DataProperty*>::iterator DataObjectPropertyIter;
 
 /// A a data set object.
 /** Data objects consist of property-value pairs. */
diff --git a/libqalculate/Function.cc b/libqalculate/Function.cc
index 0cc9baf..8c6f0d3 100644
--- a/libqalculate/Function.cc
+++ b/libqalculate/Function.cc
@@ -359,7 +359,7 @@ Argument *MathFunction::getArgumentDefinition(size_t index) {
 	return NULL;
 }
 void MathFunction::clearArgumentDefinitions() {
-	for(Sgi::hash_map<size_t, Argument*>::iterator it = argdefs.begin(); it != argdefs.end(); ++it) {
+	for(std::tr1::unordered_map<size_t, Argument*>::iterator it = argdefs.begin(); it != argdefs.end(); ++it) {
 		delete it->second;
 	}
 	argdefs.clear();
@@ -444,7 +444,7 @@ int MathFunction::parse(MathStructure &mstruct, const string &argv, const ParseO
 }
 bool MathFunction::testArguments(MathStructure &vargs) {
 	size_t last = 0;
-	for(Sgi::hash_map<size_t, Argument*>::iterator it = argdefs.begin(); it != argdefs.end(); ++it) {
+	for(std::tr1::unordered_map<size_t, Argument*>::iterator it = argdefs.begin(); it != argdefs.end(); ++it) {
 		if(it->first > last) {
 			last = it->first;
 		}
diff --git a/libqalculate/Function.h b/libqalculate/Function.h
index 2686e43..d01b24b 100644
--- a/libqalculate/Function.h
+++ b/libqalculate/Function.h
@@ -71,7 +71,7 @@ class MathFunction : public ExpressionItem {
 	int argc;
 	int max_argc;
 	vector<string> default_values;
-	Sgi::hash_map<size_t, Argument*> argdefs;
+	std::tr1::unordered_map<size_t, Argument*> argdefs;
 	size_t last_argdef_index;		
 	bool testArguments(MathStructure &vargs);
 	virtual MathStructure createFunctionMathStructureFromVArgs(const MathStructure &vargs);
diff --git a/libqalculate/Number.cc b/libqalculate/Number.cc
index 64d5b92..f1a8fa4 100644
--- a/libqalculate/Number.cc
+++ b/libqalculate/Number.cc
@@ -15,6 +15,7 @@
 #include "Calculator.h"
 
 #include <sstream>
+#include <climits>
 #include "util.h"
 
 #define REAL_PRECISION_FLOAT_RE(x)		cln::cl_float(cln::realpart(x), cln::float_format(PRECISION + 1))
@@ -28,14 +29,6 @@
 
 using namespace cln;
 
-void cln::cl_abort() {
-	CALCULATOR->error(true, "CLN Error: see terminal output (probably too large or small floating point number)", NULL);
-	if(CALCULATOR->busy()) {
-		CALCULATOR->abort_this();
-	} else {
-		exit(0);
-	}
-}
 
 string printCL_I(cl_I integ, int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) {
 	if(base == BASE_ROMAN_NUMERALS) {
diff --git a/libqalculate/includes.h b/libqalculate/includes.h
index 68ce764..9199feb 100644
--- a/libqalculate/includes.h
+++ b/libqalculate/includes.h
@@ -30,6 +30,8 @@ using namespace std;
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <climits>
+#include <algorithm>
 
 
 #ifdef __GNUC__
@@ -37,7 +39,7 @@ using namespace std;
 #      include <hash_map.h>
        namespace Sgi { using ::hash_map; }; // inherit globals
 #   else
-#      include <ext/hash_map>
+#      include <tr1/unordered_map>
 #      if __GNUC__ == 3 && __GNUC_MINOR__ == 0
           namespace Sgi = std;               // GCC 3.0
 #      else
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin