0001213: FreeCAD Compilation fails on Linux 32 bit

This commit is contained in:
wmayer 2013-08-13 14:08:10 +02:00
parent e23febcf32
commit 2bb8c10fed
4 changed files with 22 additions and 8 deletions

View File

@ -24,6 +24,7 @@
#ifndef _PreComp_
#endif
#include <cmath>
#include "Quantity.h"
#include "Exception.h"
@ -101,7 +102,7 @@ Quantity& Quantity::operator = (const Quantity &New)
// include the Scanner and the Parser for the Quantitys
Quantity ScanResult;
Quantity QuantResult;
#ifndef DOUBLE_MAX
# define DOUBLE_MAX 1.7976931348623157E+308 /* max decimal value of a "double"*/
@ -144,13 +145,13 @@ Quantity Quantity::parse(const char* buffer)
// parse from buffer
QuantityParser::YY_BUFFER_STATE my_string_buffer = QuantityParser::yy_scan_string (buffer);
// set the global return variables
ScanResult = Quantity(DOUBLE_MIN);
QuantResult = Quantity(DOUBLE_MIN);
// run the parser
QuantityParser::yyparse ();
// free the scan buffer
QuantityParser::yy_delete_buffer (my_string_buffer);
if (ScanResult == Quantity(DOUBLE_MIN))
if (QuantResult == Quantity(DOUBLE_MIN))
throw Base::Exception("Unknown error in Quantity expression");
return ScanResult;
return QuantResult;
}

View File

@ -1322,7 +1322,7 @@ yyreduce:
/* Line 1455 of yacc.c */
#line 25 "QuantityParser.y"
{ ScanResult = (yyvsp[(1) - (1)]) ; ;}
{ QuantResult = (yyvsp[(1) - (1)]) ; ;}
break;
case 3:

View File

@ -22,7 +22,7 @@
%%
input: exp { ScanResult = $1 ; }
input: exp { QuantResult = $1 ; }
;
exp: NUM { $$ = $1; }

View File

@ -29,6 +29,7 @@
#else
# include <stdint.h>
#endif
#include <string>
namespace Base {
@ -60,8 +61,8 @@ public:
/** Operators. */
//@{
Unit& operator *=(const Unit&that) const {return *this * that;}
Unit& operator /=(const Unit&that) const {return *this / that;}
inline Unit& operator *=(const Unit& that);
inline Unit& operator /=(const Unit& that);
Unit operator *(const Unit&) const;
Unit operator /(const Unit&) const;
bool operator ==(const Unit&) const;
@ -77,6 +78,18 @@ protected:
UnitSignature Sig;
};
inline Unit& Unit::operator *=(const Unit& that)
{
*this = *this * that;
return *this;
}
inline Unit& Unit::operator /=(const Unit& that)
{
*this = *this / that;
return *this;
}
} // namespace Base
#endif // BASE_Unit_H