From: Angus Leeming Date: Thu, 20 Jan 2005 19:30:14 +0000 (+0000) Subject: Squash some MSVC warnings. X-Git-Tag: 1.6.10~14631 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4038c8452ba08d2db27ac9882ee4f46c5a3a75c9;p=features.git Squash some MSVC warnings. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9515 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index e28962fa27..82577fe534 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,12 @@ +2005-01-20 Angus Leeming + + * math_spaceinset.C (validate): + latex_mathspace[space_] == "negmedspace" is unsafe because both + operands are of type "char const *". Performing comparison on + the address of the string literal therefore. Fix is to explicitly + convert one operand to a string. + With thanks to MSVC ;-) + 2005-01-19 Jean-Marc Lasgouttes * math_symbolinset.C (validate): require wasysym as needed diff --git a/src/mathed/math_spaceinset.C b/src/mathed/math_spaceinset.C index 411903116b..8f71fa0f8e 100644 --- a/src/mathed/math_spaceinset.C +++ b/src/mathed/math_spaceinset.C @@ -119,8 +119,8 @@ void MathSpaceInset::incSpace() void MathSpaceInset::validate(LaTeXFeatures & features) const { if (space_ >= 0 && space_< nSpace) { - if ((latex_mathspace[space_] == "negmedspace") - || (latex_mathspace[space_] == "negthickspace")) + if ((latex_mathspace[space_] == string("negmedspace")) + || (latex_mathspace[space_] == string("negthickspace"))) features.require("amsmath"); } } diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 5913240d41..ef5520c2fd 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,10 @@ +2005-01-20 Angus Leeming + + * lyxlib.h (float_equal): promote parameters to double. + + * path.C (Path): silence MSVC warning about block of code that + does nothing. + 2005-01-20 Asger Ottar Alstrup * FileInfo.h, chdir.C, forkedcall.C, forkedcontr.C, getcwd.C, diff --git a/src/support/lyxlib.h b/src/support/lyxlib.h index 0695269c90..54569babb6 100644 --- a/src/support/lyxlib.h +++ b/src/support/lyxlib.h @@ -61,7 +61,7 @@ std::string const tempName(std::string const & dir = std::string(), * * This will check if 'var' is approx. equal to 'number' with error of 1/1000 */ -inline bool float_equal(float var, float number, float error) +inline bool float_equal(double var, double number, double error) { return (number - error <= var && var <= number + error); } diff --git a/src/support/path.C b/src/support/path.C index 59593145ed..3290274686 100644 --- a/src/support/path.C +++ b/src/support/path.C @@ -28,8 +28,10 @@ Path::Path(string const & path) { if (!path.empty()) { pushedDir_ = getcwd(); +#if 0 if (pushedDir_.empty() || chdir(path)) /* FIXME: throw */; +#endif } else { popped_ = true; }