From: <md...@us...> - 2008-05-05 15:12:32
|
Revision: 5111 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5111&view=rev Author: mdboom Date: 2008-05-05 08:12:29 -0700 (Mon, 05 May 2008) Log Message: ----------- Fix a number of minor issues discovered with "-pedantic" Modified Paths: -------------- trunk/matplotlib/src/MPL_isnan.h trunk/matplotlib/src/_backend_agg.cpp trunk/matplotlib/src/_image.cpp trunk/matplotlib/src/_image.h trunk/matplotlib/src/_path.cpp trunk/matplotlib/src/_tkagg.cpp trunk/matplotlib/src/_ttconv.cpp trunk/matplotlib/src/cntr.c trunk/matplotlib/src/ft2font.cpp Modified: trunk/matplotlib/src/MPL_isnan.h =================================================================== --- trunk/matplotlib/src/MPL_isnan.h 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/MPL_isnan.h 2008-05-05 15:12:29 UTC (rev 5111) @@ -8,6 +8,10 @@ */ +#ifdef _ISOC99_SOURCE +#include <stdint.h> +#endif + #if defined(SIZEOF_VOID_P) #if SIZEOF_VOID_P == 8 #define MPL_LP64 1 @@ -24,9 +28,13 @@ #if defined(_MSC_VER) typedef __int64 MPL_Int64; #else +#if defined(_ISOC99_SOURCE) +typedef int64_t MPL_Int64; +#else typedef long long MPL_Int64; #endif #endif +#endif #if !defined(MPL_U64) #define MPL_U64(u) (* (MPL_Int64 *) &(u) ) Modified: trunk/matplotlib/src/_backend_agg.cpp =================================================================== --- trunk/matplotlib/src/_backend_agg.cpp 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/_backend_agg.cpp 2008-05-05 15:12:29 UTC (rev 5111) @@ -249,7 +249,7 @@ //theRasterizer->filling_rule(agg::fill_even_odd); //theRasterizer->filling_rule(agg::fill_non_zero); -}; +} void RendererAgg::create_alpha_buffers() { if (!alphaBuffer) { @@ -1762,4 +1762,4 @@ static _backend_agg_module* _backend_agg = NULL; _backend_agg = new _backend_agg_module; -}; +} Modified: trunk/matplotlib/src/_image.cpp =================================================================== --- trunk/matplotlib/src/_image.cpp 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/_image.cpp 2008-05-05 15:12:29 UTC (rev 5111) @@ -826,7 +826,7 @@ for (size_t i=0; i<thisim->colsOut; i++) { thisx = i+ox; thisy = j+oy; - if (thisx<0 || thisx>=numcols || thisy<0 || thisy>=numrows) { + if (thisx>=numcols || thisy>=numrows) { ind +=4; continue; } Modified: trunk/matplotlib/src/_image.h =================================================================== --- trunk/matplotlib/src/_image.h 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/_image.h 2008-05-05 15:12:29 UTC (rev 5111) @@ -61,7 +61,7 @@ MITCHELL, SINC, LANCZOS, - BLACKMAN,}; + BLACKMAN}; //enum { BICUBIC=0, BILINEAR, BLACKMAN100, BLACKMAN256, BLACKMAN64, // NEAREST, SINC144, SINC256, SINC64, SPLINE16, SPLINE36}; Modified: trunk/matplotlib/src/_path.cpp =================================================================== --- trunk/matplotlib/src/_path.cpp 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/_path.cpp 2008-05-05 15:12:29 UTC (rev 5111) @@ -1161,4 +1161,4 @@ static _path_module* _path = NULL; _path = new _path_module; -}; +} Modified: trunk/matplotlib/src/_tkagg.cpp =================================================================== --- trunk/matplotlib/src/_tkagg.cpp 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/_tkagg.cpp 2008-05-05 15:12:29 UTC (rev 5111) @@ -27,7 +27,7 @@ #else # include <tk.h> #endif -}; +} Modified: trunk/matplotlib/src/_ttconv.cpp =================================================================== --- trunk/matplotlib/src/_ttconv.cpp 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/_ttconv.cpp 2008-05-05 15:12:29 UTC (rev 5111) @@ -204,7 +204,7 @@ "the values are the stream content needed to render that glyph. This\n" "is useful to generate the CharProcs dictionary in a PDF Type 3 font.\n" }, - {NULL} /* Sentinel */ + {0, 0, 0, 0} /* Sentinel */ }; #ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ Modified: trunk/matplotlib/src/cntr.c =================================================================== --- trunk/matplotlib/src/cntr.c 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/cntr.c 2008-05-05 15:12:29 UTC (rev 5111) @@ -1688,7 +1688,7 @@ " Optional argument: nchunk; approximate number of grid points\n" " per chunk. 0 (default) for no chunking.\n" }, - {NULL} /* Sentinel */ + {0, 0, 0, 0} /* Sentinel */ }; static PyTypeObject CntrType = { Modified: trunk/matplotlib/src/ft2font.cpp =================================================================== --- trunk/matplotlib/src/ft2font.cpp 2008-05-02 21:52:05 UTC (rev 5110) +++ trunk/matplotlib/src/ft2font.cpp 2008-05-05 15:12:29 UTC (rev 5111) @@ -153,8 +153,7 @@ void FT2Image::draw_rect(unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1) { - if ( x0<0 || y0<0 || x1<0 || y1<0 || - x0>_width || x1>_width || + if ( x0>_width || x1>_width || y0>_height || y1>_height ) throw Py::ValueError("Rect coords outside image bounds"); @@ -197,10 +196,10 @@ void FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1) { - x0 = CLAMP(x0, 0, _width); - y0 = CLAMP(y0, 0, _height); - x1 = CLAMP(x1, 0, _width); - y1 = CLAMP(y1, 0, _height); + x0 = std::min(x0, _width); + y0 = std::min(y0, _height); + x1 = std::min(x1, _width); + y1 = std::min(y1, _height); for (size_t j=y0; j<y1+1; j++) { for (size_t i=x0; i<x1+1; i++) { @@ -1207,7 +1206,7 @@ "draw_glyphs_to_bitmap. This function is intended for people who\n" "want to render individual glyphs at precise locations, eg, a\n" "a glyph returned by load_char\n"; -; + Py::Object FT2Font::draw_glyph_to_bitmap(const Py::Tuple & args) { _VERBOSE("FT2Font::draw_glyph_to_bitmap"); @@ -1768,7 +1767,7 @@ behaviors().supportGetattr(); behaviors().supportSetattr(); -}; +} //todo add module docs strings This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |