Bug 26802 - Fix some msvc warnings
Summary: Fix some msvc warnings
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-28 11:38 UTC by Christian Ehrlicher
Modified: 2010-03-07 07:48 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to reduce msvc warnings (2.04 KB, patch)
2010-02-28 11:39 UTC, Christian Ehrlicher
Details | Splinter Review

Description Christian Ehrlicher 2010-02-28 11:38:12 UTC
This small patch removes some nasty msvc warnings. Especially the changes in the headers are important as they're included in other projects and produce a lot of unneeded output.
The diff is against 0.12.4
Comment 1 Christian Ehrlicher 2010-02-28 11:39:28 UTC
Created attachment 33648 [details] [review]
Patch to reduce msvc warnings
Comment 2 Albert Astals Cid 2010-03-02 14:23:22 UTC
Any chance you can try 0.13.1? The header warnings are fixed it seems and i'd like to know if there are more bool/GBool mismatchs
Comment 3 Christian Ehrlicher 2010-03-02 21:57:28 UTC
I tried gitHEAD and got a gBool warning in catalog.h:20 and some other places (Annot.cc:2245,753) - will let you know more this evening.
Currently gitHEAD does not compile (with msvc) because GlobalParams.cc:182/184 - const uchar* can't be converted to uchar*.
Comment 4 Christian Ehrlicher 2010-03-03 09:51:38 UTC
It would also be nice to add
if(msvc)
   add_definitions( -D_CRT_SECURE_NO_DEPRECATE
                    -D_CRT_NONSTDC_NO_DEPRECATE
                  )
endif(msvc)

to net get warnigns about 'deprecated' functions like strdup().

The fix for GlobalParams.cc is easy - just remove the cast to 'const unsigned char*' - 'unsigned char*' is enough. Looks like ms has an overloaded _mbsrchr() which takes and returns a const usnigned char* ...

Now I'm stuck at SplashOutputDev.cc:1987 - finite() isn't available on win. You have to use _finite() (http://msdn.microsoft.com/de-de/library/sb8es7a8(VS.80).aspx) -->

#ifdef _MSC_VER
#include <float.h>
inline double isfinite(double x) { return _finite(x); }
#endif
Comment 5 Pino Toscano 2010-03-05 12:29:35 UTC
The changes in poppler/GfxState.h (the most "spammy" ones) were done months ago.
Comment 6 Pino Toscano 2010-03-06 16:51:23 UTC
For the remaning warnings of this bug, worked with Patrick Spendrin (and then pushed to master) on a patch to disable warning C4800.
Comment 7 Pino Toscano 2010-03-06 17:05:19 UTC
Always with Patrick we sorted out building, can you please try it again, Christian?
Comment 8 Christian Ehrlicher 2010-03-07 07:48:46 UTC
All fine with msvc2005 & 2008, only the add_definitions() is still missing :)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.