On Thu, Nov 10, 2005 at 02:33:16PM -0800, Jeremy Y. Meng wrote:
+++ inkscape_irix/src/approx-equal.h 2005-11-09 09:54:18.400619200 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +#include <math.h> +#else #include <cmath> +#endif
Is this because cmath doesn't exist, or because we've accidentally used something without namespace-qualifying it, or because cmath conflicts with another header, or because math.h declares some things (C99 functions perhaps) not declared by cmath ?
+++ inkscape_irix/src/dialogs/export.cpp 2005-11-09 11:26:09.770456720 -0800
- double epsilon = 1.0 / pow (10, EXPORT_COORD_PRECISION);
- double epsilon = 1.0 / pow ((float)10, EXPORT_COORD_PRECISION);
I'll change this to epsilon = pow(10.0, -EXPORT_COORD_PRECISION).
+++ inkscape_irix/src/dialogs/input.cpp 2005-11-09 11:49:44.936827440 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +#include <string> +#endif
I'll #include <string> unconditionally, given that the file uses std::string.
+++ inkscape_irix/src/dialogs/layer-properties.cpp 2005-11-09 11:54:38.901811920 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730
sigc::bind(sigc::ptr_fun<void *, void>(&::operator delete), this),
+#else sigc::bind(sigc::ptr_fun(&::operator delete), this), +#endif
Should be fine for that to be unconditional, assuming that's the right template parameters.
+++ inkscape_irix/src/dialogs/unclump.cpp 2005-11-09 12:03:57.273043600 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +using namespace std; +#endif
Please no. We'd usually use either `using std::foo' or explicitly qualify. What names need qualifying?
+++ inkscape_irix/src/extension/error-file.cpp 2005-11-09 12:59:27.343672080 -0800
ErrorFileNotice::ErrorFileNotice (void) : +#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730
- MessageDialog(
+#else Gtk::MessageDialog::MessageDialog( +#endif
(where ErrorFileNotice is derived from Gtk::MessageDialog).
Can anyone comment on the right thing here? I'm surprised that this change is necessary.
diff -ru inkscape-20051109-0840/src/extension/internal/bluredge.cpp inkscape_irix/src/extension/internal/bluredge.cpp --- inkscape-20051109-0840/src/extension/internal/bluredge.cpp 2005-11-09 08:40:16.000000000 -0800 +++ inkscape_irix/src/extension/internal/bluredge.cpp 2005-11-09 12:51:16.337447760 -0800 @@ -72,7 +72,9 @@ item != items.end(); item++) { SPItem * spitem = *item;
+#ifdef __GNUC__ Inkscape::XML::Node * new_items[steps]; +#endif
Where is new_items defined otherwise?
new_items[i] = (SP_OBJECT_REPR(spitem))->duplicate();
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730
SPItem * item_i = (SPItem *)(SP_OBJECT_REPR(spitem))->duplicate();
new_items.push_back(item_i);
SPCSSAttr * css = sp_repr_css_attr(new_items[i], "style");
SPCSSAttr * css = sp_repr_css_attr((Inkscape::XML::Node *)item_i, "style"); sp_repr_css_set_property(css, "opacity", opacity_string);
sp_repr_css_change(new_items[i], css, "style");
sp_repr_css_change((Inkscape::XML::Node *)item_i, css, "style");
new_group->appendChild(new_items[i]);
new_group->appendChild((Inkscape::XML::Node *)item_i);
selection->add(item_i);
+#else
new_items[i] = (SPItem *)(SP_OBJECT_REPR(spitem))->duplicate();
SPCSSAttr * css = sp_repr_css_attr((Inkscape::XML::Node *)new_items[i], "style");
sp_repr_css_set_property(css, "opacity", opacity_string);
sp_repr_css_change((Inkscape::XML::Node *)new_items[i], css, "style");
new_group->appendChild((Inkscape::XML::Node *)new_items[i]); selection->add(new_items[i]);
+#endif
All the casting to Inkscape::XML::Node* above makes me suspicious: I didn't think SPItem and Node were in a common hierarchy.
+++ inkscape_irix/src/inkscape-stock.cpp 2005-11-09 09:21:18.576598000 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +typedef struct +#else static struct StockIcon +#endif
Given that stock_items[] is now empty, I think we can just remove that array and the code that addresses it. Does this function/file still need to exist, in fact?
+++ inkscape_irix/src/libavoid/makepath.cpp 2005-11-09 14:19:52.346046320 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +#include <algorithm> +using namespace std; +#endif
Again, what needs std:: qualification? (And, OOC, what's algorithm needed for?)
-static const double PI = 4.0 * atan(1); +static const double PI = 4.0 * atan((double)1);
Presumably we can use M_PI instead.
+++ inkscape_irix/src/libavoid/timer.cpp 2005-11-09 14:21:57.153665440 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +# include <stdio.h> +# include <time.h> +#else # include <cstdio> +#endif
What's this for? (Same questions as for cmath/math.h above.)
+++ inkscape_irix/src/libavoid/visibility.cpp 2005-11-09 15:00:56.561930320 -0800
-static const double PI = 4.0 * atan(1); +static const double PI = 4.0 * atan((double)1);
Again, I'll use M_PI.
+++ inkscape_irix/src/libnrtype/Layout-TNG-Compute.cpp 2005-11-09 14:14:48.823191840 -0800 @@ -22,10 +22,21 @@ namespace Inkscape { namespace Text {
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +#include <stdarg.h> +#define __IFDEBUG
Here seems to define __IFDEBUG whenever defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730, so it seems strange than in a few other places the new code explicitly tests for __IFDEBUG when inside #if defined(__sgi) && ... Which makes me suspect that the code doesn't do what you intended.
I've now gone through applying a different solution (at cost of a somewhat tedious find and manual replace). I'm rather tempted just to remove the TRACE calls altogether though. (Comment, cyreve?)
+++ inkscape_irix/src/livarot/int-line.cpp 2005-11-09 15:02:35.429689680 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +#include <math.h> +#else #include <cmath> +#endif
Again, reason?
+++ inkscape_irix/src/marker-status.h 2005-11-09 09:24:01.493283920 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +void marker_status(char const *format, ...); +#else void marker_status(char const *format, ...) __attribute__((format(__printf__, 1, 2))); +#endif
Should probably test __GNUC__ here instead.
+++ inkscape_irix/src/object-edit.cpp 2005-11-09 09:27:19.650382088 -0800 @@ -936,7 +936,7 @@ double r0; sp_spiral_get_polar (spiral, spiral->t0, &r0, NULL); spiral->rad = rad_new;
spiral->t0 = pow (r0 / spiral->rad, 1/spiral->exp);
spiral->t0 = pow ((float)r0 / spiral->rad, 1/spiral->exp);
Without having thought about the precision requirements, I'd prefer doing the calculations with doubles, i.e. change 1/ to 1.0/ and leave r0 as it is.
+++ inkscape_irix/src/sp-flowregion.cpp 2005-11-09 09:51:31.584816160 -0800 @@ -122,7 +122,11 @@ SPFlowregion *group=(SPFlowregion *)object; for (std::vector<Shape*>::iterator it = group->computed.begin() ; it != group->computed.end() ; it++) delete *it; +#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730
group->computed.~vector();
+#else group->computed.~vector<Shape*>(); +#endif
We wouldn't want the #if/else in CVS. Are both valid C++ or only one (and which) ?
+++ inkscape_irix/src/sp-guide.h 2005-11-09 10:59:15.757378080 -0800 @@ -15,7 +15,12 @@ #include "display/display-forward.h" #include "libnr/nr-point.h" #include "sp-object.h" +#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +/* forward declaration not working with MIPSpro */ +#include "sp-guide-attachment.h" +#else class SPGuideAttachment; +#endif
This header file uses SPGuideAttachment in one place, vector<SPGuideAttachment>. I haven't consulted the C++ spec on the matter. Given that vector is just three pointers to SPGuideAttachment, one might expect it to be OK not to have the definition (until/unless one accesses any of those pointers).
Anyone know whether this is a bug in MIPSpro or an incorrect leniency in g++ ?
I imagine it's not too much of a problem to #include it unconditionally.
+++ inkscape_irix/src/sp-item-rm-unsatisfied-cns.cpp 2005-11-09 11:00:21.437348320 -0800
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 730 +using namespace std; +#else using std::vector; +#endif
Again, what things other than vector need qualifying? Same for src/sp-item-update-cns.cpp.
+++ inkscape_irix/src/sp-metadata.cpp 2005-11-09 10:06:52.149513680 -0800
+#ifdef __GUNC__
:) Freudian typo?
Time for me to go, I haven't looked at the rest.
pjrm.