MSVC compilation fixes

John W. Eaton jwe at bevo.che.wisc.edu
Wed Jul 9 10:10:15 CDT 2008


On 20-Jun-2008, Michael Goffioul wrote:

| Please consider the following patch for inclusion
| 
| http://hg.tw-math.de/octave-graphics-mq/rev/a15e56860500
| 
| It fixes various compile problem and/or typos that makes it
| compile with MSVC. Note that the changes related to the
| "pow" function should be reviewed, as I'm not sure if my
| modifications are correct.

diff -r 7683fa6c06a2 src/OPERATORS/op-int.h
--- a/src/OPERATORS/op-int.h	Mon Feb 11 10:11:56 2008 +0100
+++ b/src/OPERATORS/op-int.h	Fri Jun 20 12:40:27 2008 +0200
@@ -227,13 +227,13 @@
   octave_value \
   xpow (const octave_ ## T1& a, float b) \
   { \
-    return pow (a, b); \
+    return pow (a, static_cast<double> (b)); \
   } \

Shouldn't we use powf here instead?  Does MSVC provide powf, or do we
need a replacement in lo-specfun.cc (or lo-mappers.cc; I'm not sure
now why these files aren't combined)?

jwe


More information about the Octave-maintainers mailing list