diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2011-11-07 14:03:20 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2011-11-07 14:03:20 +0000 |
| commit | 5e7d96110e0c4b19b7e1b05e949f70673358be05 (patch) | |
| tree | 321a1b7889a98263f506ac08ec86fa3015c777b7 /src | |
| parent | Powerstroke: adjust control points when adding or deleting knots, to try and ... (diff) | |
| download | inkscape-5e7d96110e0c4b19b7e1b05e949f70673358be05.tar.gz inkscape-5e7d96110e0c4b19b7e1b05e949f70673358be05.zip | |
cppcheck: performance and initialisation
(bzr r10729)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dom/css.h | 3 | ||||
| -rw-r--r-- | src/dom/domimpl.cpp | 4 | ||||
| -rw-r--r-- | src/dom/uri.cpp | 19 | ||||
| -rw-r--r-- | src/dom/util/digest.h | 4 |
4 files changed, 16 insertions, 14 deletions
diff --git a/src/dom/css.h b/src/dom/css.h index 4459a1006..3f0af9ad0 100644 --- a/src/dom/css.h +++ b/src/dom/css.h @@ -390,7 +390,7 @@ public: /** * */ - CSSStyleSheet() : stylesheets::StyleSheet() + CSSStyleSheet() : stylesheets::StyleSheet(), ownerRule(0) { } @@ -1217,6 +1217,7 @@ public: */ void assign(const CSSImportRule &other) { + href = other.href; mediaList = other.mediaList; styleSheet = other.styleSheet; } diff --git a/src/dom/domimpl.cpp b/src/dom/domimpl.cpp index 53118b1d9..1a562e5c6 100644 --- a/src/dom/domimpl.cpp +++ b/src/dom/domimpl.cpp @@ -2077,7 +2077,7 @@ void UserDataHandlerImpl::handle(unsigned short /*operation*/, /** * */ -DOMErrorImpl::DOMErrorImpl() +DOMErrorImpl::DOMErrorImpl() : message(""), severity(0), type("") { } @@ -2183,7 +2183,7 @@ bool DOMErrorHandlerImpl::handleError(const DOMError *error) /** * */ -DOMLocatorImpl::DOMLocatorImpl() +DOMLocatorImpl::DOMLocatorImpl() : byteOffset(0), columnNumber (0), uri(""), lineNumber(0), relatedNode(0), utf16Offset(0) { } diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp index d559dffeb..e1089017d 100644 --- a/src/dom/uri.cpp +++ b/src/dom/uri.cpp @@ -144,6 +144,7 @@ void URI::init() scheme = SCHEME_NONE; schemeStr.clear(); port = 0; + portSpecified = false; authority.clear(); path.clear(); absolute = false; @@ -200,18 +201,18 @@ static DOMString toStr(const std::vector<int> &arr) DOMString URI::toString() const { DOMString str = schemeStr; - if (authority.size() > 0) + if (!authority.empty()) { str.append("//"); str.append(toStr(authority)); } str.append(toStr(path)); - if (query.size() > 0) + if (!query.empty()) { str.append("?"); str.append(toStr(query)); } - if (fragment.size() > 0) + if (!fragment.empty()) { str.append("#"); str.append(toStr(fragment)); @@ -380,11 +381,11 @@ URI URI::resolve(const URI &other) const return other; //## 2 - if (other.fragment.size() > 0 && - other.path.size() == 0 && - other.scheme == SCHEME_NONE && - other.authority.size() == 0 && - other.query.size() == 0 ) + if (!other.fragment.empty() && + other.path.empty() && + other.scheme == SCHEME_NONE && + other.authority.empty() && + other.query.empty()) { URI fragUri = *this; fragUri.fragment = other.fragment; @@ -398,7 +399,7 @@ URI URI::resolve(const URI &other) const newUri.schemeStr = schemeStr; newUri.query = other.query; newUri.fragment = other.fragment; - if (other.authority.size() > 0) + if (!other.authority.empty()) { //# 3.2 if (absolute || other.absolute) diff --git a/src/dom/util/digest.h b/src/dom/util/digest.h index fed5b7e86..c161b86bb 100644 --- a/src/dom/util/digest.h +++ b/src/dom/util/digest.h @@ -146,8 +146,8 @@ public: /** * Append a byte vector to the hash */ - virtual void append(const std::vector<unsigned char> buf) - { + virtual void append(const std::vector<unsigned char> &buf) + { //NOTE: function seems to be unused for (unsigned int i=0 ; i<buf.size() ; i++) update(buf[i]); } |
