diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2016-02-22 20:16:54 +0000 |
|---|---|---|
| committer | Kris De Gussem <Kris.De.Gussem@hotmail.com> | 2016-02-22 20:16:54 +0000 |
| commit | 4aca329e373b27be4f8171e9f6cf2c8e04d591bc (patch) | |
| tree | 5701d2888ac16c9469949ab6d0267cc94284dd4e /src | |
| parent | static code analysis (diff) | |
| download | inkscape-4aca329e373b27be4f8171e9f6cf2c8e04d591bc.tar.gz inkscape-4aca329e373b27be4f8171e9f6cf2c8e04d591bc.zip | |
static code analysis
(bzr r14665)
Diffstat (limited to 'src')
| -rw-r--r-- | src/io/inkjar.cpp | 17 | ||||
| -rw-r--r-- | src/object-snapper.cpp | 1 | ||||
| -rw-r--r-- | src/sp-mask.cpp | 8 |
3 files changed, 15 insertions, 11 deletions
diff --git a/src/io/inkjar.cpp b/src/io/inkjar.cpp index fb1fedf55..345455c4a 100644 --- a/src/io/inkjar.cpp +++ b/src/io/inkjar.cpp @@ -103,14 +103,19 @@ bool JarFile::init_inflation() bool JarFile::open() { + if (_file != NULL) { + fclose(_file); + } if ((_file = fopen(_filename, "r")) == NULL) { - fprintf(stderr, "open failed.\n"); - return false; + fprintf(stderr, "open failed.\n"); + return false; + } + if (!init_inflation()) { + return false; + } + else { + return true; } - if (!init_inflation()) - return false; - - return true; } bool JarFile::close() diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 5b7874c61..3e559ee7a 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -641,7 +641,6 @@ void Inkscape::ObjectSnapper::_snapPathsConstrained(IntermSnapResults &isr, bool strict_snapping = _snapmanager->snapprefs.getStrictSnapping(); // Find all intersections of the constrained path with the snap target candidates - std::vector<Geom::Point> intersections; for (std::vector<SnapCandidatePath >::const_iterator k = _paths_to_snap_to->begin(); k != _paths_to_snap_to->end(); ++k) { if (k->path_vector && _allowSourceToSnapToTarget(p.getSourceType(), (*k).target_type, strict_snapping)) { // Do the intersection math diff --git a/src/sp-mask.cpp b/src/sp-mask.cpp index 7b9ab11c3..3537c7bac 100644 --- a/src/sp-mask.cpp +++ b/src/sp-mask.cpp @@ -139,12 +139,12 @@ void SPMask::update(SPCtx* ctx, unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; std::vector<SPObject *> children = this->childList(false); - for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();child++) { + for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();++child) { sp_object_ref(*child); } - for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();child++) { + for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();++child) { if (flags || ((*child)->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { (*child)->updateDisplay(ctx, flags); } @@ -173,11 +173,11 @@ void SPMask::modified(unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; std::vector<SPObject *> children = this->childList(false); - for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();child++) { + for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();++child) { sp_object_ref(*child); } - for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();child++) { + for (std::vector<SPObject *>::const_iterator child = children.begin();child != children.end();++child) { if (flags || ((*child)->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { (*child)->emitModified(flags); } |
