diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-04-09 19:19:30 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-04-09 19:19:30 +0000 |
| commit | 352a8b65716e482c44920cc94d5f48ca5bc49068 (patch) | |
| tree | ffe4dc958784862f78673d19af0d10c5aa2fa8c0 /src | |
| parent | Documentation / dropping some pointer conversions in context menu (diff) | |
| download | inkscape-352a8b65716e482c44920cc94d5f48ca5bc49068.tar.gz inkscape-352a8b65716e482c44920cc94d5f48ca5bc49068.zip | |
cppcheck stuff
(bzr r11201)
Diffstat (limited to 'src')
| -rw-r--r-- | src/document.cpp | 2 | ||||
| -rw-r--r-- | src/dom/svgtypes.h | 5 | ||||
| -rw-r--r-- | src/extension/dxf2svg/test_dxf.cpp | 4 | ||||
| -rw-r--r-- | src/helper/geom.cpp | 12 | ||||
| -rw-r--r-- | src/io/gzipstream.cpp | 18 | ||||
| -rw-r--r-- | src/xml/simple-document.h | 3 |
6 files changed, 18 insertions, 26 deletions
diff --git a/src/document.cpp b/src/document.cpp index 7b68dd499..cc139aae0 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1429,7 +1429,7 @@ void SPDocument::setModifiedSinceSave(bool modified) { this->modified_since_save = modified; Gtk::Window *parent = SP_ACTIVE_DESKTOP->getToplevel(); g_assert(parent != NULL); - SPDesktopWidget *dtw = (SPDesktopWidget *) parent->get_data("desktopwidget"); + SPDesktopWidget *dtw = static_cast<SPDesktopWidget *>(parent->get_data("desktopwidget")); dtw->updateTitle( this->getName() ); } diff --git a/src/dom/svgtypes.h b/src/dom/svgtypes.h index 0c30069b8..41b4de307 100644 --- a/src/dom/svgtypes.h +++ b/src/dom/svgtypes.h @@ -74,11 +74,6 @@ namespace svg { //local definitions typedef dom::DOMString DOMString; -typedef dom::DOMException DOMException; -typedef dom::Element Element; -typedef dom::Document Document; -typedef dom::NodeList NodeList; - class SVGElement; typedef Ptr<SVGElement> SVGElementPtr; diff --git a/src/extension/dxf2svg/test_dxf.cpp b/src/extension/dxf2svg/test_dxf.cpp index 62969ca6e..c3bbdc141 100644 --- a/src/extension/dxf2svg/test_dxf.cpp +++ b/src/extension/dxf2svg/test_dxf.cpp @@ -80,7 +80,7 @@ int main(){ ents.display_all(); //char units[5] = "in"; - char units[5] = ""; + // char units[5] = ""; cout << "\nNow for the begining of the SVG...\n\n"; @@ -90,7 +90,7 @@ int main(){ //cout << "pline2pline\n" << pline2pline(ents.ret_plines()[0], units ) << endl; //cout << "pline2path\n" << pline2path(ents.ret_plines()[0], units ); - char tmp_char[10000]; + // char tmp_char[10000]; cout << "\nCircle conversion\n"; //cout << "circle2circle\n" << circle2circle(ents.ret_circles()[0], 3, units, tmp_char) << endl; diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp index 33947c14d..585d2b8a5 100644 --- a/src/helper/geom.cpp +++ b/src/helper/geom.cpp @@ -75,11 +75,11 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 if (fabs (a) < Geom::EPSILON) { /* s = -c / b */ if (fabs (b) > Geom::EPSILON) { - double s, t, xttt; + double s; s = -c / b; if ((s > 0.0) && (s < 1.0)) { - t = 1.0 - s; - xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111; + double t = 1.0 - s; + double xttt = s * s * s * x000 + 3 * s * s * t * x001 + 3 * s * t * t * x011 + t * t * t * x111; bbox[0].expandTo(xttt); } } @@ -114,11 +114,11 @@ cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y0 if (fabs (a) < Geom::EPSILON) { /* s = -c / b */ if (fabs (b) > Geom::EPSILON) { - double s, t, yttt; + double s; s = -c / b; if ((s > 0.0) && (s < 1.0)) { - t = 1.0 - s; - yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111; + double t = 1.0 - s; + double yttt = s * s * s * y000 + 3 * s * s * t * y001 + 3 * s * t * t * y011 + t * t * t * y111; bbox[1].expandTo(yttt); } } diff --git a/src/io/gzipstream.cpp b/src/io/gzipstream.cpp index ed94974fe..efa96412d 100644 --- a/src/io/gzipstream.cpp +++ b/src/io/gzipstream.cpp @@ -37,6 +37,7 @@ GzipInputStream::GzipInputStream(InputStream &sourceStream) loaded(false), totalIn(0), totalOut(0), + srcBuf(NULL), outputBuf(NULL), crc(0), srcCrc(0), @@ -57,11 +58,11 @@ GzipInputStream::~GzipInputStream() close(); if ( srcBuf ) { free(srcBuf); - srcBuf = 0; + srcBuf = NULL; } if ( outputBuf ) { free(outputBuf); - outputBuf = 0; + outputBuf = NULL; } } @@ -94,11 +95,11 @@ void GzipInputStream::close() if ( srcBuf ) { free(srcBuf); - srcBuf = 0; + srcBuf = NULL; } if ( outputBuf ) { free(outputBuf); - outputBuf = 0; + outputBuf = NULL; } closed = true; } @@ -117,10 +118,9 @@ int GzipInputStream::get() } else { loaded = true; - int zerr = Z_OK; if ( outputBufPos >= outputBufLen ) { // time to read more, if we can - zerr = fetchMore(); + fetchMore(); } if ( outputBufPos < outputBufLen ) { @@ -201,13 +201,13 @@ bool GzipInputStream::load() //OS val = (int)srcBuf[9]; - int cur = 10; // if ( flags & FEXTRA ) { // headerLen += 2; // int xlen = // TODO deal with optional header parts // } if ( flags & FNAME ) { + int cur = 10; while ( srcBuf[cur] ) { cur++; @@ -229,10 +229,6 @@ bool GzipInputStream::load() | ((0x0ff & srcBuf[srcLen - 4]) << 0); //printf("srcSiz:%lx/%ld\n", srcSiz, srcSiz); - if ( srcSiz <= 0 ) { - return false; - } - //outputBufLen = srcSiz + srcSiz/100 + 14; unsigned char *data = srcBuf + headerLen; diff --git a/src/xml/simple-document.h b/src/xml/simple-document.h index ff1d94b0c..7cbe50dda 100644 --- a/src/xml/simple-document.h +++ b/src/xml/simple-document.h @@ -66,7 +66,8 @@ public: protected: SimpleDocument(SimpleDocument const &doc) : Node(), SimpleNode(doc), Document(), NodeObserver(), - _in_transaction(false) {} + _in_transaction(false), + _is_CData(false){} SimpleNode *_duplicate(Document* /*doc*/) const { |
