Hi Jan,
I've just done of review of your changes but have decided to implement
something similar rather than use your approach with using c casts.
Casting a ifstream to a int really isn't something that is sound and would
strongly recommend reading the intent of the code before making
modifications. The appropriate modification in this case was:
Index: x/directx.cpp
===================================================================
--- x/directx.cpp (revision 13829)
+++ x/directx.cpp (working copy)
@@ -63,7 +63,7 @@
{
// read header
char buf[256];
- if (fin.getline(buf, sizeof(buf)) == 0) {
+ if (!fin.getline(buf, sizeof(buf))) {
OSG_WARN << "Failed to read DirectX header\n";
return false;
}
For the imageio plugin I went for static_cast to CGFloat.
Index: imageio/ReaderWriterImageIO.cpp
===================================================================
--- imageio/ReaderWriterImageIO.cpp (revision 13829)
+++ imageio/ReaderWriterImageIO.cpp (working copy)
@@ -262,7 +262,7 @@
size_t the_width = CGImageGetWidth(image_ref);
size_t the_height = CGImageGetHeight(image_ref);
- CGRect the_rect = {{0, 0}, {the_width, the_height}};
+ CGRect the_rect = {{0.0f, 0.0f}, {static_cast<CGFloat>(the_width),
static_cast<CGFloat>(the_height)}};
size_t bits_per_pixel = CGImageGetBitsPerPixel(image_ref);
size_t bytes_per_row = CGImageGetBytesPerRow(image_ref);
@@ -374,8 +374,8 @@
}
}
The modification to the vtf plugin was more inline with your change, I had
thought about changing the vttFormat type to int, but as far as I can tell
the specs call for a uint, but the enum is a int, so causing the mismatch,
I don't expect any problems with change.
Index: ReaderWriterVTF.cpp
===================================================================
--- ReaderWriterVTF.cpp (revision 13829)
+++ ReaderWriterVTF.cpp (working copy)
@@ -171,7 +171,7 @@
supported = true;
// Decode the format
- switch (vtfFormat)
+ switch (static_cast<int>(vtfFormat))
{
case VTF_FORMAT_DEFAULT:
supported = false;
I have checked these changes into svn/trunk and OSG-3.2 branch.
Robert.
On 20 October 2013 19:49, Jan Klimke <[email protected]> wrote:
> Hi,
>
> i tried to build osg with stdc++11 language dialect with xcode mac. It did
> not compile since there where some minor issues with some plugins. I
> attached a fix for these.
>
> Maybe there are other flaws with plugins i currently did not build. But
> with the at least with default options this should compile right now.
>
> Thank you!
>
> Cheers,
> Jan
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=56896#56896
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/plugin_c11_151.zip
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org