diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-10-23 18:33:19 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-10-23 18:33:19 (GMT) |
commit | 43edc14cd357dcb070402bccc5030507570c22a4 (patch) | |
tree | 05c76a0026b6d1fabe1c3967b041e38b9550f9f7 /src/definition.cpp | |
parent | 151876a8321204bd2ec08ec6c4de38ba9fb2d034 (diff) | |
download | Doxygen-43edc14cd357dcb070402bccc5030507570c22a4.zip Doxygen-43edc14cd357dcb070402bccc5030507570c22a4.tar.gz Doxygen-43edc14cd357dcb070402bccc5030507570c22a4.tar.bz2 |
Introduce new optimized string implementation (attempt 2)
Diffstat (limited to 'src/definition.cpp')
-rw-r--r-- | src/definition.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/definition.cpp b/src/definition.cpp index 3c11916..4a8c65d 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -890,16 +890,17 @@ QCString Definition::getSourceFileBase() const QCString Definition::getSourceAnchor() const { - QCString anchorStr; + const int maxAnchorStrLen = 20; + char anchorStr[maxAnchorStrLen]; if (m_impl->body && m_impl->body->startLine!=-1) { if (Htags::useHtags) { - anchorStr.sprintf("L%d",m_impl->body->startLine); + snprintf(anchorStr,maxAnchorStrLen,"L%d",m_impl->body->startLine); } else { - anchorStr.sprintf("l%05d",m_impl->body->startLine); + snprintf(anchorStr,maxAnchorStrLen,"l%05d",m_impl->body->startLine); } } return anchorStr; @@ -1163,8 +1164,9 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, { ol.disable(OutputGenerator::Latex); } - QCString lineStr,anchorStr; - anchorStr.sprintf("l%05d",md->getStartBodyLine()); + const int maxLineNrStr = 10; + char anchorStr[maxLineNrStr]; + snprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine()); //printf("Write object link to %s\n",md->getBodyDef()->getSourceFileBase().data()); ol.writeObjectLink(0,md->getBodyDef()->getSourceFileBase(),anchorStr,name); ol.popGeneratorState(); |