From 4658413ff3b9551fac67907f296a586e9f2c15ed Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 2 Mar 2020 20:10:51 +0100 Subject: Enabled stricter compiler warnings and fixed all new warnings --- CMakeLists.txt | 1 + addon/doxysearch/doxyindexer.cpp | 4 +- addon/doxysearch/doxysearch.cpp | 42 ++-- cmake/CompilerWarnings.cmake | 110 ++++++++ libmscgen/gd.c | 4 +- libmscgen/mscgen_api.c | 17 +- libmscgen/mscgen_gd_out.c | 2 +- libmscgen/mscgen_language.y | 2 +- qtools/qasciidict.h | 2 +- qtools/qcache.h | 2 +- qtools/qcstring.h | 48 ++-- qtools/qdatastream.cpp | 10 +- qtools/qgstring.h | 2 +- qtools/qintdict.h | 2 +- qtools/qptrdict.h | 2 +- qtools/qstring.h | 6 +- qtools/qvaluelist.h | 4 - src/CMakeLists.txt | 17 +- src/bufstr.h | 8 +- src/cite.cpp | 32 +-- src/classdef.cpp | 120 ++++----- src/classdef.h | 6 +- src/classlist.cpp | 4 +- src/classlist.h | 4 +- src/code.l | 42 ++-- src/commentcnv.l | 16 +- src/commentscan.l | 45 ++-- src/condparser.cpp | 3 +- src/configimpl.l | 311 ++++++++++++----------- src/constexp.l | 14 +- src/context.cpp | 100 ++++---- src/context.h | 84 +++---- src/declinfo.l | 28 ++- src/defargs.l | 23 +- src/definition.cpp | 98 ++++---- src/definitionimpl.h | 54 ++-- src/diagram.cpp | 127 +++++----- src/dirdef.cpp | 16 +- src/dirdef.h | 4 +- src/docbookgen.cpp | 45 ++-- src/docbookgen.h | 52 ++-- src/docbookvisitor.cpp | 30 ++- src/docparser.cpp | 64 ++--- src/docparser.h | 66 +++-- src/doctokenizer.l | 16 +- src/dotclassgraph.cpp | 6 +- src/dotdirdeps.cpp | 2 - src/dotfilepatcher.cpp | 8 +- src/dotgraph.h | 5 +- src/dotnode.cpp | 21 +- src/dotnode.h | 32 +-- src/dotrunner.cpp | 6 +- src/doxygen.cpp | 38 ++- src/example.h | 2 +- src/filedef.h | 2 +- src/formula.cpp | 8 +- src/fortrancode.l | 144 +++++------ src/fortranscanner.l | 22 +- src/ftvhelp.cpp | 9 +- src/groupdef.cpp | 301 +++++++++++----------- src/growbuf.h | 52 ++-- src/htmldocvisitor.cpp | 4 +- src/htmlgen.cpp | 15 +- src/image.cpp | 105 ++++---- src/image.h | 40 +-- src/index.cpp | 14 +- src/latexgen.cpp | 4 +- src/latexgen.h | 2 +- src/layout.cpp | 8 +- src/markdown.cpp | 17 +- src/memberdef.cpp | 22 +- src/membergroup.cpp | 8 +- src/membergroup.h | 1 - src/memberlist.cpp | 4 +- src/memberlist.h | 4 +- src/membername.h | 4 +- src/message.cpp | 2 +- src/namespacedef.h | 4 +- src/outputgen.h | 6 +- src/pagedef.cpp | 7 +- src/pagedef.h | 12 +- src/perlmodgen.cpp | 24 +- src/plantuml.cpp | 6 +- src/portable.cpp | 12 +- src/portable.h | 2 +- src/pre.l | 92 +++---- src/pycode.l | 53 ++-- src/pyscanner.l | 19 +- src/resourcemgr.cpp | 18 +- src/rtfgen.cpp | 13 +- src/rtfstyle.cpp | 21 +- src/scanner.l | 15 +- src/searchindex.cpp | 6 +- src/section.h | 2 +- src/sortdict.h | 6 +- src/sqlcode.l | 20 +- src/tclscanner.l | 24 +- src/template.cpp | 50 ++-- src/template.h | 10 +- src/translator_dk.h | 2 +- src/util.cpp | 523 +++------------------------------------ src/util.h | 2 +- src/vhdlcode.l | 9 +- src/vhdldocgen.cpp | 145 ++--------- src/vhdljjparser.cpp | 4 +- src/xmlcode.l | 4 + src/xmldocvisitor.cpp | 9 +- src/xmlgen.cpp | 2 - vhdlparser/vhdlstring.h | 9 +- 109 files changed, 1660 insertions(+), 2072 deletions(-) create mode 100644 cmake/CompilerWarnings.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index cd0fcaa..764aebe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,6 +157,7 @@ if (win_static) endforeach() endif() +include(cmake/CompilerWarnings.cmake) add_subdirectory(libmd5) add_subdirectory(liblodepng) diff --git a/addon/doxysearch/doxyindexer.cpp b/addon/doxysearch/doxyindexer.cpp index 12d3e9a..df596a2 100644 --- a/addon/doxysearch/doxyindexer.cpp +++ b/addon/doxysearch/doxyindexer.cpp @@ -52,7 +52,7 @@ static std::string trim(const std::string& str, return ""; // no content size_t strEnd = str.find_last_not_of(whitespace); - int strRange = strEnd - strBegin + 1; + size_t strRange = strEnd - strBegin + 1; return str.substr(strBegin, strRange); } @@ -72,7 +72,7 @@ static std::string reduce(const std::string& str, while (beginSpace != std::string::npos) { size_t endSpace = result.find_first_not_of(whitespace, beginSpace); - int range = endSpace - beginSpace; + size_t range = endSpace - beginSpace; result.replace(beginSpace, range, fill); diff --git a/addon/doxysearch/doxysearch.cpp b/addon/doxysearch/doxysearch.cpp index 98adab4..4c4dc72 100644 --- a/addon/doxysearch/doxysearch.cpp +++ b/addon/doxysearch/doxysearch.cpp @@ -76,7 +76,7 @@ static std::string uriDecode(const std::string & sSrc) // (0-9, A-F) are reserved for future extension" const unsigned char * pSrc = (const unsigned char *)sSrc.c_str(); - const int SRC_LEN = sSrc.length(); + const size_t SRC_LEN = sSrc.length(); const unsigned char * const SRC_END = pSrc + SRC_LEN; // last decodable '%' const unsigned char * const SRC_LAST_DEC = SRC_END - 2; @@ -140,9 +140,9 @@ T fromString(const std::string& s) /** Class that holds the starting position of a word */ struct WordPosition { - WordPosition(int s,int i) : start(s), index(i) {} - int start; - int index; + WordPosition(size_t s,size_t i) : start(s), index(i) {} + size_t start; + size_t index; }; /** Class representing the '<' operator for WordPosition objects based on position. */ @@ -174,20 +174,20 @@ struct Fragment_greater /** Class representing a range within a string */ struct Range { - Range(int s,int e) : start(s), end(e) {} - int start; - int end; + Range(size_t s,size_t e) : start(s), end(e) {} + size_t start; + size_t end; }; /** Returns true if [start..start+len] is inside one of the \a ranges. */ -static bool insideRange(const std::vector &ranges,int start,int len) +static bool insideRange(const std::vector &ranges,size_t start,size_t len) { for (std::vector::const_iterator it = ranges.begin(); it!=ranges.end(); ++it ) { Range r = *it; - if (start>=r.start && start+len=r.start && start+len"; const std::string spanEnd=""; const std::string dots="..."; - const int fragLen = 60; - int sl=s.length(); + const size_t fragLen = 60; + size_t sl=s.length(); // find positions of words in s - size_t j=0; + int j=0; std::vector positions; for (std::vector::const_iterator it=words.begin(); it!=words.end(); ++it,++j ) { - int pos=0; + size_t pos=0; size_t i; std::string word = *it; while ((i=s.find(word,pos))!=std::string::npos) @@ -236,8 +236,8 @@ static void highlighter(const std::string &s, { WordPosition wp = *it; std::string w = words[wp.index]; - int i=wp.start; - int wl=w.length(); + size_t i=wp.start; + size_t wl=w.length(); if (!insideRange(ranges,i,wl)) { if (wl>fragLen) @@ -248,8 +248,8 @@ static void highlighter(const std::string &s, else { std::string startFragment,endFragment; - int bi=i-(fragLen-wl)/2; - int ei=i+wl+(fragLen-wl)/2; + size_t bi=i-(fragLen-wl)/2; + size_t ei=i+wl+(fragLen-wl)/2; int occ=0; if (bi<0) { ei-=bi; bi=0; } else startFragment=dots; if (ei>sl) { ei=sl; } else endFragment=dots; @@ -257,14 +257,14 @@ static void highlighter(const std::string &s, while (ei::const_iterator it2=positions.begin(); it2!=positions.end(); ++it2) { WordPosition wp2 = *it2; std::string w2 = words[wp2.index]; - int wl2 = w2.length(); + size_t wl2 = w2.length(); if (wp2.start>=bi && wp2.start+wl2<=ei) // word is inside the range! { fragment+=s.substr(pos,wp2.start-pos)+ @@ -288,10 +288,10 @@ static void highlighter(const std::string &s, static std::string escapeString(const std::string &s) { std::stringstream dst; - for (unsigned int i=0;iw; @@ -1982,7 +1982,7 @@ BGD_DECLARE(void) gdImageStringUp (gdImagePtr im, gdFontPtr f, { int i; int l; - l = strlen ((char *) s); + l = (int)strlen((char *) s); for (i = 0; (i < l); i++) { gdImageCharUp (im, f, x, y, s[i], color); y -= f->w; diff --git a/libmscgen/mscgen_api.c b/libmscgen/mscgen_api.c index b28d653..376b9d8 100644 --- a/libmscgen/mscgen_api.c +++ b/libmscgen/mscgen_api.c @@ -300,7 +300,7 @@ static char *splitStringToWidth(Context *ctx, char *l, unsigned int width) /* Copy the remaining line to the start of the string */ m = 0; - n = (p - l); + n = (int)(p - l); while (isspace(orig[n]) && orig[n] != '\0') { @@ -390,7 +390,7 @@ static unsigned int computeLabelLines(Context *ctx, char *nextLine = strstr(label, "\\n"); if (nextLine) { - const int lineLen = nextLine - label; + const int lineLen = (int)(nextLine - label); /* Allocate storage and duplicate the line */ retLines[c] = malloc_s(lineLen + 1); @@ -633,11 +633,11 @@ static char *getLine(const char *string, /* Determine the length of the line */ if(lineEnd != NULL) { - lineLen = lineEnd - lineStart; + lineLen = (unsigned int)(lineEnd - lineStart); } else { - lineLen = strlen(string) - (lineStart - string); + lineLen = (unsigned int)(strlen(string) - (lineStart - string)); } /* Clamp the length to the buffer */ @@ -1328,8 +1328,8 @@ static void arcLine(Context *ctx, hasArrows = FALSE; /* Get co-ordinates of the arc end-point */ - ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8, - ctx->opts.loopArcHeight, 180.0f - 45.0f, + ADrawComputeArcPoint((float)sx, (float)(y - 1), (float)(ctx->opts.entitySpacing - 8), + (float)ctx->opts.loopArcHeight, 180.0f - 45.0f, &px, &py); /* Draw a cross */ @@ -1392,8 +1392,9 @@ static void arcLine(Context *ctx, hasArrows = FALSE; /* Get co-ordinates of the arc end-point */ - ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8, - ctx->opts.loopArcHeight, 45.0f, + ADrawComputeArcPoint((float)sx, (float)(y - 1), + (float)(ctx->opts.entitySpacing - 8), + (float)ctx->opts.loopArcHeight, 45.0f, &px, &py); /* Draw a cross */ diff --git a/libmscgen/mscgen_gd_out.c b/libmscgen/mscgen_gd_out.c index 8d8198c..72c79f5 100644 --- a/libmscgen/mscgen_gd_out.c +++ b/libmscgen/mscgen_gd_out.c @@ -180,7 +180,7 @@ unsigned int gdoTextWidth(struct ADrawTag *ctx, const char *string) { #ifndef USE_FREETYPE - const unsigned int l = strlen(string); + const unsigned int l = (unsigned int)strlen(string); /* Remove 1 pixel since there is usually an uneven gap at * the right of the last character for the fixed width diff --git a/libmscgen/mscgen_language.y b/libmscgen/mscgen_language.y index 0c0ab50..02b36bb 100644 --- a/libmscgen/mscgen_language.y +++ b/libmscgen/mscgen_language.y @@ -179,7 +179,7 @@ int yywrap() char *removeEscapes(char *in) { - const uint16_t l = strlen(in); + const uint16_t l = (uint16_t)strlen(in); char *r = (char *)malloc_s(l + 1); uint16_t t, u; diff --git a/qtools/qasciidict.h b/qtools/qasciidict.h index 29fcf2f..6a93a02 100644 --- a/qtools/qasciidict.h +++ b/qtools/qasciidict.h @@ -46,7 +46,7 @@ template class Q_EXPORT QAsciiDict : public QGDict { public: - QAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE ) + QAsciiDict(uint size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE ) : QGDict(size,AsciiKey,caseSensitive,copyKeys) {} QAsciiDict( const QAsciiDict &d ) : QGDict(d) {} ~QAsciiDict() { clear(); } diff --git a/qtools/qcache.h b/qtools/qcache.h index 39d4f7a..87f9866 100644 --- a/qtools/qcache.h +++ b/qtools/qcache.h @@ -46,7 +46,7 @@ template class Q_EXPORT QCache : public QGCache { public: QCache( const QCache &c ) : QGCache(c) {} - QCache( int maxCost=100, int size=17, bool caseSensitive=TRUE ) + QCache( int maxCost=100, uint size=17, bool caseSensitive=TRUE ) : QGCache( maxCost, size, AsciiKey, caseSensitive, TRUE ) {} ~QCache() { clear(); } QCache &operator=( const QCache &c ) diff --git a/qtools/qcstring.h b/qtools/qcstring.h index e1414b5..a527fec 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -149,7 +149,7 @@ public: /** creates a string with room for size characters * @param[in] size the number of character to allocate (including the 0-terminator) */ - explicit QCString( int size ) : m_rep(size) + explicit QCString( uint size ) : m_rep(size) { } @@ -269,7 +269,7 @@ public: bool stripPrefix(const char *prefix); QCString left( uint len ) const; QCString right( uint len ) const; - QCString mid( uint index, uint len=0xffffffff) const; + QCString mid( uint index, uint len=(uint)-1) const; QCString lower() const; QCString upper() const; QCString stripWhiteSpace() const; @@ -307,8 +307,8 @@ public: QCString &operator+=( const char *str ) { if (!str) return *this; - int len1 = length(); - int len2 = (int)strlen(str); + uint len1 = length(); + uint len2 = (uint)strlen(str); resize(len1+len2+1); memcpy(rawData()+len1,str,len2); return *this; @@ -317,7 +317,7 @@ public: /** Appends character \a c to this string and returns a reference to the result. */ QCString &operator+=( char c ) { - int len = length(); + uint len = length(); resize(len+2); rawData()[len]=c; return *this; @@ -361,7 +361,7 @@ public: // ref counting string header struct LSHeader { - int len; // length of string without 0 terminator + uint len; // length of string without 0 terminator int refCount; // -1=leaked, 0=one ref & non-cost, n>0, n+1 refs, const }; // ref counting string data and methods @@ -374,7 +374,7 @@ public: // creates a LSData item with room for size bytes (which includes the 0 terminator!) // if size is zero, an empty string will be created. - static LSData *create(int size) + static LSData *create(uint size) { LSData *data; data = (LSData*)malloc(sizeof(LSHeader)+size); @@ -403,7 +403,7 @@ public: else // need to make a copy { LSData *newData = LSData::create(size); - int len = d->len; + uint len = d->len; if (len>=size) len=size-1; memcpy(newData->toStr(),d->toStr(),len); newData->toStr()[len]=0; @@ -454,14 +454,14 @@ public: u = s.u; // avoid uninitialized warning from gcc } } - StringRep(int size) + StringRep(uint size) { u.s.isShort = size<=SHORT_STR_CAPACITY; if (size<=SHORT_STR_CAPACITY) // init short string { if (size>0) { - u.s.len = size-1; + u.s.len = (uchar)(size-1); u.s.str[size-1]='\0'; } else @@ -478,11 +478,11 @@ public: { if (str) { - int len = (int)strlen(str); + uint len = (uint)strlen(str); u.s.isShort = lenlen==0 ? 0 : u.l.d->toStr(); } } - char &at(int i) const + char &at(uint i) const { if (u.s.isShort) { @@ -622,7 +622,7 @@ public: { if (newlen>0) { - u.s.len = newlen-1; + u.s.len = (uchar)(newlen-1); u.s.str[newlen-1]='\0'; } else // string becomes empty @@ -668,21 +668,21 @@ public: } bool fill( char c, int len ) { - if (len<0) len=length(); + uint ulen = len<0 ? length() : (uint)len; if (!u.s.isShort) // detach from shared string { - resize(len+1); + resize(ulen+1); } - else if (len!=(int)length()) + else if (ulen!=length()) { - if (len>0) + if (ulen>0) { - resize(len+1); + resize(ulen+1); } } - if (len>0) + if (ulen>0) { - memset(rawData(),c,len); + memset(rawData(),c,ulen); } return TRUE; } diff --git a/qtools/qdatastream.cpp b/qtools/qdatastream.cpp index 5190b53..a2e5c3b 100644 --- a/qtools/qdatastream.cpp +++ b/qtools/qdatastream.cpp @@ -730,7 +730,7 @@ QDataStream &QDataStream::operator<<( Q_INT16 i ) if ( printable ) { // printable data char buf[16]; sprintf( buf, "%d\n", i ); - dev->writeBlock( buf, strlen(buf) ); + dev->writeBlock( buf, (int)strlen(buf) ); } else if ( noswap ) { // no conversion needed dev->writeBlock( (char *)&i, sizeof(Q_INT16) ); } else { // swap bytes @@ -761,7 +761,7 @@ QDataStream &QDataStream::operator<<( Q_INT32 i ) if ( printable ) { // printable data char buf[16]; sprintf( buf, "%d\n", i ); - dev->writeBlock( buf, strlen(buf) ); + dev->writeBlock( buf, (int)strlen(buf) ); } else if ( noswap ) { // no conversion needed dev->writeBlock( (char *)&i, sizeof(Q_INT32) ); } else { // swap bytes @@ -793,7 +793,7 @@ QDataStream &QDataStream::operator<<( Q_INT64 i ) if ( printable ) { // printable data char buf[20]; sprintf( buf, "%ld\n", i ); - dev->writeBlock( buf, strlen(buf) ); + dev->writeBlock( buf, (int)strlen(buf) ); } else if ( noswap ) { // no conversion needed dev->writeBlock( (char *)&i, sizeof(Q_INT64) ); } else { // swap bytes @@ -839,7 +839,7 @@ QDataStream &QDataStream::operator<<( float f ) if ( printable ) { // printable data char buf[32]; sprintf( buf, "%g\n", (double)f ); - dev->writeBlock( buf, strlen(buf) ); + dev->writeBlock( buf, (int)strlen(buf) ); } else { float g = f; // fixes float-on-stack problem if ( noswap ) { // no conversion needed @@ -869,7 +869,7 @@ QDataStream &QDataStream::operator<<( double f ) if ( printable ) { // printable data char buf[32]; sprintf( buf, "%g\n", f ); - dev->writeBlock( buf, strlen(buf) ); + dev->writeBlock( buf, (int)strlen(buf) ); } else if ( noswap ) { // no conversion needed dev->writeBlock( (char *)&f, sizeof(double) ); } else { // swap bytes diff --git a/qtools/qgstring.h b/qtools/qgstring.h index 6934c93..0af1045 100644 --- a/qtools/qgstring.h +++ b/qtools/qgstring.h @@ -43,7 +43,7 @@ class QGString bool truncate( uint pos ) { return resize(pos+1); } operator const char *() const { return (const char *)data(); } char &at( uint index ) const { return m_data[index]; } - char &operator[]( int i ) const { return at(i); } + char &operator[]( uint i ) const { return at(i); } private: char * m_data; diff --git a/qtools/qintdict.h b/qtools/qintdict.h index ddc5fdf..0606ec8 100644 --- a/qtools/qintdict.h +++ b/qtools/qintdict.h @@ -46,7 +46,7 @@ template class Q_EXPORT QIntDict : public QGDict { public: - QIntDict(int size=17) : QGDict(size,IntKey,0,0) {} + QIntDict(uint size=17) : QGDict(size,IntKey,0,0) {} QIntDict( const QIntDict &d ) : QGDict(d) {} ~QIntDict() { clear(); } QIntDict &operator=(const QIntDict &d) diff --git a/qtools/qptrdict.h b/qtools/qptrdict.h index c075e30..df8bcb4 100644 --- a/qtools/qptrdict.h +++ b/qtools/qptrdict.h @@ -46,7 +46,7 @@ template class Q_EXPORT QPtrDict : public QGDict { public: - QPtrDict(int size=17) : QGDict(size,PtrKey,0,0) {} + QPtrDict(uint size=17) : QGDict(size,PtrKey,0,0) {} QPtrDict( const QPtrDict &d ) : QGDict(d) {} ~QPtrDict() { clear(); } QPtrDict &operator=(const QPtrDict &d) diff --git a/qtools/qstring.h b/qtools/qstring.h index d459132..293768f 100644 --- a/qtools/qstring.h +++ b/qtools/qstring.h @@ -147,8 +147,8 @@ public: QString decomposition() const; Decomposition decompositionTag() const; - char latin1() const { return rw ? 0 : cl; } - ushort unicode() const { return (rw << 8) | cl; } + char latin1() const { return rw ? 0 : (char)cl; } + ushort unicode() const { return (ushort)((rw << 8) | cl); } #ifndef QT_NO_CAST_ASCII // like all ifdef'd code this is undocumented operator char() const { return latin1(); } @@ -333,7 +333,7 @@ struct Q_EXPORT QStringData : public QShared { QStringData() : unicode(0), ascii(0), len(0), maxl(0), dirtyascii(0) { ref(); } QStringData(QChar *u, uint l, uint m) : - unicode(u), ascii(0), len(l), maxl(m), dirtyascii(0) { } + unicode(u), ascii(0), len(l), maxl(m&0x3FFFFFFF), dirtyascii(0) { } ~QStringData() { if ( unicode ) delete[] ((char*)unicode); if ( ascii ) delete[] ascii; } diff --git a/qtools/qvaluelist.h b/qtools/qvaluelist.h index a1014ed..eb827fe 100644 --- a/qtools/qvaluelist.h +++ b/qtools/qvaluelist.h @@ -43,10 +43,6 @@ #include "qdatastream.h" #endif // QT_H -#if defined(_CC_MSVC_) -#pragma warning(disable:4284) // "return type for operator -> is not a UDT" -#endif - template class Q_EXPORT QValueListNode { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 23460d0..bed61a2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -148,13 +148,6 @@ add_library(doxycfg STATIC ) add_library(_doxygen STATIC - # custom generated files - ${GENERATED_SRC}/lang_cfg.h - ${GENERATED_SRC}/settings.h - ${GENERATED_SRC}/layout_default.xml.h - ${GENERATED_SRC}/ce_parse.h - ${GENERATED_SRC}/configvalues.h - ${GENERATED_SRC}/resources.cpp # generated for/by flex/bison #${LEX_FILES_H} #unfortunately doesn't work in older versions of CMake (like 3.6.2) #${LEX_FILES_CPP} #unfortunately doesn't work in older versions of CMake (like 3.6.2) @@ -196,6 +189,13 @@ add_library(_doxygen STATIC ${GENERATED_SRC}/xmlcode.cpp # ${GENERATED_SRC}/ce_parse.cpp + # custom generated files + ${GENERATED_SRC}/lang_cfg.h + ${GENERATED_SRC}/settings.h + ${GENERATED_SRC}/layout_default.xml.h + ${GENERATED_SRC}/ce_parse.h + ${GENERATED_SRC}/configvalues.h + ${GENERATED_SRC}/resources.cpp # arguments.cpp cite.cpp @@ -330,5 +330,8 @@ target_link_libraries(doxygen ${EXTRA_LIBS} ${CLANG_LIBS} ) +set_project_warnings(doxycfg) +set_project_warnings(_doxygen) +set_project_warnings(doxygen) install(TARGETS doxygen DESTINATION bin) diff --git a/src/bufstr.h b/src/bufstr.h index 331def2..e64a049 100644 --- a/src/bufstr.h +++ b/src/bufstr.h @@ -30,7 +30,7 @@ class BufStr { public: - BufStr(int size) + BufStr(uint size) : m_size(size), m_writeOffset(0), m_spareRoom(10240), m_buf(0) { m_buf = (char *)calloc(size,1); @@ -44,7 +44,7 @@ class BufStr makeRoomFor(1); m_buf[m_writeOffset++]=c; } - void addArray(const char *a,int len) + void addArray(const char *a,uint len) { makeRoomFor(len); memcpy(m_buf+m_writeOffset,a,len); @@ -74,7 +74,7 @@ class BufStr memset(m_buf+oldsize,0,m_size-oldsize); } } - int size() const + uint size() const { return m_size; } @@ -115,7 +115,7 @@ class BufStr } uint m_size; uint m_writeOffset; - const int m_spareRoom; // 10Kb extra room to avoid frequent resizing + const uint m_spareRoom; // 10Kb extra room to avoid frequent resizing char *m_buf; }; diff --git a/src/cite.cpp b/src/cite.cpp index 612ddc1..dac2bcd 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -94,7 +94,7 @@ void CitationManager::clear() bool CitationManager::isEmpty() const { - int numFiles = Config_getList(CITE_BIB_FILES).count(); + uint numFiles = Config_getList(CITE_BIB_FILES).count(); return (numFiles==0 || p->entries.empty()); } @@ -135,15 +135,15 @@ void CitationManager::generatePage() err("could not open file %s for reading\n",bibFile.data()); } QCString doc; - QFileInfo fi(bibFile); QCString input(fi.size()+1); f.readBlock(input.rawData(),fi.size()); f.close(); input.at(fi.size())='\0'; - int pos=0,s; + int pos=0; + int s; while ((s=input.find('\n',pos))!=-1) { - QCString line = input.mid(pos,s-pos); + QCString line = input.mid((uint)pos,(uint)(s-pos)); pos=s+1; int i; @@ -153,7 +153,7 @@ void CitationManager::generatePage() int k=line.find("}",i); if (j!=-1 && k!=-1) { - QCString label = line.mid(j+1,k-j-1); + QCString label = line.mid((uint)(j+1),(uint)(k-j-1)); if (p->entries.find(label.data())==p->entries.end()) // not found yet { insert(label); @@ -246,25 +246,25 @@ void CitationManager::generatePage() { err("could not open file %s for reading\n",citeListFile.data()); } - bool insideBib=FALSE; - + QCString doc; QFileInfo fi(citeListFile); QCString input(fi.size()+1); f.readBlock(input.rawData(),fi.size()); f.close(); input.at(fi.size())='\0'; + + bool insideBib=FALSE; int pos=0,s; //printf("input=[%s]\n",input.data()); while ((s=input.find('\n',pos))!=-1) { - QCString line = input.mid(pos,s-pos); + QCString line = input.mid((uint)pos,(uint)(s-pos)); //printf("pos=%d s=%d line=[%s]\n",pos,s,line.data()); pos=s+1; if (line.find(" name=%s pattern=%s match at %d\n",symName.data(),pattern.data(),i); @@ -196,11 +197,12 @@ static bool matchExcludedSymbols(const char *name) int i = symName.find(pattern); if (i!=-1) // we have a match! { - int pl=pattern.length(); - int sl=symName.length(); + uint ui=(uint)i; + uint pl=pattern.length(); + uint sl=symName.length(); // check if it is a whole word match - if ((i==0 || (!isId(symName.at(i-1)) && !forceStart)) && - (i+pl==sl || (!isId(symName.at(i+pl)) && !forceEnd)) + if ((ui==0 || (!isId(symName.at(ui-1)) && !forceStart)) && + (ui+pl==sl || (!isId(symName.at(ui+pl)) && !forceEnd)) ) { //printf("--> name=%s pattern=%s match at %d\n",symName.data(),pattern.data(),i); @@ -597,10 +599,10 @@ void DefinitionImpl::setDocumentation(const char *d,const char *docFile,int docL // if that is a multibyte one. static bool lastCharIsMultibyte(const QCString &s) { - int l = s.length(); + uint l = s.length(); int p = 0; int pp = -1; - while ((p=nextUtf8CharPosition(s,l,p))0 && needsDot) // add punctuation if needed { int c = brief.at(bl-1); @@ -695,7 +697,7 @@ void DefinitionImpl::setInbodyDocumentation(const char *d,const char *inbodyFile struct FilterCacheItem { portable_off_t filePos; - uint fileSize; + size_t fileSize; }; /*! Cache for storing the result of filtering a file */ @@ -722,7 +724,7 @@ class FilterCache if (f) { bool success=TRUE; - str.resize(item->fileSize+1); + str.resize(static_cast(item->fileSize+1)); if (Portable::fseek(f,item->filePos,SEEK_SET)==-1) { err("Failed to seek to position %d in filter database file %s\n",(int)item->filePos,qPrint(Doxygen::filterDBFileName)); @@ -730,7 +732,7 @@ class FilterCache } if (success) { - int numBytes = fread(str.data(),1,item->fileSize,f); + size_t numBytes = fread(str.data(),1,item->fileSize,f); if (numBytes!=item->fileSize) { err("Failed to read %d bytes from position %d in filter database file %s: got %d bytes\n", @@ -756,7 +758,7 @@ class FilterCache Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd)); f = Portable::popen(cmd,"r"); FILE *bf = Portable::fopen(Doxygen::filterDBFileName,"a+b"); - FilterCacheItem *item = new FilterCacheItem; + item = new FilterCacheItem; item->filePos = m_endPos; if (bf==0) { @@ -768,16 +770,16 @@ class FilterCache return FALSE; } // append the filtered output to the database file - int size=0; + size_t size=0; while (!feof(f)) { - int bytesRead = fread(buf,1,blockSize,f); - int bytesWritten = fwrite(buf,1,bytesRead,bf); + size_t bytesRead = fread(buf,1,blockSize,f); + size_t bytesWritten = fwrite(buf,1,bytesRead,bf); if (bytesRead!=bytesWritten) { // handle error err("Failed to write to filter database %s. Wrote %d out of %d bytes\n", - qPrint(Doxygen::filterDBFileName),bytesWritten,bytesRead); + qPrint(Doxygen::filterDBFileName),(int)bytesWritten,(int)bytesRead); str.addChar('\0'); delete item; Portable::pclose(f); @@ -785,7 +787,7 @@ class FilterCache return FALSE; } size+=bytesWritten; - str.addArray(buf,bytesWritten); + str.addArray(buf,static_cast(bytesWritten)); } str.addChar('\0'); item->fileSize = size; @@ -805,8 +807,8 @@ class FilterCache f = Portable::fopen(fileName,"r"); while (!feof(f)) { - int bytesRead = fread(buf,1,blockSize,f); - str.addArray(buf,bytesRead); + size_t bytesRead = fread(buf,1,blockSize,f); + str.addArray(buf,static_cast(bytesRead)); } str.addChar('\0'); fclose(f); @@ -855,7 +857,7 @@ bool readCodeFragment(const char *fileName, char *p=str.data(); if (p) { - int c=0; + char c=0; int col=0; int lineNr=1; // skip until the startLine has reached @@ -958,7 +960,7 @@ bool readCodeFragment(const char *fileName, int braceIndex = result.findRev('}'); if (braceIndex > newLineIndex) { - result.truncate(braceIndex+1); + result.truncate((uint)braceIndex+1); } endLine=lineNr-1; } @@ -1102,10 +1104,9 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const // write normal text (Man, Latex optionally, RTF optionally) ol.docify(m_impl->body->fileDef->name()); ol.popGeneratorState(); - + // write text right from file marker - ol.parseText(refText.right( - refText.length()-fileMarkerPos-2)); + ol.parseText(refText.right(refText.length()-(uint)fileMarkerPos-2)); } else // file marker before line marker { @@ -1185,8 +1186,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const ol.popGeneratorState(); // write text right from linePos marker - ol.parseText(refText.right( - refText.length()-lineMarkerPos-2)); + ol.parseText(refText.right(refText.length()-(uint)lineMarkerPos-2)); } ol.endParagraph(); } @@ -1282,15 +1282,17 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName, ol.parseText(text); ol.docify(" "); - QCString ldefLine=theTranslator->trWriteList(members->count()); + QCString ldefLine=theTranslator->trWriteList((int)members->count()); QRegExp marker("@[0-9]+"); - int index=0,newIndex,matchLen; + uint index=0; + int matchLen; + int newIndex; // now replace all markers in inheritLine with links to the classes while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1) { bool ok; - ol.parseText(ldefLine.mid(index,newIndex-index)); + ol.parseText(ldefLine.mid(index,(uint)newIndex-index)); uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok); MemberDef *md=members->at(entryIndex); if (ok && md) @@ -1408,7 +1410,7 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName, ol.docify(name); } } - index=newIndex+matchLen; + index=(uint)newIndex+matchLen; } ol.parseText(ldefLine.right(ldefLine.length()-index)); ol.writeString("."); @@ -1747,7 +1749,7 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const int level=1,l; char cs[2]; cs[1]='\0'; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; + std::vector inLi(maxLevel+1,false); for (const SectionInfo *si : m_impl->sectionRefs) { SectionType type = si->type(); @@ -1767,11 +1769,11 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const for (l=level;l>nextLevel;l--) { if (l <= maxLevel && inLi[l]) ol.writeString("\n"); - inLi[l]=FALSE; + inLi[l]=false; if (l <= maxLevel) ol.writeString("\n"); } } - cs[0]='0'+nextLevel; + cs[0]=(char)('0'+nextLevel); if (nextLevel <= maxLevel && inLi[nextLevel]) { ol.writeString("\n"); @@ -1783,7 +1785,7 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const "label()+"\">"+ (si->title().isEmpty()?si->label():titleDoc)+""); } - inLi[nextLevel]=TRUE; + inLi[nextLevel]=true; level = nextLevel; } } @@ -1799,7 +1801,7 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const level--; } if (level <= maxLevel && inLi[level]) ol.writeString("\n"); - inLi[level]=FALSE; + inLi[level]=false; ol.writeString("\n"); ol.writeString("\n"); ol.popGeneratorState(); @@ -1812,8 +1814,8 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const ol.writeString(" \n"); ol.writeString(" " + theTranslator->trRTFTableOfContents() + "\n"); int level=1,l; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; int maxLevel = localToc.docbookLevel(); + std::vector inLi(maxLevel+1,false); for (const SectionInfo *si : m_impl->sectionRefs) { SectionType type = si->type(); @@ -1932,17 +1934,17 @@ QCString abbreviate(const char *s,const char *name) const char *p = briefDescAbbrev.first(); while (p) { - QCString s = p; - s.replace(QRegExp("\\$name"), scopelessName); // replace $name with entity name - s += " "; - stripWord(result,s); + QCString str = p; + str.replace(QRegExp("\\$name"), scopelessName); // replace $name with entity name + str += " "; + stripWord(result,str); p = briefDescAbbrev.next(); } // capitalize first word if (!result.isEmpty()) { - int c=result[0]; + char c=result[0]; if (c>='a' && c<='z') c+='A'-'a'; result[0]=c; } @@ -2161,7 +2163,7 @@ QCString DefinitionImpl::externalReference(const QCString &relPath) const if (dest) { QCString result = *dest; - int l = result.length(); + uint l = result.length(); if (!relPath.isEmpty() && l>0 && result.at(0)=='.') { // relative path -> prepend relPath. result.prepend(relPath); diff --git a/src/definitionimpl.h b/src/definitionimpl.h index d66ac93..d9c222d 100644 --- a/src/definitionimpl.h +++ b/src/definitionimpl.h @@ -237,37 +237,37 @@ class DefinitionAliasImpl : virtual public Definition { return m_def->navigationPathAsString(); } virtual QCString pathFragment() const { return m_def->pathFragment(); } - virtual void setName(const char *name) { } - virtual void setId(const char *name) { } - virtual void setDefFile(const QCString& df,int defLine,int defColumn) {} - virtual void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE) {} - virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine) {} - virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine) {} - virtual void setReference(const char *r) {} - virtual void addSectionsToDefinition(const std::vector &anchorList) {} - virtual void setBodySegment(int bls,int ble) {} - virtual void setBodyDef(FileDef *fd) {} - virtual void addSourceReferencedBy(const MemberDef *d) {} - virtual void addSourceReferences(const MemberDef *d) {} - virtual void setRefItems(const std::vector &sli) {} - virtual void mergeRefItems(Definition *d) {} - virtual void addInnerCompound(const Definition *d) {} - virtual void setOuterScope(Definition *d) {} - virtual void setHidden(bool b) {} - virtual void setArtificial(bool b) {} - virtual void setLanguage(SrcLangExt lang) {} - virtual void writeSourceDef(OutputList &ol,const char *scopeName) const {} - virtual void writeInlineCode(OutputList &ol,const char *scopeName) const {} - virtual void writeSourceRefs(OutputList &ol,const char *scopeName) const {} - virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) const {} - virtual void makePartOfGroup(GroupDef *gd) {} - virtual void writeNavigationPath(OutputList &ol) const {} + virtual void setName(const char *) { } + virtual void setId(const char *) { } + virtual void setDefFile(const QCString&,int,int) {} + virtual void setDocumentation(const char *,const char *,int,bool=TRUE) {} + virtual void setBriefDescription(const char *,const char *,int) {} + virtual void setInbodyDocumentation(const char *,const char *,int) {} + virtual void setReference(const char *) {} + virtual void addSectionsToDefinition(const std::vector &) {} + virtual void setBodySegment(int,int) {} + virtual void setBodyDef(FileDef *) {} + virtual void addSourceReferencedBy(const MemberDef *) {} + virtual void addSourceReferences(const MemberDef *) {} + virtual void setRefItems(const std::vector &) {} + virtual void mergeRefItems(Definition *) {} + virtual void addInnerCompound(const Definition *) {} + virtual void setOuterScope(Definition *) {} + virtual void setHidden(bool) {} + virtual void setArtificial(bool) {} + virtual void setLanguage(SrcLangExt) {} + virtual void writeSourceDef(OutputList &,const char *) const {} + virtual void writeInlineCode(OutputList &,const char *) const {} + virtual void writeSourceRefs(OutputList &,const char *) const {} + virtual void writeSourceReffedBy(OutputList &,const char *) const {} + virtual void makePartOfGroup(GroupDef *) {} + virtual void writeNavigationPath(OutputList &) const {} virtual void writeQuickMemberLinks(OutputList &,const MemberDef *) const {} virtual void writeSummaryLinks(OutputList &) const {} virtual void writeDocAnchorsToTagFile(FTextStream &) const {} - virtual void setLocalName(const QCString name) {} + virtual void setLocalName(const QCString) {} virtual void addSectionsToIndex() {} - virtual void writeToc(OutputList &ol, const LocalToc <) const {} + virtual void writeToc(OutputList &, const LocalToc &) const {} virtual void setCookie(Cookie *cookie) const { delete m_cookie; m_cookie = cookie; } virtual Cookie *cookie() const { return m_cookie; } protected: diff --git a/src/diagram.cpp b/src/diagram.cpp index 25b2c06..d0b7a08 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -42,20 +42,20 @@ class DiagramItemList; class DiagramItem { public: - DiagramItem(DiagramItem *p,int number,const ClassDef *cd, + DiagramItem(DiagramItem *p,uint number,const ClassDef *cd, Protection prot,Specifier virt,const char *ts); ~DiagramItem(); QCString label() const; QCString fileName() const; DiagramItem *parentItem() { return parent; } DiagramItemList *getChildren() { return children; } - void move(int dx,int dy) { x+=dx; y+=dy; } - int xPos() const { return x; } - int yPos() const { return y; } - int avgChildPos() const; - int numChildren() const; + void move(int dx,int dy) { x+=(uint)dx; y+=(uint)dy; } + uint xPos() const { return x; } + uint yPos() const { return y; } + uint avgChildPos() const; + uint numChildren() const; void addChild(DiagramItem *di); - int number() const { return num; } + uint number() const { return num; } Protection protection() const { return prot; } Specifier virtualness() const { return virt; } void putInList() { inList=TRUE; } @@ -64,8 +64,8 @@ class DiagramItem private: DiagramItemList *children; DiagramItem *parent; - int x,y; - int num; + uint x,y; + uint num; Protection prot; Specifier virt; QCString templSpec; @@ -85,8 +85,8 @@ class DiagramItemList : public QList class DiagramRow : public QList { public: - DiagramRow(TreeDiagram *d,int l) : QList() - { + DiagramRow(TreeDiagram *d,uint l) : QList() + { diagram=d; level=l; setAutoDelete(TRUE); @@ -129,7 +129,7 @@ class TreeDiagram : public QList uint baseRows,uint superRows, uint cellWidth,uint cellheight); private: - bool layoutTree(DiagramItem *root,int row); + bool layoutTree(DiagramItem *root,uint row); TreeDiagram &operator=(const TreeDiagram &); TreeDiagram(const TreeDiagram &); }; @@ -139,8 +139,8 @@ class TreeDiagram : public QList //----------------------------------------------------------------------------- const uint maxTreeWidth = 8; -const int gridWidth = 100; -const int gridHeight = 100; +const uint gridWidth = 100; +const uint gridHeight = 100; const uint labelHorSpacing = 10; // horizontal distance between labels const uint labelVertSpacing = 32; // vertical distance between labels @@ -171,7 +171,7 @@ static uint protToMask(Protection p) return 0; } -static uint protToColor(Protection p) +static uchar protToColor(Protection p) { switch(p) { @@ -225,21 +225,23 @@ static Protection getMinProtectionLevel(DiagramItemList *dil) } static void writeBitmapBox(DiagramItem *di,Image *image, - int x,int y,int w,int h,bool firstRow, + uint x,uint y,uint w,uint h,bool firstRow, bool hasDocs,bool children=FALSE) { - int colFill = hasDocs ? (firstRow ? 0 : 2) : 7; - int colBorder = (firstRow || !hasDocs) ? 1 : 3; - int l = Image::stringLength(di->label()); + uchar colFill = hasDocs ? (firstRow ? 0 : 2) : 7; + uchar colBorder = (firstRow || !hasDocs) ? 1 : 3; + uint l = Image::stringLength(di->label()); uint mask=virtToMask(di->virtualness()); image->fillRect(x+1,y+1,w-2,h-2,colFill,mask); image->drawRect(x,y,w,h,colBorder,mask); image->writeString(x+(w-l)/2, y+(h-fontHeight)/2, di->label(),1); if (children) { - int i; + uint i; for (i=0;i<5;i++) + { image->drawHorzLine(y+h+i-6,x+w-2-i,x+w-2,firstRow?1:3,0xffffffff); + } } } @@ -253,7 +255,7 @@ static void writeVectorBox(FTextStream &t,DiagramItem *di, } static void writeMapArea(FTextStream &t,const ClassDef *cd,QCString relPath, - int x,int y,int w,int h) + uint x,uint y,uint w,uint h) { if (cd->isLinkable()) { @@ -283,12 +285,11 @@ static void writeMapArea(FTextStream &t,const ClassDef *cd,QCString relPath, } //----------------------------------------------------------------------------- -DiagramItem::DiagramItem(DiagramItem *p,int number,const ClassDef *cd, +DiagramItem::DiagramItem(DiagramItem *p,uint number,const ClassDef *cd, Protection pr,Specifier vi,const char *ts) -{ - parent=p; - x=y=0; - //name=n; +{ + parent=p; + x=y=0; num=number; children = new DiagramItemList; prot=pr; @@ -297,9 +298,9 @@ DiagramItem::DiagramItem(DiagramItem *p,int number,const ClassDef *cd, classDef=cd; templSpec=ts; } - + DiagramItem::~DiagramItem() -{ +{ delete children; } @@ -330,10 +331,10 @@ QCString DiagramItem::fileName() const return classDef->getOutputFileBase(); } -int DiagramItem::avgChildPos() const +uint DiagramItem::avgChildPos() const { DiagramItem *di; - int c=children->count(); + uint c=children->count(); if (c==0) // no children -> don't move return xPos(); if ((di=children->getFirst())->isInList()) // children should be in a list @@ -344,7 +345,7 @@ int DiagramItem::avgChildPos() const return (children->at(c/2-1)->xPos()+children->at(c/2)->xPos())/2; } -int DiagramItem::numChildren() const +uint DiagramItem::numChildren() const { return children->count(); } @@ -363,7 +364,7 @@ void DiagramRow::insertClass(DiagramItem *parent,const ClassDef *cd,bool doBases cd,prot,virt,ts); //cd->visited=TRUE; if (parent) parent->addChild(di); - di->move(count()*gridWidth,level*gridHeight); + di->move((int)(count()*gridWidth),(int)(level*gridHeight)); append(di); BaseClassList *bcl=doBases ? cd->baseClasses() : cd->subClasses(); int count=0; @@ -431,7 +432,7 @@ void TreeDiagram::moveChildren(DiagramItem *root,int dx) } } -bool TreeDiagram::layoutTree(DiagramItem *root,int r) +bool TreeDiagram::layoutTree(DiagramItem *root,uint r) { bool moved=FALSE; //printf("layoutTree(%s,%d)\n",root->label().data(),r); @@ -440,15 +441,15 @@ bool TreeDiagram::layoutTree(DiagramItem *root,int r) if (dil->count()>0) { uint k; - int pPos=root->xPos(); - int cPos=root->avgChildPos(); + uint pPos=root->xPos(); + uint cPos=root->avgChildPos(); if (pPos>cPos) // move children { DiagramRow *row=at(r+1); //printf("Moving children %d-%d in row %d\n", // dil->getFirst()->number(),row->count()-1,r+1); for (k=dil->getFirst()->number();kcount();k++) - row->at(k)->move(pPos-cPos,0); + row->at(k)->move((int)(pPos-cPos),0); moved=TRUE; } else if (pPosnumber(),row->count()-1,r); for (k=root->number();kcount();k++) - row->at(k)->move(cPos-pPos,0); + row->at(k)->move((int)(cPos-pPos),0); moved=TRUE; } @@ -525,7 +526,7 @@ void TreeDiagram::computeLayout() uint TreeDiagram::computeRows() { //printf("TreeDiagram::computeRows()=%d\n",count()); - int count=0; + uint count=0; QListIterator it(*this); DiagramRow *row; for (;(row=it.current()) && !row->getFirst()->isInList();++it) @@ -535,8 +536,8 @@ uint TreeDiagram::computeRows() //printf("count=%d row=%p\n",count,row); if (row) { - int maxListLen=0; - int curListLen=0; + uint maxListLen=0; + uint curListLen=0; DiagramItem *opi=0; QListIterator rit(*row); DiagramItem *di; @@ -587,7 +588,7 @@ void TreeDiagram::drawBoxes(FTextStream &t,Image *image, bool firstRow = doBase; for (;(dr=it.current()) && !done;++it) { - int x=0,y=0; + uint x=0,y=0; float xf=0.0f,yf=0.0f; QListIterator rit(*dr); DiagramItem *di = rit.current(); @@ -617,7 +618,7 @@ void TreeDiagram::drawBoxes(FTextStream &t,Image *image, x = di->xPos()*(cellWidth+labelHorSpacing)/gridWidth; if (doBase) { - y = image->getHeight()- + y = image->height()- superRows*cellHeight- (superRows-1)*labelVertSpacing- di->yPos()*(cellHeight+labelVertSpacing)/gridHeight; @@ -669,7 +670,7 @@ void TreeDiagram::drawBoxes(FTextStream &t,Image *image, x = di->xPos()*(cellWidth+labelHorSpacing)/gridWidth; if (doBase) { - y = image->getHeight()- + y = image->height()- superRows*cellHeight- (superRows-1)*labelVertSpacing- di->yPos()*(cellHeight+labelVertSpacing)/gridHeight; @@ -717,7 +718,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, DiagramItem *di = rit.current(); if (di->isInList()) // row consists of list connectors { - int x=0,y=0,ys=0; + uint x=0,y=0,ys=0; float xf=0.0f,yf=0.0f,ysf=0.0f; for (;(di=rit.current());++rit) { @@ -731,7 +732,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, x = di->xPos()*(cellWidth+labelHorSpacing)/gridWidth + cellWidth/2; if (doBase) // base classes { - y = image->getHeight()- + y = image->height()- (superRows-1)*(cellHeight+labelVertSpacing)- di->yPos()*(cellHeight+labelVertSpacing)/gridHeight; image->drawVertArrow(x,y,y+labelVertSpacing/2, @@ -759,7 +760,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, else { t << "0 " << (di->xPos()/(float)gridWidth) << " " - << ((float)superRows-0.25-di->yPos()/(float)gridHeight) + << ((float)superRows-0.25f-di->yPos()/(float)gridHeight) << " in\n"; } } @@ -772,7 +773,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, (cellWidth+labelHorSpacing)/gridWidth+cellWidth/2; if (doBase) // base classes { - ys = image->getHeight()- + ys = image->height()- (superRows-1)*(cellHeight+labelVertSpacing)- di->yPos()*(cellHeight+labelVertSpacing)/gridHeight; y = ys - cellHeight/2; @@ -873,7 +874,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, } else { - t << xf << " " << (ysf + 0.25) << " " << yf << " vedge\n"; + t << xf << " " << (ysf + 0.25f) << " " << yf << " vedge\n"; } } } @@ -884,7 +885,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, { for (;(di=rit.current());++rit) { - int x=0,y=0; + uint x=0,y=0; DiagramItemList *dil = di->getChildren(); DiagramItem *parent = di->parentItem(); if (parent) // item has a parent -> connect to it @@ -894,7 +895,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, x = di->xPos()*(cellWidth+labelHorSpacing)/gridWidth + cellWidth/2; if (doBase) // base classes { - y = image->getHeight()- + y = image->height()- (superRows-1)*(cellHeight+labelVertSpacing)- di->yPos()*(cellHeight+labelVertSpacing)/gridHeight; /* write input line */ @@ -924,7 +925,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, else { t << "0 " << di->xPos()/(float)gridWidth << " " - << ((float)superRows-0.25-di->yPos()/(float)gridHeight) + << ((float)superRows-0.25f-di->yPos()/(float)gridHeight) << " in\n"; } } @@ -933,13 +934,13 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, { Protection p=getMinProtectionLevel(dil); uint mask=protToMask(p); - uint col=protToColor(p); + uchar col=protToColor(p); if (bitmap) { x = di->xPos()*(cellWidth+labelHorSpacing)/gridWidth + cellWidth/2; if (doBase) // base classes { - y = image->getHeight()- + y = image->height()- (superRows-1)*(cellHeight+labelVertSpacing)- cellHeight-labelVertSpacing/2- di->yPos()*(cellHeight+labelVertSpacing)/gridHeight; @@ -964,7 +965,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, else { t << "1 " << di->xPos()/(float)gridWidth << " " - << ((float)superRows-1.75-di->yPos()/(float)gridHeight) + << ((float)superRows-1.75f-di->yPos()/(float)gridHeight) << " out\n"; } } @@ -975,9 +976,9 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, { if (bitmap) { - int xs = first->xPos()*(cellWidth+labelHorSpacing)/gridWidth + uint xs = first->xPos()*(cellWidth+labelHorSpacing)/gridWidth + cellWidth/2; - int xe = last->xPos()*(cellWidth+labelHorSpacing)/gridWidth + uint xe = last->xPos()*(cellWidth+labelHorSpacing)/gridWidth + cellWidth/2; if (doBase) // base classes { @@ -1034,17 +1035,17 @@ ClassDiagram::ClassDiagram(const ClassDef *root) super->computeLayout(); DiagramItem *baseItem = base->getFirst()->getFirst(); DiagramItem *superItem = super->getFirst()->getFirst(); - int xbase = baseItem->xPos(); - int xsuper = superItem->xPos(); + uint xbase = baseItem->xPos(); + uint xsuper = superItem->xPos(); if (xbase>xsuper) { - superItem->move(xbase-xsuper,0); - super->moveChildren(superItem,xbase-xsuper); + superItem->move((int)(xbase-xsuper),0); + super->moveChildren(superItem,(int)(xbase-xsuper)); } else if (xbasemove(xsuper-xbase,0); - base->moveChildren(baseItem,xsuper-xbase); + baseItem->move((int)(xsuper-xbase),0); + base->moveChildren(baseItem,(int)(xsuper-xbase)); } } @@ -1116,7 +1117,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path, t << "%%For: \n"; t << "%Magnification: 1.00\n"; t << "%%Orientation: Portrait\n"; - t << "%%BoundingBox: 0 0 500 " << estHeight*500.0/(float)estWidth << "\n"; + t << "%%BoundingBox: 0 0 500 " << estHeight*500.0f/(float)estWidth << "\n"; t << "%%Pages: 0\n"; t << "%%BeginSetup\n"; t << "%%EndSetup\n"; diff --git a/src/dirdef.cpp b/src/dirdef.cpp index ba792e1..81245e3 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -373,9 +373,7 @@ void DirDefImpl::writeFileList(OutputList &ol) ol.parseText(theTranslator->trFile(TRUE,FALSE)); ol.endMemberHeader(); ol.startMemberList(); - QListIterator it(*m_fileList); - FileDef *fd; - for (;(fd=it.current());++it) + for (it.toFirst();(fd=it.current());++it) { if (fd->hasDocumentation()) { @@ -935,7 +933,7 @@ static void computeCommonDirPrefix() sdi.toFirst(); dir=sdi.current(); path=dir->name(); - int i=path.findRev('/',path.length()-2); + int i=path.findRev('/',(int)path.length()-2); path=path.left(i+1); bool done=FALSE; if (i==-1) @@ -946,8 +944,8 @@ static void computeCommonDirPrefix() { while (!done) { - int l = path.length(); - int count=0; + uint l = path.length(); + uint count=0; for (sdi.toFirst();(dir=sdi.current());++sdi) { QCString dirName = dir->name(); @@ -955,7 +953,7 @@ static void computeCommonDirPrefix() { if (qstrncmp(dirName,path,l)!=0) // dirName does not start with path { - int i=path.findRev('/',l-2); + i=path.findRev('/',(int)l-2); if (i==-1) // no unique prefix -> stop { path=""; @@ -972,7 +970,7 @@ static void computeCommonDirPrefix() { path=dir->name(); l=path.length(); - int i=path.findRev('/',l-2); + i=path.findRev('/',(int)l-2); if (i==-1) // no unique prefix -> stop { path=""; @@ -1037,7 +1035,7 @@ void buildDirectories() for (sdi.toFirst();(dir=sdi.current());++sdi) { QCString name = dir->name(); - int i=name.findRev('/',name.length()-2); + int i=name.findRev('/',(int)name.length()-2); if (i>0) { DirDef *parent = Doxygen::directories->find(name.left(i+1)); diff --git a/src/dirdef.h b/src/dirdef.h index 2ea54af..692cd90 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -97,7 +97,7 @@ class FilePair class FilePairDict : public SDict { public: - FilePairDict(int size) : SDict(size) {} + FilePairDict(uint size) : SDict(size) {} private: int compareValues(const FilePair *item1,const FilePair *item2) const; }; @@ -147,7 +147,7 @@ inline int DirList::compareValues(const DirDef *item1,const DirDef *item2) const class DirSDict : public SDict { public: - DirSDict(int size) : SDict(size) {} + DirSDict(uint size) : SDict(size) {} int compareValues(const DirDef *item1,const DirDef *item2) const { return qstricmp(item1->shortName(),item2->shortName()); diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index 1799ed9..1b32787 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -132,15 +132,13 @@ void writeDocbookLink(FTextStream &t,const char * /*extRef*/,const char *compoun t << ""; } -DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t) : m_lineNumber(-1), m_col(0), - m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE) +DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t) { m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING); setTextStream(t); } -DocbookCodeGenerator::DocbookCodeGenerator() : m_lineNumber(-1), m_col(0), - m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE), m_streamSet(FALSE) +DocbookCodeGenerator::DocbookCodeGenerator() { m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING); } @@ -160,9 +158,9 @@ void DocbookCodeGenerator::writeCodeLink(const char *ref,const char *file, writeDocbookLink(m_t,ref,file,anchor,name,tooltip); m_col+=(int)strlen(name); } -void DocbookCodeGenerator::writeCodeLinkLine(const char *ref,const char *file, - const char *anchor,const char *name, - const char *tooltip) +void DocbookCodeGenerator::writeCodeLinkLine(const char *,const char *file, + const char *,const char *name, + const char *) { Docbook_DB(("(writeCodeLinkLine)\n")); m_t << "" << endl; @@ -698,7 +697,7 @@ void DocbookGenerator::docify(const char *str) DB_GEN_C t << convertToDocBook(str); } -void DocbookGenerator::writeObjectLink(const char *ref, const char *f, +void DocbookGenerator::writeObjectLink(const char *, const char *f, const char *anchor, const char *text) { DB_GEN_C @@ -813,7 +812,7 @@ DB_GEN_C t << ""; } } -void DocbookGenerator::endTextBlock(bool dense) +void DocbookGenerator::endTextBlock(bool) { DB_GEN_C if (m_denseText) @@ -822,8 +821,8 @@ DB_GEN_C t << ""; } } -void DocbookGenerator::startMemberDoc(const char *clname, const char *memname, const char *anchor, const char *title, - int memCount, int memTotal, bool showInline) +void DocbookGenerator::startMemberDoc(const char *clname, const char *memname, const char *, const char *title, + int memCount, int memTotal, bool) { DB_GEN_C2("m_inLevel " << m_inLevel) t << "
" << endl; @@ -849,15 +848,15 @@ void DocbookGenerator::startTitleHead(const char *) DB_GEN_C t << ""; } -void DocbookGenerator::endTitleHead(const char *fileName,const char *name) +void DocbookGenerator::endTitleHead(const char *,const char *name) { DB_GEN_C t << "" << endl; if (name) addIndexTerm(t, name); } -void DocbookGenerator::startDoxyAnchor(const char *fName,const char *manName, - const char *anchor,const char *name, - const char *args) +void DocbookGenerator::startDoxyAnchor(const char *fName,const char *, + const char *anchor,const char *, + const char *) { DB_GEN_C if (!m_inListItem[m_levelListItem] && !m_descTable) @@ -870,7 +869,7 @@ DB_GEN_C t << ""; } } -void DocbookGenerator::endDoxyAnchor(const char *fileName,const char *anchor) +void DocbookGenerator::endDoxyAnchor(const char *,const char *) { DB_GEN_C } @@ -883,7 +882,7 @@ void DocbookGenerator::endMemberDocName() { DB_GEN_C } -void DocbookGenerator::startMemberGroupHeader(bool hasHeader) +void DocbookGenerator::startMemberGroupHeader(bool) { DB_GEN_C t << ""; @@ -1025,13 +1024,13 @@ DB_GEN_C t << "</para>"; t << "<para>"; } -void DocbookGenerator::startSection(const char *lab,const char *,SectionType type) +void DocbookGenerator::startSection(const char *lab,const char *,SectionType) { DB_GEN_C t << " <section xml:id=\"_" << stripPath(lab) << "\">"; t << "<title>"; } -void DocbookGenerator::endSection(const char *lab,SectionType) +void DocbookGenerator::endSection(const char *,SectionType) { DB_GEN_C t << ""; diff --git a/src/docbookgen.h b/src/docbookgen.h index d993312..bed2f5f 100644 --- a/src/docbookgen.h +++ b/src/docbookgen.h @@ -57,16 +57,16 @@ class DocbookCodeGenerator : public CodeOutputInterface private: FTextStream m_t; - bool m_streamSet; + bool m_streamSet = FALSE; QCString m_refId; QCString m_external; - int m_lineNumber; - int m_col; - bool m_insideCodeLine; - bool m_insideSpecialHL; + int m_lineNumber = -1; + int m_col = 0; + bool m_insideCodeLine = FALSE; + bool m_insideSpecialHL = FALSE; QCString m_relPath; QCString m_sourceFileName; - bool m_prettyCode; + bool m_prettyCode = FALSE; }; @@ -145,14 +145,14 @@ class DocbookGenerator : public OutputGenerator void startFile(const char *name,const char *manName, const char *title); void writeSearchInfo(){DB_GEN_EMPTY}; - void writeFooter(const char *navPath){DB_GEN_NEW}; + void writeFooter(const char *){DB_GEN_NEW}; void endFile(); void startIndexSection(IndexSections); void endIndexSection(IndexSections); void writePageLink(const char *,bool); void startProjectNumber(){DB_GEN_NEW}; void endProjectNumber(){DB_GEN_NEW}; - void writeStyleInfo(int part){DB_GEN_EMPTY}; + void writeStyleInfo(int){DB_GEN_EMPTY}; void startTitleHead(const char *); void endTitleHead(const char *fileName,const char *name); void startIndexListItem(){DB_GEN_NEW}; @@ -166,8 +166,8 @@ class DocbookGenerator : public OutputGenerator void startItemList() {DB_GEN_EMPTY}; void endItemList() {DB_GEN_EMPTY}; - void startIndexItem(const char *ref,const char *file){DB_GEN_NEW}; - void endIndexItem(const char *ref,const char *file){DB_GEN_NEW}; + void startIndexItem(const char *,const char *){DB_GEN_NEW}; + void endIndexItem(const char *,const char *){DB_GEN_NEW}; void startItemListItem() {DB_GEN_EMPTY}; void endItemListItem() {DB_GEN_EMPTY}; void docify(const char *text); @@ -258,23 +258,23 @@ class DocbookGenerator : public OutputGenerator void insertMemberAlign(bool){DB_GEN_EMPTY}; void insertMemberAlignLeft(int,bool){DB_GEN_EMPTY}; void startMemberDoc(const char *,const char *, - const char *,const char *,int,int,bool); + const char *,const char *,int,int,bool); void endMemberDoc(bool); void startDoxyAnchor(const char *fName,const char *manName, - const char *anchor,const char *name, - const char *args); + const char *anchor,const char *name, + const char *args); void endDoxyAnchor(const char *fileName,const char *anchor); void writeLatexSpacing(){DB_GEN_EMPTY} - void writeStartAnnoItem(const char *type,const char *file, - const char *path,const char *name){DB_GEN_NEW}; - void writeEndAnnoItem(const char *name){DB_GEN_NEW}; - void startMemberDescription(const char *anchor,const char *inheritId, bool typ){DB_GEN_EMPTY}; + void writeStartAnnoItem(const char *,const char *, + const char *,const char *){DB_GEN_NEW}; + void writeEndAnnoItem(const char *){DB_GEN_NEW}; + void startMemberDescription(const char *,const char *,bool){DB_GEN_EMPTY}; void endMemberDescription(){DB_GEN_EMPTY}; void startMemberDeclaration(){DB_GEN_EMPTY}; - void endMemberDeclaration(const char *anchor,const char *inheritId){DB_GEN_EMPTY}; - void writeInheritedSectionTitle(const char *id,const char *ref, - const char *file,const char *anchor, - const char *title,const char *name){DB_GEN_NEW}; + void endMemberDeclaration(const char *,const char *){DB_GEN_EMPTY}; + void writeInheritedSectionTitle(const char *,const char *, + const char *,const char *, + const char *,const char *){DB_GEN_NEW}; void startIndent(){DB_GEN_EMPTY}; void endIndent(){DB_GEN_EMPTY}; void writeSynopsis(){DB_GEN_EMPTY}; @@ -290,17 +290,17 @@ class DocbookGenerator : public OutputGenerator void endCallGraph(DotCallGraph &g); void startDirDepGraph(); void endDirDepGraph(DotDirDeps &g); - void writeGraphicalHierarchy(DotGfxHierarchyTable &g){DB_GEN_NEW}; + void writeGraphicalHierarchy(DotGfxHierarchyTable &){DB_GEN_NEW}; void startQuickIndices(){DB_GEN_EMPTY}; void endQuickIndices(){DB_GEN_EMPTY}; void writeSplitBar(const char *){DB_GEN_EMPTY}; void writeNavigationPath(const char *){DB_GEN_NEW}; void writeLogo(){DB_GEN_NEW}; - void writeQuickLinks(bool compact,HighlightedItem hli,const char *file){DB_GEN_EMPTY}; - void writeSummaryLink(const char *file,const char *anchor,const char *title,bool first){DB_GEN_EMPTY}; + void writeQuickLinks(bool,HighlightedItem,const char *){DB_GEN_EMPTY}; + void writeSummaryLink(const char *,const char *,const char *,bool){DB_GEN_EMPTY}; void startContents(){DB_GEN_EMPTY}; void endContents(){DB_GEN_EMPTY}; - void startPageDoc(const char *pageTitle){DB_GEN_EMPTY} + void startPageDoc(const char *){DB_GEN_EMPTY} void endPageDoc() {DB_GEN_EMPTY} void startTextBlock(bool); void endTextBlock(bool); @@ -309,7 +309,7 @@ class DocbookGenerator : public OutputGenerator void endMemberDocPrefixItem(); void startMemberDocName(bool); void endMemberDocName(); - void startParameterType(bool,const char *key){DB_GEN_EMPTY}; + void startParameterType(bool,const char *){DB_GEN_EMPTY}; void endParameterType(){DB_GEN_EMPTY}; void startParameterName(bool); void endParameterName(bool,bool,bool); diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index 9ae1c8f..b9bd6aa 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -53,7 +53,7 @@ static QCString filterId(const char *s) static GrowBuf growBuf; growBuf.clear(); if (s==0) return ""; - const unsigned char *p=(const unsigned char *)s; + const char *p=s; char c; while ((c=*p++)) { @@ -396,7 +396,7 @@ DB_VIS_C int i; if ((i=shortName.findRev('/'))!=-1) { - shortName=shortName.right(shortName.length()-i-1); + shortName=shortName.right((int)shortName.length()-i-1); } m_t << "" << endl; writePlantUMLFile(baseName,s); @@ -1128,14 +1128,14 @@ DB_VIS_C m_t << ">"; } -void DocbookDocVisitor::visitPost(DocHtmlCell *c) +void DocbookDocVisitor::visitPost(DocHtmlCell *) { DB_VIS_C if (m_hide) return; m_t << ""; } -void DocbookDocVisitor::visitPre(DocHtmlCaption *c) +void DocbookDocVisitor::visitPre(DocHtmlCaption *) { DB_VIS_C if (m_hide) return; @@ -1202,7 +1202,7 @@ DB_VIS_C int i; if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) { - baseName=baseName.right(baseName.length()-i-1); + baseName=baseName.right((int)baseName.length()-i-1); } visitPreStart(m_t, img->children(), img->hasCaption(), img->relPath() + baseName, img->width(), img->height(), img->isInlineImage()); } @@ -1225,7 +1225,7 @@ DB_VIS_C int i; if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) { - baseName=baseName.right(baseName.length()-i-1); + baseName=baseName.right((int)baseName.length()-i-1); } QCString m_file; bool ambig; @@ -1332,7 +1332,7 @@ DB_VIS_C if (!ref->file().isEmpty()) endLink(); } -void DocbookDocVisitor::visitPre(DocSecRefItem *ref) +void DocbookDocVisitor::visitPre(DocSecRefItem *) { DB_VIS_C if (m_hide) return; @@ -1415,11 +1415,9 @@ DB_VIS_C if (m_hide) return; m_t << " " << endl; - DocParamSect::Type parentType = DocParamSect::Unknown; DocParamSect *sect = 0; if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect) { - parentType = ((DocParamSect*)pl->parent())->type(); sect=(DocParamSect*)pl->parent(); } @@ -1639,7 +1637,7 @@ DB_VIS_C int i; if ((i=shortName.findRev('/'))!=-1) { - shortName=shortName.right(shortName.length()-i-1); + shortName=shortName.right((int)shortName.length()-i-1); } QCString outDir = Config_getString(DOCBOOK_OUTPUT); writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_BITMAP); @@ -1655,7 +1653,7 @@ DB_VIS_C int i; if ((i=shortName.findRev('/'))!=-1) { - shortName=shortName.right(shortName.length()-i-1); + shortName=shortName.right((int)shortName.length()-i-1); } QCString outDir = Config_getString(DOCBOOK_OUTPUT); PlantumlManager::instance()->generatePlantUMLOutput(baseName,outDir,PlantumlManager::PUML_BITMAP); @@ -1676,7 +1674,7 @@ DB_VIS_C int i; if ((i=baseName.findRev('/'))!=-1) { - baseName=baseName.right(baseName.length()-i-1); + baseName=baseName.right((int)baseName.length()-i-1); } if ((i=baseName.find('.'))!=-1) { @@ -1704,7 +1702,7 @@ DB_VIS_C int i; if ((i=shortName.findRev('/'))!=-1) { - shortName=shortName.right(shortName.length()-i-1); + shortName=shortName.right((int)shortName.length()-i-1); } QCString outDir = Config_getString(DOCBOOK_OUTPUT); writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_BITMAP); @@ -1725,7 +1723,7 @@ DB_VIS_C int i; if ((i=baseName.findRev('/'))!=-1) { - baseName=baseName.right(baseName.length()-i-1); + baseName=baseName.right((int)baseName.length()-i-1); } if ((i=baseName.find('.'))!=-1) { @@ -1753,7 +1751,7 @@ DB_VIS_C int i; if ((i=shortName.findRev('/'))!=-1) { - shortName=shortName.right(shortName.length()-i-1); + shortName=shortName.right((int)shortName.length()-i-1); } QCString outDir = Config_getString(DOCBOOK_OUTPUT); writeDotGraphFromFile(baseName+".dot",outDir,shortName,GOF_BITMAP); @@ -1774,7 +1772,7 @@ DB_VIS_C int i; if ((i=baseName.findRev('/'))!=-1) { - baseName=baseName.right(baseName.length()-i-1); + baseName=baseName.right((int)baseName.length()-i-1); } if ((i=baseName.find('.'))!=-1) { diff --git a/src/docparser.cpp b/src/docparser.cpp index e26c2ac..0cc7080 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -112,7 +112,7 @@ static QCString g_includeFileName; static QCString g_includeFileText; static uint g_includeFileOffset; static uint g_includeFileLength; -static uint g_includeFileLine; +static int g_includeFileLine; static bool g_includeFileShowLineNo; @@ -145,7 +145,7 @@ struct DocParserContext QCString includeFileText; uint includeFileOffset; uint includeFileLength; - uint includeFileLine; + int includeFileLine; bool includeFileLineNo; TokenInfo *token; @@ -302,7 +302,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool int i; if ((i=result.findRev('/'))!=-1 || (i=result.findRev('\\'))!=-1) { - result = result.right(result.length()-i-1); + result = result.right((int)result.length()-i-1); } //printf("fileName=%s result=%s\n",fileName,result.data()); QCString outputDir; @@ -679,7 +679,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, QCString cmdArg=substitute(commandName,"#","::"); cmdArg = replaceScopeSeparator(cmdArg); - int l=cmdArg.length(); + int l=(int)cmdArg.length(); if (l==0) return FALSE; int funcStart=cmdArg.find('('); @@ -726,7 +726,7 @@ static bool findDocsForMemberOrCompound(const char *commandName, } - int scopeOffset=g_context.length(); + int scopeOffset=(int)g_context.length(); do // for each scope { QCString fullName=cmdArg; @@ -961,7 +961,7 @@ static int handleAHref(DocNode *parent,QList &children,const HtmlAttrib { HtmlAttribListIterator li(tagHtmlAttribs); HtmlAttrib *opt; - int index=0; + uint index=0; int retval = RetVal_OK; for (li.toFirst();(opt=li.current());++li,++index) { @@ -1054,7 +1054,7 @@ static void handleLinkedWord(DocNode *parent,QList &children,bool ignor const Definition *compound=0; const MemberDef *member=0; - int len = g_token->name.length(); + uint len = g_token->name.length(); ClassDef *cd=0; bool ambig; FileDef *fd = findFileDef(Doxygen::inputNameDict,g_fileName,ambig); @@ -1730,7 +1730,7 @@ static void handleImg(DocNode *parent,QList &children,const HtmlAttribL HtmlAttribListIterator li(tagHtmlAttribs); HtmlAttrib *opt; bool found=FALSE; - int index=0; + uint index=0; for (li.toFirst();(opt=li.current());++li,++index) { //printf("option name=%s value=%s\n",opt->name.data(),opt->value.data()); @@ -1768,7 +1768,7 @@ DocEmoji::DocEmoji(DocNode *parent,const QCString &symName) : { m_parent = parent; QCString locSymName = symName; - int len=locSymName.length(); + uint len=locSymName.length(); if (len>0) { if (locSymName.at(len-1)!=':') locSymName.append(":"); @@ -2035,7 +2035,7 @@ void DocIncOperator::parse() const char *p = g_includeFileText; uint l = g_includeFileLength; uint o = g_includeFileOffset; - uint il = g_includeFileLine; + int il = g_includeFileLine; DBG(("DocIncOperator::parse() text=%s off=%d len=%d\n",qPrint(p),o,l)); uint so = o,bo; bool nonEmpty = FALSE; @@ -2280,7 +2280,7 @@ void DocSecRefItem::parse() const SectionInfo *sec=0; if (!m_target.isEmpty()) { - const SectionInfo *sec = SectionManager::instance().find(m_target); + sec = SectionManager::instance().find(m_target); if (sec) { m_file = sec->fileName(); @@ -2322,7 +2322,7 @@ void DocSecRefList::parse() { case CMD_SECREFITEM: { - int tok=doctokenizerYYlex(); + tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\refitem command"); @@ -2377,7 +2377,7 @@ DocInternalRef::DocInternalRef(DocNode *parent,const QCString &ref) int i=ref.find('#'); if (i!=-1) { - m_anchor = ref.right(ref.length()-i-1); + m_anchor = ref.right((int)ref.length()-i-1); m_file = ref.left(i); } else @@ -2701,7 +2701,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) m_children.append(new DocWord(this,w.left(p))); if ((uint)p=4 && locName.mid(fnd-4,4)==".svg"; @@ -3379,32 +3379,32 @@ int DocHtmlCell::parseXml() return retval; } -int DocHtmlCell::rowSpan() const +uint DocHtmlCell::rowSpan() const { - int retval = 0; + uint retval = 0; HtmlAttribList attrs = attribs(); uint i; for (i=0; iname.lower()=="rowspan") { - retval = attrs.at(i)->value.toInt(); + retval = attrs.at(i)->value.toUInt(); break; } } return retval; } -int DocHtmlCell::colSpan() const +uint DocHtmlCell::colSpan() const { - int retval = 1; + uint retval = 1; HtmlAttribList attrs = attribs(); uint i; for (i=0; iname.lower()=="colspan") { - retval = QMAX(1,attrs.at(i)->value.toInt()); + retval = QMAX(1,attrs.at(i)->value.toUInt()); break; } } @@ -3700,9 +3700,9 @@ int DocHtmlTable::parseXml() /** Helper class to compute the grid for an HTML style table */ struct ActiveRowSpan { - ActiveRowSpan(int rows,int col) : rowsLeft(rows), column(col) {} - int rowsLeft; - int column; + ActiveRowSpan(uint rows,uint col) : rowsLeft(rows), column(col) {} + uint rowsLeft; + uint column; }; /** List of ActiveRowSpan classes. */ @@ -3717,14 +3717,14 @@ void DocHtmlTable::computeTableGrid() //printf("computeTableGrid()\n"); RowSpanList rowSpans; rowSpans.setAutoDelete(TRUE); - int maxCols=0; - int rowIdx=1; + uint maxCols=0; + uint rowIdx=1; QListIterator li(children()); DocNode *rowNode; for (li.toFirst();(rowNode=li.current());++li) { - int colIdx=1; - int cells=0; + uint colIdx=1; + uint cells=0; if (rowNode->kind()==DocNode::Kind_HtmlRow) { uint i; @@ -3736,8 +3736,8 @@ void DocHtmlTable::computeTableGrid() if (cellNode->kind()==DocNode::Kind_HtmlCell) { DocHtmlCell *cell = (DocHtmlCell*)cellNode; - int rs = cell->rowSpan(); - int cs = cell->colSpan(); + uint rs = cell->rowSpan(); + uint cs = cell->colSpan(); for (i=0;i class CompAccept : public DocNode } const QList &children() const { return m_children; } QList &children() { return m_children; } - QString::Direction getTextDir(int nodeIndex) const + QString::Direction getTextDir(uint nodeIndex) const { unsigned char resultDir = QString::DirNeutral; for (uint i = nodeIndex; i < m_children.count(); i++) { DocNode* node = m_children.at(i); QString::Direction nodeDir = node->getTextDir(); - resultDir |= nodeDir; + resultDir |= (unsigned char)nodeDir; if (resultDir == QString::DirMixed) return QString::DirMixed; } return static_cast(resultDir); } - QString::Direction getTextBasicDir(int nodeIndex) const + QString::Direction getTextBasicDir(uint nodeIndex) const { for (uint i = nodeIndex; i < m_children.count(); i++) { @@ -529,7 +529,7 @@ class DocSeparator : public DocNode m_chars(chars) { m_parent = parent; } Kind kind() const { return Kind_Sep; } QCString chars() const { return m_chars; } - void accept(DocVisitor *v) { } + void accept(DocVisitor *) { } private: QCString m_chars; }; @@ -586,17 +586,17 @@ class DocInclude : public DocNode DocInclude(DocNode *parent,const QCString &file, const QCString context, Type t, bool isExample,const QCString exampleFile, - const QCString blockId, bool isBlock) : + const QCString blockId, bool isBlock) : m_file(file), m_context(context), m_type(t), - m_isExample(isExample), m_exampleFile(exampleFile), - m_blockId(blockId), m_isBlock(isBlock) { m_parent = parent; } + m_isExample(isExample), m_isBlock(isBlock), + m_exampleFile(exampleFile), m_blockId(blockId) { m_parent = parent; } Kind kind() const { return Kind_Include; } QCString file() const { return m_file; } - QCString extension() const { int i=m_file.findRev('.'); - if (i!=-1) - return m_file.right(m_file.length()-i); - else - return ""; + QCString extension() const { int i=m_file.findRev('.'); + if (i!=-1) + return m_file.right(m_file.length()-(uint)i); + else + return ""; } Type type() const { return m_type; } QCString text() const { return m_text; } @@ -612,9 +612,9 @@ class DocInclude : public DocNode QCString m_file; QCString m_context; QCString m_text; - Type m_type = Include; - bool m_isExample = false; - bool m_isBlock = false; + Type m_type; + bool m_isExample; + bool m_isBlock; QCString m_exampleFile; QCString m_blockId; }; @@ -1336,9 +1336,7 @@ class DocHtmlCell : public CompAccept public: enum Alignment { Left, Right, Center }; DocHtmlCell(DocNode *parent,const HtmlAttribList &attribs,bool isHeading) : - m_isHeading(isHeading), - m_isFirst(FALSE), m_isLast(FALSE), m_attribs(attribs), - m_rowIdx(-1), m_colIdx(-1) { m_parent = parent; } + m_isHeading(isHeading), m_attribs(attribs) { m_parent = parent; } bool isHeading() const { return m_isHeading; } bool isFirst() const { return m_isFirst; } bool isLast() const { return m_isLast; } @@ -1348,21 +1346,21 @@ class DocHtmlCell : public CompAccept const HtmlAttribList &attribs() const { return m_attribs; } int parse(); int parseXml(); - int rowIndex() const { return m_rowIdx; } - int columnIndex() const { return m_colIdx; } - int rowSpan() const; - int colSpan() const; + uint rowIndex() const { return m_rowIdx; } + uint columnIndex() const { return m_colIdx; } + uint rowSpan() const; + uint colSpan() const; Alignment alignment() const; private: - void setRowIndex(int idx) { m_rowIdx = idx; } - void setColumnIndex(int idx) { m_colIdx = idx; } + void setRowIndex(uint idx) { m_rowIdx = idx; } + void setColumnIndex(uint idx) { m_colIdx = idx; } bool m_isHeading = false; bool m_isFirst = false; bool m_isLast = false; HtmlAttribList m_attribs; - int m_rowIdx = -1; - int m_colIdx = -1; + uint m_rowIdx = (uint)-1; + uint m_colIdx = (uint)-1; }; /** Node representing a HTML table caption */ @@ -1390,7 +1388,7 @@ class DocHtmlRow : public CompAccept friend class DocHtmlTable; public: DocHtmlRow(DocNode *parent,const HtmlAttribList &attribs) : - m_attribs(attribs), m_visibleCells(-1), m_rowIdx(-1) { m_parent = parent; } + m_attribs(attribs) { m_parent = parent; } Kind kind() const { return Kind_HtmlRow; } uint numCells() const { return m_children.count(); } const HtmlAttribList &attribs() const { return m_attribs; } @@ -1409,15 +1407,15 @@ class DocHtmlRow : public CompAccept } return m_children.count()>0 && heading; } - void setVisibleCells(int n) { m_visibleCells = n; } - int visibleCells() const { return m_visibleCells; } - int rowIndex() const { return m_rowIdx; } + void setVisibleCells(uint n) { m_visibleCells = n; } + uint visibleCells() const { return m_visibleCells; } + uint rowIndex() const { return m_rowIdx; } private: - void setRowIndex(int idx) { m_rowIdx = idx; } + void setRowIndex(uint idx) { m_rowIdx = idx; } HtmlAttribList m_attribs; - int m_visibleCells = -1; - int m_rowIdx = -1; + uint m_visibleCells = 0; + uint m_rowIdx = (uint)-1; }; /** Node representing a HTML table */ @@ -1446,7 +1444,7 @@ class DocHtmlTable : public CompAccept void computeTableGrid(); DocHtmlCaption *m_caption = 0; HtmlAttribList m_attribs; - int m_numCols = 0; + uint m_numCols = 0; }; /** Node representing an HTML blockquote */ diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 0f8cb1c..cfabd31 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -46,6 +46,8 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 +#define USE_STATE2STRING 0 + #define TK_COMMAND_SEL() (yytext[0] == '@' ? TK_COMMAND_AT : TK_COMMAND_BS) //-------------------------------------------------------------------------- @@ -79,7 +81,9 @@ struct DocLexerContext static QStack g_lexerStack; +#if USE_STATE2STRING static const char *stateToString(int state); +#endif //-------------------------------------------------------------------------- void doctokenizerYYpushContext() @@ -323,9 +327,9 @@ static QCString stripEmptyLines(const QCString &s) #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); -static int yyread(char *buf,int max_size) +static yy_size_t yyread(char *buf,yy_size_t max_size) { - int c=0; + yy_size_t c=0; const char *src=g_inputString+g_inputPos; while ( c < max_size && *src ) *buf++ = *src++, c++; g_inputPos+=c; @@ -1033,7 +1037,7 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} if (yytext[0] =='"') { g_token->name=yytext+1; - g_token->name=g_token->name.left(yyleng-2); + g_token->name=g_token->name.left(static_cast(yyleng)-2); } else { @@ -1170,9 +1174,9 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} } [^ \t\n,@\\]+ { g_token->name = yytext; - if (g_token->name.at(yyleng-1)==':') + if (g_token->name.at(static_cast(yyleng)-1)==':') { - g_token->name=g_token->name.left(yyleng-1); + g_token->name=g_token->name.left(static_cast(yyleng)-1); } return TK_WORD; } @@ -1631,4 +1635,6 @@ void doctokenizerYYendAutoList() // return retval; //} +#if USE_STATE2STRING #include "doctokenizer.l.h" +#endif diff --git a/src/dotclassgraph.cpp b/src/dotclassgraph.cpp index da272b4..eb6c179 100644 --- a/src/dotclassgraph.cpp +++ b/src/dotclassgraph.cpp @@ -13,6 +13,8 @@ * */ +#include + #include "dotclassgraph.h" #include "dotnode.h" @@ -149,8 +151,8 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode, { QList childQueue; QList parentQueue; - QArray childTreeWidth; - QArray parentTreeWidth; + std::vector childTreeWidth; + std::vector parentTreeWidth; childQueue.append(rootNode); if (includeParents) parentQueue.append(rootNode); bool firstNode=TRUE; // flag to force reprocessing rootNode in the parent loop diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp index c70128c..59ad75f 100644 --- a/src/dotdirdeps.cpp +++ b/src/dotdirdeps.cpp @@ -135,8 +135,6 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) QDictIterator di(dirsInGraph); for (di.toFirst();(dir=di.current());++di) // foreach dir in the graph { - QDictIterator udi(*dir->usedDirs()); - UsedDir *udir; for (udi.toFirst();(udir=udi.current());++udi) // foreach used dir { const DirDef *usedDir=udir->dir(); diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp index 7a65d89..e386af9 100644 --- a/src/dotfilepatcher.cpp +++ b/src/dotfilepatcher.cpp @@ -506,8 +506,8 @@ bool DotFilePatcher::run() const fo.close(); // keep original SVG file so we can refer to it, we do need to replace // dummy link by real ones - QFile fi(tmpName); - QFile fo(orgName); + fi.setName(tmpName); + fo.setName(orgName); if (!fi.open(IO_ReadOnly)) { err("problem opening file %s for reading!\n",tmpName.data()); @@ -518,7 +518,7 @@ bool DotFilePatcher::run() const err("problem opening file %s for writing!\n",orgName.data()); return FALSE; } - FTextStream t(&fo); + FTextStream to(&fo); while (!fi.atEnd()) // foreach line { QCString line(maxLineLen); @@ -529,7 +529,7 @@ bool DotFilePatcher::run() const } line.resize(numBytes+1); Map *map = m_maps.at(0); // there is only one 'map' for a SVG file - t << replaceRef(line,map->relPath,map->urlOnly,map->context,"_top"); + to << replaceRef(line,map->relPath,map->urlOnly,map->context,"_top"); } fi.close(); fo.close(); diff --git a/src/dotgraph.h b/src/dotgraph.h index edba009..b90d980 100644 --- a/src/dotgraph.h +++ b/src/dotgraph.h @@ -31,7 +31,8 @@ enum GraphType { Dependency, Inheritance, Collaboration, Hierarchy, C class DotGraph { public: - DotGraph() : m_curNodeNumber(0), m_doNotAddImageToIndex(FALSE), m_noDivTag(FALSE), m_zoomable(TRUE), m_urlOnly(FALSE) {} + DotGraph() : m_doNotAddImageToIndex(FALSE), m_noDivTag(FALSE), + m_zoomable(TRUE), m_urlOnly(FALSE) {} virtual ~DotGraph() {} protected: @@ -98,7 +99,7 @@ class DotGraph bool prepareDotFile(); void generateCode(FTextStream &t); - int m_curNodeNumber; + int m_curNodeNumber = 0; }; #endif diff --git a/src/dotnode.cpp b/src/dotnode.cpp index 9eccdde..86ae43a 100644 --- a/src/dotnode.cpp +++ b/src/dotnode.cpp @@ -258,23 +258,12 @@ static QCString stripProtectionPrefix(const QCString &s) DotNode::DotNode(int n,const char *lab,const char *tip, const char *url, bool isRoot,const ClassDef *cd) - : m_subgraphId(-1) - , m_number(n) + : m_number(n) , m_label(lab) , m_tooltip(tip) , m_url(url) - , m_parents(0) - , m_children(0) - , m_edgeInfo(0) - , m_deleted(FALSE) - , m_written(FALSE) - , m_hasDoc(FALSE) , m_isRoot(isRoot) , m_classDef(cd) - , m_visible(FALSE) - , m_truncated(Unknown) - , m_distance(1000) - , m_renumbered(false) { } @@ -408,14 +397,14 @@ void DotNode::writeBox(FTextStream &t, { if (!ei->label().isEmpty()) // labels joined by \n { - int li=ei->label().find('\n'); + int i=ei->label().find('\n'); int p=0; QCString lab; - while ((li=ei->label().find('\n',p))!=-1) + while ((i=ei->label().find('\n',p))!=-1) { - lab = stripProtectionPrefix(ei->label().mid(p,li-p)); + lab = stripProtectionPrefix(ei->label().mid(p,i-p)); arrowNames.insert(lab,(void*)0x8); - p=li+1; + p=i+1; } lab = stripProtectionPrefix(ei->label().right(ei->label().length()-p)); arrowNames.insert(lab,(void*)0x8); diff --git a/src/dotnode.h b/src/dotnode.h index 334fdef..92f268e 100644 --- a/src/dotnode.h +++ b/src/dotnode.h @@ -107,22 +107,22 @@ class DotNode private: int m_number; - QCString m_label; //!< label text - QCString m_tooltip; //!< node's tooltip - QCString m_url; //!< url of the node (format: remote$local) - QList *m_parents; //!< list of parent nodes (incoming arrows) - QList *m_children; //!< list of child nodes (outgoing arrows) - QList *m_edgeInfo; //!< edge info for each child - bool m_deleted; //!< used to mark a node as deleted - mutable bool m_written; //!< used to mark a node as written - bool m_hasDoc; //!< used to mark a node as documented - bool m_isRoot; //!< indicates if this is a root node - const ClassDef * m_classDef; //!< class representing this node (can be 0) - bool m_visible; //!< is the node visible in the output - TruncState m_truncated; //!< does the node have non-visible children/parents - int m_distance; //!< shortest path to the root node - bool m_renumbered;//!< indicates if the node has been renumbered (to prevent endless loops) - int m_subgraphId; + QCString m_label; //!< label text + QCString m_tooltip; //!< node's tooltip + QCString m_url; //!< url of the node (format: remote$local) + QList *m_parents = 0; //!< list of parent nodes (incoming arrows) + QList *m_children = 0; //!< list of child nodes (outgoing arrows) + QList *m_edgeInfo = 0; //!< edge info for each child + bool m_deleted = false; //!< used to mark a node as deleted + mutable bool m_written = false; //!< used to mark a node as written + bool m_hasDoc = false; //!< used to mark a node as documented + bool m_isRoot; //!< indicates if this is a root node + const ClassDef * m_classDef; //!< class representing this node (can be 0) + bool m_visible = false; //!< is the node visible in the output + TruncState m_truncated = Unknown; //!< does the node have non-visible children/parents + int m_distance = 1000; //!< shortest path to the root node + bool m_renumbered = false; //!< indicates if the node has been renumbered (to prevent endless loops) + int m_subgraphId = -1; }; /** Class representing a list of DotNode objects. */ diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp index 22a113a..fc9f85c 100644 --- a/src/dotrunner.cpp +++ b/src/dotrunner.cpp @@ -146,8 +146,10 @@ bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool //--------------------------------------------------------------------------------- DotRunner::DotRunner(const QCString& absDotName, const QCString& md5Hash) - : m_file(absDotName), m_md5Hash(md5Hash), m_cleanUp(Config_getBool(DOT_CLEANUP)), - m_dotExe(Config_getString(DOT_PATH)+"dot") + : m_file(absDotName) + , m_md5Hash(md5Hash) + , m_dotExe(Config_getString(DOT_PATH)+"dot") + , m_cleanUp(Config_getBool(DOT_CLEANUP)) { m_jobs.setAutoDelete(TRUE); } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 6a0f228..af056f1 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1511,7 +1511,7 @@ static void buildNamespaceList(const Entry *root) tagFileName = tagInfo->fileName; } //printf("++ new namespace %s lang=%s tagName=%s\n",fullName.data(),langToString(root->lang).data(),tagName.data()); - NamespaceDef *nd=createNamespaceDef(tagInfo?tagName:root->fileName,root->startLine, + nd=createNamespaceDef(tagInfo?tagName:root->fileName,root->startLine, root->startColumn,fullName,tagName,tagFileName, root->type,root->spec&Entry::Published); nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition @@ -1547,7 +1547,7 @@ static void buildNamespaceList(const Entry *root) if (d==0) // we didn't find anything, create the scope artificially // anyway, so we can at least relate scopes properly. { - Definition *d = buildScopeFromQualifiedName(fullName,fullName.contains("::"),nd->getLanguage(),tagInfo); + d = buildScopeFromQualifiedName(fullName,fullName.contains("::"),nd->getLanguage(),tagInfo); d->addInnerCompound(nd); nd->setOuterScope(d); // TODO: Due to the order in which the tag file is written @@ -1703,7 +1703,7 @@ static void findUsingDirectives(const Entry *root) else // unknown namespace, but add it anyway. { //printf("++ new unknown namespace %s lang=%s\n",name.data(),langToString(root->lang).data()); - NamespaceDef *nd=createNamespaceDef(root->fileName,root->startLine,root->startColumn,name); + nd=createNamespaceDef(root->fileName,root->startLine,root->startColumn,name); nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->addSectionsToDefinition(root->anchors); @@ -3547,7 +3547,6 @@ static void buildFunctionList(const Entry *root) // add member to the list of file members //printf("Adding member=%s\n",md->name().data()); - MemberName *mn; if ((mn=Doxygen::functionNameSDict->find(name))) { mn->append(md); @@ -4010,7 +4009,6 @@ static void findUsedClassesForClass(const Entry *root, BaseInfo bi(usedName,Public,Normal); findClassRelation(root,context,instanceCd,&bi,templateNames,TemplateInstances,isArtificial); - int count=0; for (const Argument &arg : masterCd->templateArguments()) { if (arg.name==usedName) // type is a template argument @@ -4598,7 +4596,7 @@ static bool findClassRelation( Doxygen::classSDict->append(baseClassName,baseClass); if (isArtificial) baseClass->setArtificial(TRUE); baseClass->setLanguage(root->lang); - int si = baseClassName.findRev("::"); + si = baseClassName.findRev("::"); if (si!=-1) // class is nested { Definition *sd = findScopeFromQualifiedName(Doxygen::globalScope,baseClassName.left(si),0,root->tagInfo()); @@ -5683,7 +5681,7 @@ static void findMember(const Entry *root, { if (funcSpec.isEmpty()) { - int argListIndex=0; + uint argListIndex=0; tempScopeName=cd->qualifiedNameWithTemplateParameters(&root->tArgLists,&argListIndex); } else @@ -5804,7 +5802,7 @@ static void findMember(const Entry *root, bool memFound=FALSE; for (mni.toFirst();!memFound && (md=mni.current());++mni) { - ClassDef *cd=md->getClassDef(); + cd=md->getClassDef(); Debug::print(Debug::FindMembers,0, "3. member definition found, " "scope needed='%s' scope='%s' args='%s' fileName=%s\n", @@ -6056,7 +6054,7 @@ static void findMember(const Entry *root, warnMsg+="Possible candidates:\n"; for (mni.toFirst();(md=mni.current());++mni) { - const ClassDef *cd=md->getClassDef(); + cd=md->getClassDef(); if (cd!=0 && rightScopeMatch(cd->name(),className)) { const ArgumentList &templAl = md->templateArguments(); @@ -6157,15 +6155,15 @@ static void findMember(const Entry *root, MemberNameIterator mni(*mn); MemberDef *md=mni.toFirst(); ASSERT(md); - ClassDef *cd=md->getClassDef(); + cd=md->getClassDef(); ASSERT(cd); - QCString className=cd->name().copy(); + className=cd->name(); ++mni; bool unique=TRUE; for (;(md=mni.current());++mni) { - const ClassDef *cd=md->getClassDef(); - if (className!=cd->name()) unique=FALSE; + const ClassDef *lcd=md->getClassDef(); + if (className!=lcd->name()) unique=FALSE; } if (unique) { @@ -6179,7 +6177,7 @@ static void findMember(const Entry *root, ArgumentList tArgList = getTemplateArgumentsFromName(cd->name()+"::"+funcName,root->tArgLists); //printf("new related member %s args='%s'\n",md->name().data(),funcArgs.data()); - MemberDef *md=createMemberDef( + md=createMemberDef( root->fileName,root->startLine,root->startColumn, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,Related, @@ -6232,7 +6230,6 @@ static void findMember(const Entry *root, Debug::print(Debug::FindMembers,0,"2. related function\n" " scopeName=%s className=%s\n",qPrint(scopeName),qPrint(className)); if (className.isEmpty()) className=relates; - ClassDef *cd; //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data()); if ((cd=getClass(scopeName))) { @@ -6241,7 +6238,7 @@ static void findMember(const Entry *root, MemberDef *mdDefine=0; bool isDefine=FALSE; { - MemberName *mn = Doxygen::functionNameSDict->find(funcName); + mn = Doxygen::functionNameSDict->find(funcName); if (mn) { MemberNameIterator mni(*mn); @@ -6453,7 +6450,6 @@ static void findMember(const Entry *root, else if (root->parent() && root->parent()->section==Entry::OBJCIMPL_SEC) { localObjCMethod: - ClassDef *cd; //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data()); if (Config_getBool(EXTRACT_LOCAL_METHODS) && (cd=getClass(scopeName))) { @@ -7054,7 +7050,7 @@ static void addEnumValuesToEnums(const Entry *root) fmd->setAnchor(); md->insertEnumField(fmd); fmd->setEnumScope(md,TRUE); - MemberName *mn=mnsd->find(e->name); + mn=mnsd->find(e->name); if (mn) { mn->append(fmd); @@ -7187,7 +7183,7 @@ static void findEnumDocumentation(const Entry *root) MemberDef *md; for (mni.toFirst();(md=mni.current()) && !found;++mni) { - const ClassDef *cd=md->getClassDef(); + cd=md->getClassDef(); if (cd && cd->name()==className && md->isEnumerate()) { // documentation outside a compound overrides the documentation inside it @@ -9016,9 +9012,9 @@ static void copyLatexStyleSheet() else { QCString destFileName = Config_getString(LATEX_OUTPUT)+"/"+fi.fileName().data(); - if (!checkExtension(fi.fileName().data(), latexStyleExtension)) + if (!checkExtension(fi.fileName().data(), LATEX_STYLE_EXTENSION)) { - destFileName += latexStyleExtension; + destFileName += LATEX_STYLE_EXTENSION; } copyFile(fileName, destFileName); } diff --git a/src/example.h b/src/example.h index 321982b..2af06ba 100644 --- a/src/example.h +++ b/src/example.h @@ -36,7 +36,7 @@ struct Example class ExampleSDict : public SDict { public: - ExampleSDict(int size=17) : SDict(size) { setAutoDelete(TRUE); } + ExampleSDict(uint size=17) : SDict(size) { setAutoDelete(TRUE); } ~ExampleSDict() {} private: int compareValues(const Example *item1,const Example *item2) const diff --git a/src/filedef.h b/src/filedef.h index b66d7be..2ca33db 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -217,7 +217,7 @@ class OutputNameList : public QList class OutputNameDict : public QDict { public: - OutputNameDict(int size) : QDict(size) {} + OutputNameDict(uint size) : QDict(size) {} ~OutputNameDict() {} }; diff --git a/src/formula.cpp b/src/formula.cpp index de004ed..ac25cfb 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -73,7 +73,7 @@ void FormulaManager::readFormulas(const char *dir,bool doCompare) QFile f(QCString(dir)+"/formula.repository"); if (f.open(IO_ReadOnly)) // open repository { - int formulaCount=0; + uint formulaCount=0; msg("Reading formula repository...\n"); QTextStream t(&f); QCString line; @@ -274,8 +274,8 @@ void FormulaManager::generateImages(const char *path,Format format,HighDPI hd) c if (zoomFactor<8 || zoomFactor>50) zoomFactor=10; scaleFactor *= zoomFactor/10.0; - int width = (int)((x2-x1)*scaleFactor+0.5f); - int height = (int)((y2-y1)*scaleFactor+0.5f); + int width = (int)((x2-x1)*scaleFactor+0.5); + int height = (int)((y2-y1)*scaleFactor+0.5); p->storeDisplaySize(pageNum,width,height); if (format==Format::Vector) @@ -468,7 +468,7 @@ int FormulaManager::addFormula(const char *formulaText) return it->second; } // store new formula - int id = p->formulas.size(); + int id = (int)p->formulas.size(); p->formulaMap.insert(std::pair(key,id)); p->formulas.push_back(key); return id; diff --git a/src/fortrancode.l b/src/fortrancode.l index 4d8dc1c..81bf9f6 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -26,6 +26,7 @@ %option never-interactive %option case-insensitive %option prefix="fortrancodeYY" +%option noyy_top_state %top{ #include } @@ -68,6 +69,8 @@ const int fixedCommentAfter = 72; #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 +#define USE_STATE2STRING 0 + /* * For fixed formatted code position 6 is of importance (continuation character). * The following variables and macros keep track of the column number @@ -78,7 +81,7 @@ const int fixedCommentAfter = 72; int yy_old_start = 0; int yy_my_start = 0; int yy_end = 1; -#define YY_USER_ACTION {yy_old_start = yy_my_start; yy_my_start = yy_end; yy_end += yyleng;} +#define YY_USER_ACTION {yy_old_start = yy_my_start; yy_my_start = yy_end; yy_end += static_cast(yyleng);} #define YY_FTN_RESET {yy_old_start = 0; yy_my_start = 0; yy_end = 1;} #define YY_FTN_REJECT {yy_end = yy_my_start; yy_my_start = yy_old_start; REJECT;} @@ -130,7 +133,7 @@ static UseEntry *useEntry = 0; //!< current use statement info static QList scopeStack; static bool g_isExternal = false; // static QCStringList *currentUseNames= new QCStringList; //! contains names of used modules of current program unit -static QCString str=""; //!> contents of fortran string +static QCString g_str=""; //!> contents of fortran string static CodeOutputInterface * g_code; @@ -171,7 +174,9 @@ static int inTypeDecl = 0; static bool g_endComment; +#if USE_STATE2STRING static const char *stateToString(int state); +#endif static void endFontClass() { @@ -456,58 +461,58 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam if (mn) // name is known { - MemberNameIterator mli(*mn); - for (mli.toFirst();(md=mli.current());++mli) // all found functions with given name - { - const FileDef *fd=md->getFileDef(); - const GroupDef *gd=md->getGroupDef(); - const ClassDef *cd=md->getClassDef(); - - //cout << "found link with same name: " << fd->fileName() << " " << memberName; - //if (md->getNamespaceDef() != 0) cout << " in namespace " << md->getNamespaceDef()->name();cout << endl; + MemberNameIterator mli(*mn); + for (mli.toFirst();(md=mli.current());++mli) // all found functions with given name + { + const FileDef *fd=md->getFileDef(); + const GroupDef *gd=md->getGroupDef(); + const ClassDef *cd=md->getClassDef(); - if ((gd && gd->isLinkable()) || (fd && fd->isLinkable())) - { - const NamespaceDef *nspace= md->getNamespaceDef(); + //cout << "found link with same name: " << fd->fileName() << " " << memberName; + //if (md->getNamespaceDef() != 0) cout << " in namespace " << md->getNamespaceDef()->name();cout << endl; - if (nspace == 0) - { // found function in global scope - if(cd == 0) { // Skip if bound to type - return TRUE; + if ((gd && gd->isLinkable()) || (fd && fd->isLinkable())) + { + const NamespaceDef *nspace= md->getNamespaceDef(); + + if (nspace == 0) + { // found function in global scope + if(cd == 0) { // Skip if bound to type + return TRUE; + } + } + else if (moduleName == nspace->name()) + { // found in local scope + return TRUE; + } + else + { // else search in used modules + QCString usedModuleName= nspace->name(); + UseEntry *ue= usedict->find(usedModuleName); + if (ue) + { + // check if only-list exists and if current entry exists is this list + QCStringList &only= ue->onlyNames; + if (only.isEmpty()) + { + //cout << " found in module " << usedModuleName << " entry " << memberName << endl; + return TRUE; // whole module used + } + else + { + for ( QCStringList::Iterator lit = only.begin(); lit != only.end(); ++lit) + { + //cout << " search in only: " << usedModuleName << ":: " << memberName << "==" << (*it)<< endl; + if (memberName == *lit) + { + return TRUE; // found in ONLY-part of use list + } } - } - else if (moduleName == nspace->name()) - { // found in local scope - return TRUE; - } - else - { // else search in used modules - QCString moduleName= nspace->name(); - UseEntry *ue= usedict->find(moduleName); - if (ue) - { - // check if only-list exists and if current entry exists is this list - QCStringList &only= ue->onlyNames; - if (only.isEmpty()) - { - //cout << " found in module " << moduleName << " entry " << memberName << endl; - return TRUE; // whole module used - } - else - { - for ( QCStringList::Iterator it = only.begin(); it != only.end(); ++it) - { - //cout << " search in only: " << moduleName << ":: " << memberName << "==" << (*it)<< endl; - if (memberName == *it) - { - return TRUE; // found in ONLY-part of use list - } - } - } - } - } - } // if linkable - } // for + } + } + } + } // if linkable + } // for } return FALSE; } @@ -669,15 +674,15 @@ static void addLocalVar(const QCString &varName) #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); -static int yyread(char *buf,int max_size) +static yy_size_t yyread(char *buf,yy_size_t max_size) { - int c=0; - while( c < max_size && g_inputString[g_inputPosition] ) - { - *buf = g_inputString[g_inputPosition++] ; - c++; buf++; - } - return c; + yy_size_t c=0; + while( c < max_size && g_inputString[g_inputPosition] ) + { + *buf = g_inputString[g_inputPosition++] ; + c++; buf++; + } + return c; } %} @@ -1120,7 +1125,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") g_contLineNr++; yy_old_start = 0; yy_my_start = 1; - yy_end = yyleng; + yy_end = static_cast(yyleng); } // Actually we should see if ! on position 6, can be continuation // but the chance is very unlikely, so no effort to solve it here @@ -1141,7 +1146,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") g_contLineNr++; yy_old_start = 0; yy_my_start = 1; - yy_end = yyleng; + yy_end = static_cast(yyleng); // Actually we should see if ! on position 6, can be continuation // but the chance is very unlikely, so no effort to solve it here docBlock+=yytext; @@ -1220,22 +1225,22 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") /*------ strings --------------------------------------------------*/ \n { // string with \n inside g_contLineNr++; - str+=yytext; + g_str+=yytext; startFontClass("stringliteral"); - codifyLines(str); + codifyLines(g_str); endFontClass(); - str = ""; + g_str = ""; YY_FTN_RESET } \"|\' { // string ends with next quote without previous backspace if(yytext[0]!=stringStartSymbol) YY_FTN_REJECT; // single vs double quote - str+=yytext; + g_str+=yytext; startFontClass("stringliteral"); - codifyLines(str); + codifyLines(g_str); endFontClass(); yy_pop_state(); } -. {str+=yytext;} +. {g_str+=yytext;} <*>\"|\' { /* string starts */ /* if(YY_START == StrIgnore) YY_FTN_REJECT; // ignore in simple comments */ @@ -1243,7 +1248,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") yy_push_state(YY_START); stringStartSymbol=yytext[0]; // single or double quote BEGIN(String); - str=yytext; + g_str=yytext; } /*-----------------------------------------------------------------------------*/ @@ -1306,7 +1311,6 @@ const char* prepassFixedForm(const char* contents, int *hasContLine); /* prototy static void checkContLines(const char *s) { int numLines = 0; - int curLine = 0; int i = 0; const char *p = s; @@ -1430,4 +1434,6 @@ void FortranCodeParser::resetCodeParserState() //--------------------------------------------------------- +#if USE_STATE2STRING #include "fortrancode.l.h" +#endif diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 3a5123c..95842f0 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -144,7 +144,7 @@ struct CommentInPrepass { int column; QCString str; - CommentInPrepass(int column, QCString str) : column(column), str(str) {} + CommentInPrepass(int col, QCString s) : column(col), str(s) {} }; /* ----------------------------------------------------------------- @@ -213,7 +213,7 @@ static QCString extractFromParens(const QCString name); static QCString extractBind(const QCString name); -static int yyread(yyscan_t yyscanner,char *buf,int max_size); +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size); static void startCommentBlock(yyscan_t yyscanner,bool); static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief); static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief); @@ -927,7 +927,7 @@ private { if (strt != 0) lft = yyextra->current_root->type.left(strt).stripWhiteSpace(); if ((yyextra->current_root->type.length() - strt - strlen("function"))!= 0) { - rght = yyextra->current_root->type.right(yyextra->current_root->type.length() - strt - strlen("function")).stripWhiteSpace(); + rght = yyextra->current_root->type.right(yyextra->current_root->type.length() - strt - (int)strlen("function")).stripWhiteSpace(); } yyextra->current_root->type = lft; if (rght.length() > 0) @@ -1567,7 +1567,7 @@ const char* prepassFixedForm(const char* contents, int *hasContLine) bool fullCommentLine=TRUE; bool artificialComment=FALSE; bool spaces=TRUE; - int newContentsSize = strlen(contents)+3; // \000, \n (when necessary) and one spare character (to avoid reallocation) + int newContentsSize = (int)strlen(contents)+3; // \000, \n (when necessary) and one spare character (to avoid reallocation) char* newContents = (char*)malloc(newContentsSize); int curLine = 1; @@ -1643,7 +1643,7 @@ const char* prepassFixedForm(const char* contents, int *hasContLine) return NULL; } newContents[j]='\000'; - newContentsSize = strlen(newContents); + newContentsSize = (int)strlen(newContents); if (newContents[newContentsSize - 1] != '\n') { // to be on the safe side @@ -1786,7 +1786,7 @@ const char* prepassFixedForm(const char* contents, int *hasContLine) free(newContents); return NULL; } - newContentsSize = strlen(newContents); + newContentsSize = (int)strlen(newContents); if (newContents[newContentsSize - 1] != '\n') { // to be on the safe side @@ -2316,10 +2316,10 @@ static bool endScope(yyscan_t yyscanner,Entry *scope, bool isGlobalRoot) return TRUE; } -static int yyread(yyscan_t yyscanner,char *buf,int max_size) +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; - int c=0; + yy_size_t c=0; while ( c < max_size && yyextra->inputString[yyextra->inputPosition] ) { *buf = yyextra->inputString[yyextra->inputPosition++] ; @@ -2569,7 +2569,7 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b (directionParam[dir1] == directionParam[SymbolModifiers::IN])) { // strip direction - loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::IN])); + loc_doc = loc_doc.right(loc_doc.length()-(int)strlen(directionParam[SymbolModifiers::IN])); loc_doc.stripWhiteSpace(); // in case of empty documentation or (now) just name, consider it as no documentation if (!loc_doc.isEmpty() && (loc_doc.lower() != yyextra->argName.lower())) @@ -2593,7 +2593,7 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b if ((directionParam[dir1] == directionParam[SymbolModifiers::NONE_D]) || (directionParam[dir1] == directionParam[SymbolModifiers::OUT])) { - loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::OUT])); + loc_doc = loc_doc.right(loc_doc.length()-(int)strlen(directionParam[SymbolModifiers::OUT])); loc_doc.stripWhiteSpace(); if (loc_doc.isEmpty() || (loc_doc.lower() == yyextra->argName.lower())) { @@ -2617,7 +2617,7 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b if ((directionParam[dir1] == directionParam[SymbolModifiers::NONE_D]) || (directionParam[dir1] == directionParam[SymbolModifiers::INOUT])) { - loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::INOUT])); + loc_doc = loc_doc.right(loc_doc.length()-(int)strlen(directionParam[SymbolModifiers::INOUT])); loc_doc.stripWhiteSpace(); if (!loc_doc.isEmpty() && (loc_doc.lower() != yyextra->argName.lower())) { diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 149f43c..c556b43 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -689,7 +689,7 @@ static void generateJSNavTree(const QList &nodeList) tsidx << "{" << endl; QListIterator li(navIndex); NavIndexEntry *e; - bool first=TRUE; + first=TRUE; for (li.toFirst();(e=li.current());) // for each entry { if (elemCount==0) @@ -781,8 +781,7 @@ void FTVHelp::generateTreeViewInline(FTextStream &t) t << "
["; t << theTranslator->trDetailLevel(); t << " "; - int i; - for (i=1;i<=depth;i++) + for (int i=1;i<=depth;i++) { t << "" << i << ""; } @@ -794,9 +793,7 @@ void FTVHelp::generateTreeViewInline(FTextStream &t) for (int i=1;i<=depth;i++) { int num=0; - QListIterator li(m_indentNodes[0]); - FTVNode *n; - for (;(n=li.current());++li) + for (li.toFirst();(n=li.current());++li) { num+=n->numNodesAtLevel(0,i); } diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 960252d..5af1525 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -54,10 +54,10 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef virtual DefType definitionType() const { return TypeGroup; } virtual QCString getOutputFileBase() const; virtual QCString anchor() const { return QCString(); } - virtual QCString displayName(bool=TRUE) const { return hasGroupTitle() ? title : DefinitionImpl::name(); } - virtual const char *groupTitle() const { return title; } + virtual QCString displayName(bool=TRUE) const { return hasGroupTitle() ? m_title : DefinitionImpl::name(); } + virtual const char *groupTitle() const { return m_title; } virtual void setGroupTitle( const char *newtitle ); - virtual bool hasGroupTitle( ) const { return titleSet; } + virtual bool hasGroupTitle( ) const { return m_titleSet; } virtual void addFile(const FileDef *def); virtual bool addClass(const ClassDef *def); virtual bool addNamespace(const NamespaceDef *def); @@ -87,22 +87,22 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef virtual void sortMemberLists(); virtual bool subGrouping() const { return m_subGrouping; } - virtual void setGroupScope(Definition *d) { groupScope = d; } - virtual Definition *getGroupScope() const { return groupScope; } + virtual void setGroupScope(Definition *d) { m_groupScope = d; } + virtual Definition *getGroupScope() const { return m_groupScope; } virtual MemberList *getMemberList(MemberListType lt) const; virtual const QList &getMemberLists() const { return m_memberLists; } /* user defined member groups */ - virtual MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; } - - virtual FileList * getFiles() const { return fileList; } - virtual ClassSDict * getClasses() const { return classSDict; } - virtual NamespaceSDict * getNamespaces() const { return namespaceSDict; } - virtual GroupList * getSubGroups() const { return groupList; } - virtual PageSDict * getPages() const { return pageDict; } - virtual DirList * getDirs() const { return dirList; } - virtual PageSDict * getExamples() const { return exampleDict; } + virtual MemberGroupSDict *getMemberGroupSDict() const { return m_memberGroupSDict; } + + virtual FileList * getFiles() const { return m_fileList; } + virtual ClassSDict * getClasses() const { return m_classSDict; } + virtual NamespaceSDict * getNamespaces() const { return m_namespaceSDict; } + virtual GroupList * getSubGroups() const { return m_groupList; } + virtual PageSDict * getPages() const { return m_pageDict; } + virtual DirList * getDirs() const { return m_dirList; } + virtual PageSDict * getExamples() const { return m_exampleDict; } virtual bool hasDetailedDescription() const; virtual void sortSubGroups(); @@ -132,25 +132,22 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef void writeSummaryLinks(OutputList &ol) const; void updateLanguage(const Definition *); - QCString title; // title of the group - bool titleSet; // true if title is not the same as the name - QCString fileName; // base name of the generated file - FileList *fileList; // list of files in the group - ClassSDict *classSDict; // list of classes in the group - NamespaceSDict *namespaceSDict; // list of namespaces in the group - GroupList *groupList; // list of sub groups. - PageSDict *pageDict; // list of pages in the group - PageSDict *exampleDict; // list of examples in the group - DirList *dirList; // list of directories in the group - - MemberList *allMemberList; - MemberNameInfoSDict *allMemberNameInfoSDict; - - Definition *groupScope; - - QList m_memberLists; - MemberGroupSDict *memberGroupSDict; - bool m_subGrouping; + QCString m_title; // title of the group + bool m_titleSet; // true if title is not the same as the name + QCString m_fileName; // base name of the generated file + FileList * m_fileList; // list of files in the group + ClassSDict * m_classSDict; // list of classes in the group + NamespaceSDict * m_namespaceSDict; // list of namespaces in the group + GroupList * m_groupList; // list of sub groups. + PageSDict * m_pageDict; // list of pages in the group + PageSDict * m_exampleDict; // list of examples in the group + DirList * m_dirList; // list of directories in the group + MemberList * m_allMemberList; + MemberNameInfoSDict *m_allMemberNameInfoSDict; + Definition * m_groupScope; + QList m_memberLists; + MemberGroupSDict * m_memberGroupSDict; + bool m_subGrouping; }; @@ -166,67 +163,67 @@ GroupDef *createGroupDef(const char *fileName,int line,const char *name, GroupDefImpl::GroupDefImpl(const char *df,int dl,const char *na,const char *t, const char *refFileName) : DefinitionImpl(df,dl,1,na) { - fileList = new FileList; - classSDict = new ClassSDict(17); - groupList = new GroupList; - namespaceSDict = new NamespaceSDict(17); - pageDict = new PageSDict(17); - exampleDict = new PageSDict(17); - dirList = new DirList; - allMemberNameInfoSDict = new MemberNameInfoSDict(17); - allMemberNameInfoSDict->setAutoDelete(TRUE); + m_fileList = new FileList; + m_classSDict = new ClassSDict(17); + m_groupList = new GroupList; + m_namespaceSDict = new NamespaceSDict(17); + m_pageDict = new PageSDict(17); + m_exampleDict = new PageSDict(17); + m_dirList = new DirList; + m_allMemberNameInfoSDict = new MemberNameInfoSDict(17); + m_allMemberNameInfoSDict->setAutoDelete(TRUE); if (refFileName) { - fileName=stripExtension(refFileName); + m_fileName=stripExtension(refFileName); } else { - fileName = convertNameToFile(QCString("group_")+na); + m_fileName = convertNameToFile(QCString("group_")+na); } setGroupTitle( t ); - memberGroupSDict = new MemberGroupSDict; - memberGroupSDict->setAutoDelete(TRUE); + m_memberGroupSDict = new MemberGroupSDict; + m_memberGroupSDict->setAutoDelete(TRUE); - allMemberList = new MemberList(MemberListType_allMembersList); + m_allMemberList = new MemberList(MemberListType_allMembersList); //visited = 0; - groupScope = 0; + m_groupScope = 0; m_subGrouping=Config_getBool(SUBGROUPING); } GroupDefImpl::~GroupDefImpl() { - delete fileList; - delete classSDict; - delete groupList; - delete namespaceSDict; - delete pageDict; - delete exampleDict; - delete allMemberList; - delete allMemberNameInfoSDict; - delete memberGroupSDict; - delete dirList; + delete m_fileList; + delete m_classSDict; + delete m_groupList; + delete m_namespaceSDict; + delete m_pageDict; + delete m_exampleDict; + delete m_allMemberList; + delete m_allMemberNameInfoSDict; + delete m_memberGroupSDict; + delete m_dirList; } void GroupDefImpl::setGroupTitle( const char *t ) { - if ( t && qstrlen(t) ) + if ( t && *t ) { - title = t; - titleSet = TRUE; + m_title = t; + m_titleSet = TRUE; } else { - title = name(); - title.at(0)=toupper(title.at(0)); - titleSet = FALSE; + m_title = name(); + m_title[0]=(char)toupper(m_title[0]); + m_titleSet = FALSE; } } void GroupDefImpl::distributeMemberGroupDocumentation() { - MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { @@ -237,7 +234,7 @@ void GroupDefImpl::distributeMemberGroupDocumentation() void GroupDefImpl::findSectionsInDocumentation() { docFindSections(documentation(),this,docFile()); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { @@ -261,9 +258,9 @@ void GroupDefImpl::addFile(const FileDef *def) if (def->isHidden()) return; updateLanguage(def); if (sortBriefDocs) - fileList->inSort(def); + m_fileList->inSort(def); else - fileList->append(def); + m_fileList->append(def); } bool GroupDefImpl::addClass(const ClassDef *cd) @@ -272,12 +269,12 @@ bool GroupDefImpl::addClass(const ClassDef *cd) if (cd->isHidden()) return FALSE; updateLanguage(cd); QCString qn = cd->name(); - if (classSDict->find(qn)==0) + if (m_classSDict->find(qn)==0) { //printf("--- addClass %s sort=%d\n",qn.data(),sortBriefDocs); if (sortBriefDocs) { - classSDict->inSort(qn,cd); + m_classSDict->inSort(qn,cd); } else { @@ -290,23 +287,23 @@ bool GroupDefImpl::addClass(const ClassDef *cd) // add nested classes (e.g. A::B, A::C) after their parent (A) in // order of insertion QCString scope = qn.left(i); - int j=classSDict->findAt(scope); + int j=m_classSDict->findAt(scope); if (j!=-1) { - while (j<(int)classSDict->count() && - classSDict->at(j)->qualifiedName().left(i)==scope) + while (j<(int)m_classSDict->count() && + m_classSDict->at(j)->qualifiedName().left(i)==scope) { //printf("skipping over %s\n",classSDict->at(j)->qualifiedName().data()); j++; } //printf("Found scope at index %d\n",j); - classSDict->insertAt(j,qn,cd); + m_classSDict->insertAt(j,qn,cd); found=TRUE; } } if (!found) // no insertion point found -> just append { - classSDict->append(qn,cd); + m_classSDict->append(qn,cd); } } return TRUE; @@ -319,12 +316,12 @@ bool GroupDefImpl::addNamespace(const NamespaceDef *def) static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS); if (def->isHidden()) return FALSE; updateLanguage(def); - if (namespaceSDict->find(def->name())==0) + if (m_namespaceSDict->find(def->name())==0) { if (sortBriefDocs) - namespaceSDict->inSort(def->name(),def); + m_namespaceSDict->inSort(def->name(),def); else - namespaceSDict->append(def->name(),def); + m_namespaceSDict->append(def->name(),def); return TRUE; } return FALSE; @@ -334,23 +331,23 @@ void GroupDefImpl::addDir(const DirDef *def) { if (def->isHidden()) return; if (Config_getBool(SORT_BRIEF_DOCS)) - dirList->inSort(def); + m_dirList->inSort(def); else - dirList->append(def); + m_dirList->append(def); } void GroupDefImpl::addPage(PageDef *def) { if (def->isHidden()) return; //printf("Making page %s part of a group\n",def->name.data()); - pageDict->append(def->name(),def); + m_pageDict->append(def->name(),def); def->makePartOfGroup(this); } void GroupDefImpl::addExample(const PageDef *def) { if (def->isHidden()) return; - exampleDict->append(def->name(),def); + m_exampleDict->append(def->name(),def); } @@ -362,12 +359,12 @@ void GroupDefImpl::addMembersToMemberGroup() { if (ml->listType()&MemberListType_declarationLists) { - ::addMembersToMemberGroup(ml,&memberGroupSDict,this); + ::addMembersToMemberGroup(ml,&m_memberGroupSDict,this); } } //printf("GroupDefImpl::addMembersToMemberGroup() memberGroupList=%d\n",memberGroupList->count()); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { @@ -382,7 +379,7 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly) updateLanguage(md); //printf("GroupDef(%s)::insertMember(%s)\n", title.data(), md->name().data()); MemberNameInfo *mni=0; - if ((mni=(*allMemberNameInfoSDict)[md->name()])) + if ((mni=(*m_allMemberNameInfoSDict)[md->name()])) { // member with this name already found MemberNameInfoIterator srcMnii(*mni); const MemberInfo *srcMi; @@ -427,10 +424,10 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly) { mni = new MemberNameInfo(md->name()); mni->append(new MemberInfo(md,md->protection(),md->virtualness(),FALSE)); - allMemberNameInfoSDict->append(mni->memberName(),mni); + m_allMemberNameInfoSDict->append(mni->memberName(),mni); } //printf("Added member!\n"); - allMemberList->append(md); + m_allMemberList->append(md); switch(md->memberType()) { case MemberType_Variable: @@ -542,7 +539,7 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly) void GroupDefImpl::removeMember(MemberDef *md) { // fprintf(stderr, "GroupDef(%s)::removeMember( %s )\n", title.data(), md->name().data()); - MemberNameInfo *mni = allMemberNameInfoSDict->find(md->name()); + MemberNameInfo *mni = m_allMemberNameInfoSDict->find(md->name()); if (mni) { MemberNameInfoIterator mnii(*mni); @@ -557,7 +554,7 @@ void GroupDefImpl::removeMember(MemberDef *md) } if( mni->isEmpty() ) { - allMemberNameInfoSDict->remove(md->name()); + m_allMemberNameInfoSDict->remove(md->name()); } removeMemberFromList(MemberListType_allMembersList,md); @@ -632,9 +629,9 @@ bool GroupDefImpl::findGroup(const GroupDef *def) const { return TRUE; } - else if (groupList) + else if (m_groupList) { - GroupListIterator it(*groupList); + GroupListIterator it(*m_groupList); GroupDef *gd; for (;(gd=it.current());++it) { @@ -653,7 +650,7 @@ void GroupDefImpl::addGroup(const GroupDef *def) //if (Config_getBool(SORT_MEMBER_DOCS)) // groupList->inSort(def); //else - groupList->append(def); + m_groupList->append(def); } bool GroupDefImpl::isASubGroup() const @@ -671,9 +668,9 @@ void GroupDefImpl::countMembers() ml->countDecMembers(); ml->countDocMembers(); } - if (memberGroupSDict) + if (m_memberGroupSDict) { - MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { @@ -685,27 +682,27 @@ void GroupDefImpl::countMembers() int GroupDefImpl::numDocMembers() const { - return fileList->count()+ - classSDict->count()+ - namespaceSDict->count()+ - groupList->count()+ - allMemberList->count()+ - pageDict->count()+ - exampleDict->count(); + return m_fileList->count()+ + m_classSDict->count()+ + m_namespaceSDict->count()+ + m_groupList->count()+ + m_allMemberList->count()+ + m_pageDict->count()+ + m_exampleDict->count(); } /*! Compute the HTML anchor names for all members in the group */ void GroupDefImpl::computeAnchors() { //printf("GroupDefImpl::computeAnchors()\n"); - setAnchors(allMemberList); + setAnchors(m_allMemberList); } void GroupDefImpl::writeTagFile(FTextStream &tagFile) { tagFile << " " << endl; tagFile << " " << convertToXML(name()) << "" << endl; - tagFile << " " << convertToXML(title) << "" << endl; + tagFile << " " << convertToXML(m_title) << "" << endl; tagFile << " " << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "" << endl; QListIterator eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); @@ -716,9 +713,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) { case LayoutDocEntry::GroupClasses: { - if (classSDict) + if (m_classSDict) { - SDict::Iterator ci(*classSDict); + SDict::Iterator ci(*m_classSDict); ClassDef *cd; for (ci.toFirst();(cd=ci.current());++ci) { @@ -733,9 +730,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::GroupNamespaces: { - if (namespaceSDict) + if (m_namespaceSDict) { - SDict::Iterator ni(*namespaceSDict); + SDict::Iterator ni(*m_namespaceSDict); NamespaceDef *nd; for (ni.toFirst();(nd=ni.current());++ni) { @@ -750,9 +747,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::GroupFiles: { - if (fileList) + if (m_fileList) { - QListIterator it(*fileList); + QListIterator it(*m_fileList); FileDef *fd; for (;(fd=it.current());++it) { @@ -766,9 +763,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::GroupPageDocs: { - if (pageDict) + if (m_pageDict) { - PageSDict::Iterator pdi(*pageDict); + PageSDict::Iterator pdi(*m_pageDict); PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { @@ -783,9 +780,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::GroupDirs: { - if (dirList) + if (m_dirList) { - QListIterator it(*dirList); + QListIterator it(*m_dirList); DirDef *dd; for (;(dd=it.current());++it) { @@ -799,9 +796,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::GroupNestedGroups: { - if (groupList) + if (m_groupList) { - QListIterator it(*groupList); + QListIterator it(*m_groupList); GroupDef *gd; for (;(gd=it.current());++it) { @@ -825,9 +822,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::MemberGroups: { - if (memberGroupSDict) + if (m_memberGroupSDict) { - MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { @@ -851,7 +848,7 @@ void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title ) { ol.pushGeneratorState(); - if (pageDict->count()!=numDocMembers()) // not only pages -> classical layout + if (m_pageDict->count()!=(uint)numDocMembers()) // not only pages -> classical layout { ol.pushGeneratorState(); ol.disable(OutputGenerator::Html); @@ -953,7 +950,7 @@ void GroupDefImpl::writeGroupGraph(OutputList &ol) ol.disable(OutputGenerator::Man); //ol.startParagraph(); ol.startGroupCollaboration(); - ol.parseText(theTranslator->trCollaborationDiagram(title)); + ol.parseText(theTranslator->trCollaborationDiagram(m_title)); ol.endGroupCollaboration(graph); //ol.endParagraph(); ol.popGeneratorState(); @@ -964,13 +961,13 @@ void GroupDefImpl::writeGroupGraph(OutputList &ol) void GroupDefImpl::writeFiles(OutputList &ol,const QCString &title) { // write list of files - if (fileList->count()>0) + if (m_fileList->count()>0) { ol.startMemberHeader("files"); ol.parseText(title); ol.endMemberHeader(); ol.startMemberList(); - QListIterator it(*fileList); + QListIterator it(*m_fileList); FileDef *fd; for (;(fd=it.current());++it) { @@ -996,16 +993,16 @@ void GroupDefImpl::writeFiles(OutputList &ol,const QCString &title) void GroupDefImpl::writeNamespaces(OutputList &ol,const QCString &title) { // write list of namespaces - namespaceSDict->writeDeclaration(ol,title); + m_namespaceSDict->writeDeclaration(ol,title); } void GroupDefImpl::writeNestedGroups(OutputList &ol,const QCString &title) { // write list of groups int count=0; - if (groupList->count()>0) + if (m_groupList->count()>0) { - QListIterator it(*groupList); + QListIterator it(*m_groupList); GroupDef *gd; for (;(gd=it.current());++it) { @@ -1020,9 +1017,9 @@ void GroupDefImpl::writeNestedGroups(OutputList &ol,const QCString &title) ol.startMemberList(); if (Config_getBool(SORT_GROUP_NAMES)) { - groupList->sort(); + m_groupList->sort(); } - QListIterator it(*groupList); + QListIterator it(*m_groupList); GroupDef *gd; for (;(gd=it.current());++it) { @@ -1052,13 +1049,13 @@ void GroupDefImpl::writeNestedGroups(OutputList &ol,const QCString &title) void GroupDefImpl::writeDirs(OutputList &ol,const QCString &title) { // write list of directories - if (dirList->count()>0) + if (m_dirList->count()>0) { ol.startMemberHeader("dirs"); ol.parseText(title); ol.endMemberHeader(); ol.startMemberList(); - QListIterator it(*dirList); + QListIterator it(*m_dirList); DirDef *dd; for (;(dd=it.current());++it) { @@ -1085,18 +1082,18 @@ void GroupDefImpl::writeDirs(OutputList &ol,const QCString &title) void GroupDefImpl::writeClasses(OutputList &ol,const QCString &title) { // write list of classes - classSDict->writeDeclaration(ol,0,title,FALSE); + m_classSDict->writeDeclaration(ol,0,title,FALSE); } void GroupDefImpl::writeInlineClasses(OutputList &ol) { - classSDict->writeDocumentation(ol); + m_classSDict->writeDocumentation(ol); } void GroupDefImpl::writePageDocumentation(OutputList &ol) { PageDef *pd=0; - PageSDict::Iterator pdi(*pageDict); + PageSDict::Iterator pdi(*m_pageDict); for (pdi.toFirst();(pd=pdi.current());++pdi) { if (!pd->isReference()) @@ -1119,11 +1116,11 @@ void GroupDefImpl::writePageDocumentation(OutputList &ol) void GroupDefImpl::writeMemberGroups(OutputList &ol) { /* write user defined member groups */ - if (memberGroupSDict) + if (m_memberGroupSDict) { - memberGroupSDict->sort(); + m_memberGroupSDict->sort(); /* write user defined member groups */ - MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { @@ -1186,11 +1183,11 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const SrcLangExt lang = getLanguage(); for (eli.toFirst();(lde=eli.current());++eli) { - if ((lde->kind()==LayoutDocEntry::GroupClasses && classSDict->declVisible()) || - (lde->kind()==LayoutDocEntry::GroupNamespaces && namespaceSDict->declVisible()) || - (lde->kind()==LayoutDocEntry::GroupFiles && fileList->count()>0) || - (lde->kind()==LayoutDocEntry::GroupNestedGroups && groupList->count()>0) || - (lde->kind()==LayoutDocEntry::GroupDirs && dirList->count()>0) + if ((lde->kind()==LayoutDocEntry::GroupClasses && m_classSDict->declVisible()) || + (lde->kind()==LayoutDocEntry::GroupNamespaces && m_namespaceSDict->declVisible()) || + (lde->kind()==LayoutDocEntry::GroupFiles && m_fileList->count()>0) || + (lde->kind()==LayoutDocEntry::GroupNestedGroups && m_groupList->count()>0) || + (lde->kind()==LayoutDocEntry::GroupDirs && m_dirList->count()>0) ) { LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; @@ -1224,19 +1221,19 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) { //static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); ol.pushGeneratorState(); - startFile(ol,getOutputFileBase(),name(),title,HLI_Modules); + startFile(ol,getOutputFileBase(),name(),m_title,HLI_Modules); ol.startHeaderSection(); writeSummaryLinks(ol); ol.startTitleHead(getOutputFileBase()); ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); - ol.parseText(title); + ol.parseText(m_title); ol.popGeneratorState(); addGroupListToTitle(ol,this); ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); - ol.endTitleHead(getOutputFileBase(),title); + ol.endTitleHead(getOutputFileBase(),m_title); ol.popGeneratorState(); ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Man); @@ -1250,14 +1247,14 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) Doxygen::searchIndex->setCurrentDoc(this,anchor(),FALSE); static QRegExp we("[a-zA-Z_][-a-zA-Z_0-9]*"); int i=0,p=0,l=0; - while ((i=we.match(title,p,&l))!=-1) // foreach word in the title + while ((i=we.match(m_title,p,&l))!=-1) // foreach word in the title { - Doxygen::searchIndex->addWord(title.mid(i,l),TRUE); + Doxygen::searchIndex->addWord(m_title.mid(i,l),TRUE); p=i+l; } } - Doxygen::indexList->addIndexItem(this,0,0,title); + Doxygen::indexList->addIndexItem(this,0,0,m_title); //---------------------------------------- start flexible part ------------------------------- @@ -1391,7 +1388,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) if (Config_getBool(SEPARATE_MEMBER_PAGES)) { - allMemberList->sort(); + m_allMemberList->sort(); writeMemberPages(ol); } @@ -1422,7 +1419,7 @@ void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *current ol.writeString("
\n"); ol.writeString(" \n"); - MemberListIterator mli(*allMemberList); + MemberListIterator mli(*m_allMemberList); MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { @@ -1653,7 +1650,7 @@ void addExampleToGroups(const Entry *root,PageDef *eg) QCString GroupDefImpl::getOutputFileBase() const { - return fileName; + return m_fileName; } void GroupDefImpl::addListReferences() @@ -1668,7 +1665,7 @@ void GroupDefImpl::addListReferences() 0 ); } - MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { @@ -1763,13 +1760,13 @@ void GroupDefImpl::writeMemberDocumentation(OutputList &ol,MemberListType lt,con void GroupDefImpl::removeMemberFromList(MemberListType lt,MemberDef *md) { - MemberList *ml = getMemberList(lt); - if (ml) ml->remove(md); + MemberList *ml = getMemberList(lt); + if (ml) ml->remove(md); } void GroupDefImpl::sortSubGroups() { - groupList->sort(); + m_groupList->sort(); } bool GroupDefImpl::isLinkableInProject() const diff --git a/src/growbuf.h b/src/growbuf.h index 2d0d503..cd6a67b 100644 --- a/src/growbuf.h +++ b/src/growbuf.h @@ -10,49 +10,49 @@ class GrowBuf { public: - GrowBuf() : str(0), pos(0), len(0) {} - GrowBuf(int initialSize) : pos(0), len(initialSize) { str=(char*)malloc(len); } - ~GrowBuf() { free(str); str=0; pos=0; len=0; } - void clear() { pos=0; } - void addChar(char c) { if (pos>=len) { len+=GROW_AMOUNT; str = (char*)realloc(str,len); } - str[pos++]=c; + GrowBuf() : m_str(0), m_pos(0), m_len(0) {} + GrowBuf(uint initialSize) : m_pos(0), m_len(initialSize) { m_str=(char*)malloc(m_len); } + ~GrowBuf() { free(m_str); } + void clear() { m_pos=0; } + void addChar(char c) { if (m_pos>=m_len) { m_len+=GROW_AMOUNT; m_str = (char*)realloc(m_str,m_len); } + m_str[m_pos++]=c; } void addStr(const QCString &s) { if (!s.isEmpty()) { - int l=s.length(); - if (pos+l>=len) { len+=l+GROW_AMOUNT; str = (char*)realloc(str,len); } - strcpy(&str[pos],s.data()); - pos+=l; + uint l=s.length(); + if (m_pos+l>=m_len) { m_len+=l+GROW_AMOUNT; m_str = (char*)realloc(m_str,m_len); } + strcpy(&m_str[m_pos],s.data()); + m_pos+=l; } } void addStr(const char *s) { if (s) { - int l=(int)strlen(s); - if (pos+l>=len) { len+=l+GROW_AMOUNT; str = (char*)realloc(str,len); } - strcpy(&str[pos],s); - pos+=l; + uint l=(uint)strlen(s); + if (m_pos+l>=m_len) { m_len+=l+GROW_AMOUNT; m_str = (char*)realloc(m_str,m_len); } + strcpy(&m_str[m_pos],s); + m_pos+=l; } } - void addStr(const char *s,int n) { + void addStr(const char *s,uint n) { if (s) { - int l=(int)strlen(s); + uint l=(uint)strlen(s); if (n=len) { len+=l+GROW_AMOUNT; str = (char*)realloc(str,len); } - strncpy(&str[pos],s,n); - pos+=l; + if (m_pos+l>=m_len) { m_len+=l+GROW_AMOUNT; m_str = (char*)realloc(m_str,m_len); } + strncpy(&m_str[m_pos],s,n); + m_pos+=l; } } - const char *get() { return str; } - int getPos() const { return pos; } - void setPos(const int newPos) { pos = newPos; } - char at(int i) const { return str[i]; } + const char *get() { return m_str; } + uint getPos() const { return m_pos; } + void setPos(uint newPos) { m_pos = newPos; } + char at(uint i) const { return m_str[i]; } private: - char *str; - int pos; - int len; + char *m_str; + uint m_pos; + uint m_len; }; #endif diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index f220646..6e100fb 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -2461,7 +2461,7 @@ void HtmlDocVisitor::forceEndParagraph(DocNode *n) nodeIndex--; } if (nodeIndex<0) return; // first visible node in paragraph - DocNode *n = para->children().at(nodeIndex); + n = para->children().at(nodeIndex); if (mustBeOutsideParagraph(n)) return; // previous node already outside paragraph context nodeIndex--; bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,nodeIndex); @@ -2498,7 +2498,7 @@ void HtmlDocVisitor::forceStartParagraph(DocNode *n) } if (nodeIndexchildren().at(nodeIndex); + n = para->children().at(nodeIndex); if (mustBeOutsideParagraph(n)) return; // next element also outside paragraph } else diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 2dc62fa..0e3b146 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -166,8 +166,14 @@ static QCString getConvertLatexMacro() return ""; } i++; - if (!qstrncmp(data + i, "newcommand", strlen("newcommand"))) i += strlen("newcommand"); - else if (!qstrncmp(data + i, "renewcommand", strlen("renewcommand"))) i += strlen("renewcommand"); + if (!qstrncmp(data + i, "newcommand", (uint)strlen("newcommand"))) + { + i += (int)strlen("newcommand"); + } + else if (!qstrncmp(data + i, "renewcommand", (uint)strlen("renewcommand"))) + { + i += (int)strlen("renewcommand"); + } else { warn(macrofile,line, "file contains non valid code, expected 'newcommand' or 'renewcommand'"); @@ -402,7 +408,7 @@ static QCString removeEmptyLines(const QCString &s) return out.data(); } -static QCString substituteHtmlKeywords(const QCString &s, +static QCString substituteHtmlKeywords(const QCString &str, const QCString &title, const QCString &relPath, const QCString &navPath=QCString()) @@ -570,7 +576,7 @@ static QCString substituteHtmlKeywords(const QCString &s, } // first substitute generic keywords - QCString result = substituteKeywords(s,title, + QCString result = substituteKeywords(str,title, convertToHtml(Config_getString(PROJECT_NAME)), convertToHtml(Config_getString(PROJECT_NUMBER)), convertToHtml(Config_getString(PROJECT_BRIEF))); @@ -2687,7 +2693,6 @@ void HtmlGenerator::writeSearchPage() void HtmlGenerator::writeExternalSearchPage() { static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); - static bool disableIndex = Config_getBool(DISABLE_INDEX); QCString fileName = Config_getString(HTML_OUTPUT)+"/search"+Doxygen::htmlFileExtension; QFile f(fileName); if (f.open(IO_WriteOnly)) diff --git a/src/image.cpp b/src/image.cpp index afc67ef..2a8108b 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -207,7 +207,7 @@ static Color palette3[] = }; -Image::Image(int w,int h) +Image::Image(uint w,uint h) { static int hue = Config_getInt(HTML_COLORSTYLE_HUE); static int sat = Config_getInt(HTML_COLORSTYLE_SAT); @@ -236,49 +236,49 @@ Image::Image(int w,int h) palette[3].green = (int)(green2 * 255.0); palette[3].blue = (int)(blue2 * 255.0); - data = new uchar[w*h]; - memset(data,0,w*h); - width = w; - height = h; + m_data = new uchar[w*h]; + memset(m_data,0,w*h); + m_width = w; + m_height = h; } Image::~Image() { - delete[] data; + delete[] m_data; } -void Image::setPixel(int x,int y,uchar val) +void Image::setPixel(uint x,uint y,uchar val) { - if (x>=0 && x=0 && y=0 && x=0 && y=' ') { - int xf,yf,ci=c-' '; - int rowOffset=0; - int cw = charWidth[ci]; - int cp = charPos[ci]; + uint xf,yf,ci=c-' '; + uint rowOffset=0; + uint cw = charWidth[ci]; + uint cp = charPos[ci]; for (yf=0;yf>3); - int bitOffset = cp&7; + uint bitsLeft=cw; + uint byteOffset = rowOffset+(cp>>3); + uint bitOffset = cp&7; // get the bit pattern for row yf of the character from the font data while (bitsLeft>0) { - int bits=8-bitOffset; + uint bits=8-bitOffset; if (bits>bitsLeft) bits=bitsLeft; bitPattern<<=bits; bitPattern|=((fontRaw[byteOffset]<>(8-bits); @@ -286,7 +286,7 @@ void Image::writeChar(int x,int y,char c,uchar fg) bitOffset=0; byteOffset++; } - int mask=1<<(cw-1); + uint mask=1<<(cw-1); // draw character row yf for (xf=0;xf>1; + uint h=i>>1; drawVertLine(xe-i,y-h,y+h,colIndex,0xffffffff); } } -void Image::drawVertLine(int x,int ys,int ye,uchar colIndex,uint mask) +void Image::drawVertLine(uint x,uint ys,uint ye,uchar colIndex,uint mask) { - int y,i=0; + uint y,i=0; for (y=ys;y<=ye;y++,i++) { if (mask&(1<<(i&0x1f))) setPixel(x,y,colIndex); } } -void Image::drawVertArrow(int x,int ys,int ye,uchar colIndex,uint mask) +void Image::drawVertArrow(uint x,uint ys,uint ye,uchar colIndex,uint mask) { drawVertLine(x,ys,ye,colIndex,mask); - int i; + uint i; for (i=0;i<6;i++) { - int h=i>>1; + uint h=i>>1; drawHorzLine(ys+i,x-h,x+h,colIndex,0xffffffff); } } -void Image::drawRect(int x,int y,int w,int h,uchar colIndex,uint mask) +void Image::drawRect(uint x,uint y,uint w,uint h,uchar colIndex,uint mask) { drawHorzLine(y,x,x+w-1,colIndex,mask); drawHorzLine(y+h-1,x,x+w-1,colIndex,mask); @@ -371,44 +371,27 @@ void Image::drawRect(int x,int y,int w,int h,uchar colIndex,uint mask) drawVertLine(x+w-1,y,y+h-1,colIndex,mask); } -void Image::fillRect(int x,int y,int lwidth,int lheight,uchar colIndex,uint mask) +void Image::fillRect(uint x,uint y,uint width,uint height,uchar colIndex,uint mask) { - int xp,yp,xi,yi; - for (yp=y,yi=0;ypname().data() : ""); } - ClassDef *classDef() const { return m_class; } + const ClassDef *classDef() const { return m_class; } uint letter() const { return m_letter; } int row() const { return m_row; } int column() const { return m_col; } private: uint m_letter; - ClassDef *m_class; + const ClassDef *m_class; int m_row; int m_col; }; @@ -2190,7 +2190,7 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct row++; ClassListIterator cit(*cl); cit.toFirst(); - ClassDef *cd = cit.current(); + cd = cit.current(); ++cit; tableRows->append(new AlphaIndexTableCell(row,col,0,cd)); row++; @@ -4059,7 +4059,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* for (mi.toFirst();(md=mi.current());++mi) { const MemberList *enumList = md->enumFieldList(); - bool isDir = enumList!=0 && md->isEnumerate(); + isDir = enumList!=0 && md->isEnumerate(); if (md->isVisible() && !md->isAnonymous()) { Doxygen::indexList->addContentsItem(isDir, @@ -4162,7 +4162,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* { const SectionInfo *si=0; if (!pd->name().isEmpty()) si=SectionManager::instance().find(pd->name()); - bool hasSubPages = pd->hasSubPages(); + hasSubPages = pd->hasSubPages(); bool hasSections = pd->hasSections(); Doxygen::indexList->addContentsItem( hasSubPages || hasSections, @@ -4638,7 +4638,7 @@ static void writeIndex(OutputList &ol) ol.pushGeneratorState(); ol.disable(OutputGenerator::Latex); } - QCString title = pd->title(); + title = pd->title(); if (title.isEmpty()) title=pd->name(); ol.disable(OutputGenerator::Docbook); diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 392e839..1780c36 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -520,10 +520,10 @@ static void writeDefaultHeaderPart1(FTextStream &t) QFileInfo fi(fileName); if (fi.exists()) { - if (checkExtension(fi.fileName().data(), latexStyleExtension)) + if (checkExtension(fi.fileName().data(), LATEX_STYLE_EXTENSION)) { // strip the extension, it will be added by the usepackage in the tex conversion process - t << "\\usepackage{" << stripExtensionGeneral(fi.fileName().data(), latexStyleExtension) << "}\n"; + t << "\\usepackage{" << stripExtensionGeneral(fi.fileName().data(), LATEX_STYLE_EXTENSION) << "}\n"; } else { diff --git a/src/latexgen.h b/src/latexgen.h index 6bd1e17..2c32388 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -22,7 +22,7 @@ class QFile; -static const char *latexStyleExtension = ".sty"; +#define LATEX_STYLE_EXTENSION ".sty" class LatexCodeGenerator : public CodeOutputInterface { diff --git a/src/layout.cpp b/src/layout.cpp index 946b612..0f47f2a 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -1424,15 +1424,15 @@ class LayoutParser : public QXmlDefaultHandler } private: - LayoutParser() : m_sHandler(163), m_eHandler(17), m_invalidEntry(FALSE), m_part(0), m_rootNav(NULL) { } + LayoutParser() : m_sHandler(163), m_eHandler(17) { } ~LayoutParser() { delete m_rootNav; } QDict m_sHandler; QDict m_eHandler; QCString m_scope; - int m_part; - LayoutNavEntry *m_rootNav; - bool m_invalidEntry; + int m_part = 0; + LayoutNavEntry *m_rootNav = 0; + bool m_invalidEntry = false; static int m_userGroupCount; }; diff --git a/src/markdown.cpp b/src/markdown.cpp index b9b92c3..86da735 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -868,13 +868,11 @@ static int processLink(GrowBuf &out,const char *data,int,int size) } if (isToc) // special case for [TOC] { - int level = Config_getInt(TOC_INCLUDE_HEADINGS); - if (level > 0 && level <=5) + int toc_level = Config_getInt(TOC_INCLUDE_HEADINGS); + if (toc_level > 0 && toc_level <=5) { - char levStr[10]; - sprintf(levStr,"%d",level); out.addStr("@tableofcontents{html:"); - out.addStr(levStr); + out.addStr(QCString().setNum(toc_level)); out.addStr("}"); } } @@ -1802,7 +1800,7 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size) int rowNum = 1; while (iname()+args; else decl=type+" "+def->name()+args; + if (type.isEmpty()) decl=d->name()+args; else decl=type+" "+d->name()+args; memberGroup=0; virt=v; @@ -1503,7 +1503,7 @@ void MemberDefImpl::IMPL::init(Definition *def, // convert function declaration arguments (if any) if (!args.isEmpty()) { - stringToArgumentList(def->getLanguage(),args,declArgList,&extraTypeChars); + stringToArgumentList(d->getLanguage(),args,declArgList,&extraTypeChars); //printf("setDeclArgList %s to %s const=%d\n",args.data(), // argListToString(declArgList).data(),declArgList->constSpecifier); } @@ -1519,7 +1519,7 @@ void MemberDefImpl::IMPL::init(Definition *def, hasDocumentedParams = FALSE; hasDocumentedReturnType = FALSE; docProvider = 0; - isDMember = def->getDefFileName().right(2).lower()==".d"; + isDMember = d->getDefFileName().right(2).lower()==".d"; } @@ -2640,7 +2640,6 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, ol.writeDoc(rootNode,getOuterScope()?getOuterScope():d,this); if (detailsVisible) { - static bool separateMemberPages = Config_getBool(SEPARATE_MEMBER_PAGES); ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); //ol.endEmphasis(); @@ -3337,8 +3336,6 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml, { // if this member is in a group find the real scope name. bool hasParameterList = FALSE; - bool inFile = container->definitionType()==Definition::TypeFile; - bool hasDocs = isDetailedSectionVisible(inGroup,inFile); //printf("MemberDefImpl::writeDocumentation(): name='%s' hasDocs='%d' containerType=%d inGroup=%d sectionLinkable=%d\n", // name().data(),hasDocs,container->definitionType(),inGroup,isDetailedSectionLinkable()); @@ -3494,7 +3491,6 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml, if (!Config_getBool(HIDE_SCOPE_NAMES)) { bool first=TRUE; - SrcLangExt lang = getLanguage(); if (!m_impl->defTmpArgLists.empty() && lang==SrcLangExt_Cpp) // definition has explicit template parameter declarations { @@ -3567,9 +3563,9 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml, { ldef=ldef.left(dp+1); } - int l=ldef.length(); + int dl=ldef.length(); //printf("start >%s<\n",ldef.data()); - int i=l-1; + i=dl-1; while (i>=0 && (isId(ldef.at(i)) || ldef.at(i)==':')) i--; while (i>=0 && isspace((uchar)ldef.at(i))) i--; if (i>0) @@ -4490,7 +4486,7 @@ const MemberList *MemberDefImpl::getSectionList() const { const Definition *d= resolveAlias()->getOuterScope(); char key[20]; - sprintf(key,"%p",d); + sprintf(key,"%p",(void*)d); return (d!=0 && m_impl->classSectionSDict) ? m_impl->classSectionSDict->find(key) : 0; } @@ -4499,7 +4495,7 @@ void MemberDefImpl::setSectionList(MemberList *sl) //printf("MemberDefImpl::setSectionList(%p,%p) name=%s\n",d,sl,name().data()); const Definition *d= resolveAlias()->getOuterScope(); char key[20]; - sprintf(key,"%p",d); + sprintf(key,"%p",(void*)d); if (m_impl->classSectionSDict==0) { m_impl->classSectionSDict = new SDict(7); @@ -4594,7 +4590,7 @@ void MemberDefImpl::writeTagFile(FTextStream &tagFile) const { tagFile << " anchor()); - QCString idStr = fmd->id(); + idStr = fmd->id(); if (!idStr.isEmpty()) { tagFile << "\" clangid=\"" << convertToXML(idStr); diff --git a/src/membergroup.cpp b/src/membergroup.cpp index ee46ced..930426b 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -152,10 +152,10 @@ void MemberGroup::addGroupedInheritedMembers(OutputList &ol,const ClassDef *cd, const MemberList *ml = md->getSectionList(); if (ml && lt==ml->listType()) { - MemberList ml(lt); - ml.append(md); - ml.countDecMembers(); - ml.writePlainDeclarations(ol,cd,0,0,0,inheritedFrom,inheritId); + MemberList mml(lt); + mml.append(md); + mml.countDecMembers(); + mml.writePlainDeclarations(ol,cd,0,0,0,inheritedFrom,inheritId); } } } diff --git a/src/membergroup.h b/src/membergroup.h index dee998b..c1433cf 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -98,7 +98,6 @@ class MemberGroup bool inSameSection = 0; int m_numDecMembers = 0; int m_numDocMembers = 0; - const Definition *m_parent = 0; QCString m_docFile; int m_docLine = 0; std::vector m_xrefListItems; diff --git a/src/memberlist.cpp b/src/memberlist.cpp index edd164b..8a76a1d 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -419,7 +419,6 @@ void MemberList::writePlainDeclarations(OutputList &ol, ) const { //printf("----- writePlainDeclaration() ----\n"); - static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS); if (numDecMembers()==-1) { err("MemberList::numDecMembers()==-1, so the members of this list have not been counted. Please report as a bug.\n"); @@ -558,8 +557,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, // no variables of the anonymous compound type exist. if (cd) { - MemberListIterator mli(*this); - for ( ; (md=mli.current()) ; ++mli ) + for ( mli.toFirst(); (md=mli.current()) ; ++mli ) { if (md->fromAnonymousScope() && !md->anonymousDeclShown()) { diff --git a/src/memberlist.h b/src/memberlist.h index 422c162..4038453 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -131,7 +131,7 @@ class MemberListIterator : public QListIterator class MemberDict : public QDict { public: - MemberDict(int size) : QDict(size) {} + MemberDict(uint size) : QDict(size) {} virtual ~MemberDict() {} }; @@ -139,7 +139,7 @@ class MemberDict : public QDict class MemberSDict : public SDict { public: - MemberSDict(int size=17) : SDict(size) {} + MemberSDict(uint size=17) : SDict(size) {} virtual ~MemberSDict() {} private: int compareValues(const MemberDef *item1,const MemberDef *item2) const; diff --git a/src/membername.h b/src/membername.h index 143dca1..04ceda0 100644 --- a/src/membername.h +++ b/src/membername.h @@ -46,7 +46,7 @@ class MemberNameIterator : public QListIterator class MemberNameSDict : public SDict { public: - MemberNameSDict(int size) : SDict(size) {} + MemberNameSDict(uint size) : SDict(size) {} ~MemberNameSDict() {} private: @@ -92,7 +92,7 @@ class MemberNameInfoIterator : public QListIterator class MemberNameInfoSDict : public SDict { public: - MemberNameInfoSDict(int size) : SDict(size) {} + MemberNameInfoSDict(uint size) : SDict(size) {} ~MemberNameInfoSDict() {} private: int compareValues(const MemberNameInfo *item1,const MemberNameInfo *item2) const diff --git a/src/message.cpp b/src/message.cpp index 9a5eaca..dbbc6dd 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -174,7 +174,7 @@ static void do_warn(bool enabled, const char *file, int line, const char *prefix int l=0; if (prefix) { - l=strlen(prefix); + l=(int)strlen(prefix); } // determine needed buffersize based on: // format + arguments diff --git a/src/namespacedef.h b/src/namespacedef.h index 3be54f2..a35f0b1 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -146,7 +146,7 @@ class NamespaceListIterator : public QListIterator class NamespaceDict : public QDict { public: - NamespaceDict(int size) : QDict(size) {} + NamespaceDict(uint size) : QDict(size) {} ~NamespaceDict() {} }; @@ -154,7 +154,7 @@ class NamespaceDict : public QDict class NamespaceSDict : public SDict { public: - NamespaceSDict(int size=17) : SDict(size) {} + NamespaceSDict(uint size=17) : SDict(size) {} ~NamespaceSDict() {} void writeDeclaration(OutputList &ol,const char *title, bool isConstantGroup=false, bool localName=FALSE); diff --git a/src/outputgen.h b/src/outputgen.h index 2b4da98..009225f 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -150,7 +150,7 @@ class BaseOutputDocInterface : public CodeOutputInterface Examples }; - virtual void parseText(const QCString &s) {} + virtual void parseText(const QCString &) {} /*! Start of a bullet list: e.g. \c \ in html. startItemListItem() is * Used for the bullet items. @@ -447,8 +447,8 @@ class OutputGenerator : public BaseOutputDocInterface virtual void writeSummaryLink(const char *file,const char *anchor,const char *title,bool first) = 0; virtual void startContents() = 0; virtual void endContents() = 0; - virtual void startPageDoc(const char *pageTitle) {}; - virtual void endPageDoc() {}; + virtual void startPageDoc(const char *) {} + virtual void endPageDoc() {} virtual void startTextBlock(bool) = 0; virtual void endTextBlock(bool) = 0; virtual void lastIndexPage() = 0; diff --git a/src/pagedef.cpp b/src/pagedef.cpp index 3f96a4b..15d6ca8 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -47,7 +47,7 @@ class PageDefImpl : public DefinitionImpl, public PageDef virtual QCString title() const { return m_title; } virtual GroupDef * getGroupDef() const; virtual PageSDict * getSubPages() const { return m_subPageDict; } - virtual void addInnerCompound(Definition *d); + virtual void addInnerCompound(const Definition *d); virtual bool visibleInIndex() const; virtual bool documentedPage() const; virtual bool hasSubPages() const; @@ -121,10 +121,11 @@ void PageDefImpl::setFileName(const char *name) m_fileName = name; } -void PageDefImpl::addInnerCompound(Definition *def) +void PageDefImpl::addInnerCompound(const Definition *const_def) { - if (def->definitionType()==Definition::TypePage) + if (const_def->definitionType()==Definition::TypePage) { + Definition *def = const_cast(const_def); // uck: fix me PageDef *pd = dynamic_cast(def); m_subPageDict->append(pd->name(),pd); def->setOuterScope(this); diff --git a/src/pagedef.h b/src/pagedef.h index f0b68d1..e4d0268 100644 --- a/src/pagedef.h +++ b/src/pagedef.h @@ -46,22 +46,22 @@ class PageDef : virtual public Definition virtual QCString title() const = 0; virtual GroupDef * getGroupDef() const = 0; virtual PageSDict * getSubPages() const = 0; - virtual void addInnerCompound(Definition *d) = 0; + virtual void addInnerCompound(const Definition *) = 0; virtual bool visibleInIndex() const = 0; virtual bool documentedPage() const = 0; virtual bool hasSubPages() const = 0; virtual bool hasParentPage() const = 0; virtual bool hasTitle() const = 0; virtual LocalToc localToc() const = 0; - virtual void setPageScope(Definition *d) = 0; + virtual void setPageScope(Definition *) = 0; virtual Definition *getPageScope() const = 0; virtual QCString displayName(bool=TRUE) const = 0; virtual bool showLineNo() const = 0; - virtual void writeDocumentation(OutputList &ol) = 0; + virtual void writeDocumentation(OutputList &) = 0; virtual void writeTagFile(FTextStream &) = 0; - virtual void setNestingLevel(int l) = 0; - virtual void writePageDocumentation(OutputList &ol) = 0; + virtual void setNestingLevel(int) = 0; + virtual void writePageDocumentation(OutputList &) = 0; }; @@ -70,7 +70,7 @@ PageDef *createPageDef(const char *f,int l,const char *n,const char *d,const cha class PageSDict : public SDict { public: - PageSDict(int size) : SDict(size) {} + PageSDict(uint size) : SDict(size) {} virtual ~PageSDict() {} private: int compareValues(const PageDef *i1,const PageDef *i2) const diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index c19d7c4..0183cdc 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -92,7 +92,7 @@ void PerlModOutputStream::add(int n) if (m_t != 0) (*m_t) << n; else - m_s += n; + m_s += QCString().setNum(n); } void PerlModOutputStream::add(unsigned int n) @@ -100,7 +100,7 @@ void PerlModOutputStream::add(unsigned int n) if (m_t != 0) (*m_t) << n; else - m_s += n; + m_s += QCString().setNum(n); } class PerlModOutput @@ -779,7 +779,7 @@ void PerlModDocVisitor::visit(DocFormula *f) { openItem("formula"); QCString id; - id += f->id(); + id += QCString().setNum(f->id()); m_output.addFieldQuotedString("id", id).addFieldQuotedString("content", f->text()); closeItem(); } @@ -1761,9 +1761,9 @@ void PerlModGenerator::addListOfAllMembers(const ClassDef *cd) for (mii.toFirst();(mi=mii.current());++mii) { const MemberDef *md=mi->memberDef; - const ClassDef *cd=md->getClassDef(); + const ClassDef *mcd=md->getClassDef(); const Definition *d=md->getGroupDef(); - if (d==0) d = cd; + if (d==0) d = mcd; m_output.openHash() .addFieldQuotedString("name", md->name()) @@ -1773,7 +1773,7 @@ void PerlModGenerator::addListOfAllMembers(const ClassDef *cd) if (!mi->ambiguityResolutionScope.isEmpty()) m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); - m_output.addFieldQuotedString("scope", cd->name()) + m_output.addFieldQuotedString("scope", mcd->name()) .closeHash(); } } @@ -1871,10 +1871,10 @@ void PerlModGenerator::generatePerlModForClass(const ClassDef *cd) { m_output.openList("inner"); ClassSDict::Iterator cli(*cl); - const ClassDef *cd; - for (cli.toFirst();(cd=cli.current());++cli) + const ClassDef *icd; + for (cli.toFirst();(icd=cli.current());++cli) m_output.openHash() - .addFieldQuotedString("name", cd->name()) + .addFieldQuotedString("name", icd->name()) .closeHash(); m_output.closeList(); } @@ -1991,10 +1991,10 @@ void PerlModGenerator::generatePerlModForNamespace(const NamespaceDef *nd) { m_output.openList("namespaces"); NamespaceSDict::Iterator nli(*nl); - const NamespaceDef *nd; - for (nli.toFirst();(nd=nli.current());++nli) + const NamespaceDef *ind; + for (nli.toFirst();(ind=nli.current());++nli) m_output.openHash() - .addFieldQuotedString("name", nd->name()) + .addFieldQuotedString("name", ind->name()) .closeHash(); m_output.closeList(); } diff --git a/src/plantuml.cpp b/src/plantuml.cpp index 7d60e32..7995883 100644 --- a/src/plantuml.cpp +++ b/src/plantuml.cpp @@ -299,12 +299,12 @@ static void runPlantumlContent(const QDict< QList > &plantumlFiles, if (list) { QListIterator li(*list); - QCString *nb; - for (li.toFirst();(nb=li.current());++li) + QCString *str_p; + for (li.toFirst();(str_p=li.current());++li) { const int maxCmdLine = 40960; QCString epstopdfArgs(maxCmdLine); - epstopdfArgs.sprintf("\"%s%s.eps\" --outfile=\"%s%s.pdf\"",qPrint(pumlOutDir),qPrint(*nb),qPrint(pumlOutDir),qPrint(*nb)); + epstopdfArgs.sprintf("\"%s%s.eps\" --outfile=\"%s%s.pdf\"",qPrint(pumlOutDir),qPrint(*str_p),qPrint(pumlOutDir),qPrint(*str_p)); Portable::sysTimerStart(); if ((exitCode=Portable::system("epstopdf",epstopdfArgs))!=0) { diff --git a/src/portable.cpp b/src/portable.cpp index 8c941b6..d3799c7 100644 --- a/src/portable.cpp +++ b/src/portable.cpp @@ -207,11 +207,6 @@ unsigned int Portable::pid(void) return pid; } -#if defined(_WIN32) && !defined(__CYGWIN__) -#else - static char **last_environ; -#endif - #if !defined(_WIN32) || defined(__CYGWIN__) void loadEnvironment() { @@ -261,9 +256,6 @@ void Portable::unsetenv(const char *variable) SetEnvironmentVariable(variable,0); #else /* Some systems don't have unsetenv(), so we do it ourselves */ - size_t len; - char **ep; - if (variable == NULL || *variable == '\0' || strchr (variable, '=') != NULL) { return; // not properly formatted @@ -348,7 +340,7 @@ char Portable::pathListSeparator(void) #endif } -static const bool ExistsOnPath(const char *fileName) +static bool ExistsOnPath(const char *fileName) { QFileInfo fi1(fileName); if (fi1.exists()) return true; @@ -380,7 +372,7 @@ static const bool ExistsOnPath(const char *fileName) return false; } -const bool Portable::checkForExecutable(const char *fileName) +bool Portable::checkForExecutable(const char *fileName) { #if defined(_WIN32) && !defined(__CYGWIN__) char *extensions[] = {".bat",".com",".exe"}; diff --git a/src/portable.h b/src/portable.h index 6c215a8..bf6cfea 100644 --- a/src/portable.h +++ b/src/portable.h @@ -44,7 +44,7 @@ namespace Portable void setShortDir(void); const char * strnstr(const char *haystack, const char *needle, size_t haystack_len); const char * devNull(); - const bool checkForExecutable(const char *fileName); + bool checkForExecutable(const char *fileName); } diff --git a/src/pre.l b/src/pre.l index fbf7bde..97d4395 100644 --- a/src/pre.l +++ b/src/pre.l @@ -63,11 +63,15 @@ #define YY_NO_UNISTD_H 1 +#define USE_STATE2STRING 0 + // Toggle for some debugging info //#define DBG_CTX(x) fprintf x #define DBG_CTX(x) do { } while(0) +#if USE_STATE2STRING static const char *stateToString(int state); +#endif struct CondCtx { @@ -86,7 +90,7 @@ struct FileState int curlyCount; BufStr fileBuf; BufStr *oldFileBuf; - int oldFileBufPos; + yy_size_t oldFileBufPos; YY_BUFFER_STATE bufState; QCString fileName; }; @@ -350,9 +354,9 @@ struct preYY_state int level; int lastCContext; int lastCPPContext; - QArray levelGuard; + QArray levelGuard; BufStr *inputBuf = 0; - int inputBufPos; + yy_size_t inputBufPos; BufStr *outputBuf = 0; int roundCount; bool quoteArg; @@ -378,7 +382,7 @@ struct preYY_state bool insideCS; // C# has simpler preprocessor bool isSource; - int fenceSize = 0; + yy_size_t fenceSize = 0; bool ccomment; QCString delimiter; QDict allIncludes; @@ -407,7 +411,7 @@ static void endCondSection(yyscan_t yyscanner); static void addDefine(yyscan_t yyscanner); static Define * newDefine(yyscan_t yyscanner); static void setFileName(yyscan_t yyscanner,const char *name); -static int yyread(yyscan_t yyscanner,char *buf,int max_size); +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size); /* ----------------------------------------------------------------- */ @@ -475,7 +479,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) <*>"??"[=/'()!<>-] { // Trigraph unput(resolveTrigraph(yytext[2])); } -^{B}*"#" { BEGIN(Command); yyextra->yyColNr+=yyleng; yyextra->yyMLines=0;} +^{B}*"#" { BEGIN(Command); yyextra->yyColNr+=(int)yyleng; yyextra->yyMLines=0;} ^{B}*/[^#] { outputArray(yyscanner,yytext,(int)yyleng); BEGIN(CopyLine); @@ -795,7 +799,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } ("cmake")?"define"{B}+ { //printf("!!!DefName\n"); - yyextra->yyColNr+=yyleng; + yyextra->yyColNr+=(int)yyleng; BEGIN(DefName); } "ifdef"/{B}*"(" { @@ -879,7 +883,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) yyextra->yyLineNr++; } . -. {yyextra->yyColNr+=yyleng;} +. {yyextra->yyColNr+=(int)yyleng;} {ID} { Define *def; if ((def=yyextra->defineManager.isDefined(yytext)) @@ -1392,14 +1396,14 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } ^({B}*"*"+)?{B}{0,3}"~~~"[~]* { outputArray(yyscanner,yytext,(int)yyleng); - if (yyextra->fenceSize==yyleng) + if (yyextra->fenceSize==(yy_size_t)yyleng) { BEGIN(SkipCComment); } } ^({B}*"*"+)?{B}{0,3}"```"[`]* { outputArray(yyscanner,yytext,(int)yyleng); - if (yyextra->fenceSize==yyleng) + if (yyextra->fenceSize==(yy_size_t)yyleng) { BEGIN(SkipCComment); } @@ -1631,7 +1635,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) //preYYin = fs->oldYYin; yyextra->inputBuf = fs->oldFileBuf; yyextra->inputBufPos = fs->oldFileBufPos; - yyextra->curlyCount = fs->curlyCount; + yyextra->curlyCount = fs->curlyCount; setFileName(yyscanner,fs->fileName); DBG_CTX((stderr,"######## FileName %s\n",yyextra->yyFileName.data())); @@ -1685,11 +1689,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ///////////////////////////////////////////////////////////////////////////////////// -static int yyread(yyscan_t yyscanner,char *buf,int max_size) +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size) { YY_EXTRA_TYPE state = preYYget_extra(yyscanner); - int bytesInBuf = state->inputBuf->curPos()-state->inputBufPos; - int bytesToCopy = QMIN(max_size,bytesInBuf); + yy_size_t bytesInBuf = state->inputBuf->curPos()-state->inputBufPos; + yy_size_t bytesToCopy = QMIN(max_size,bytesInBuf); memcpy(buf,state->inputBuf->data()+state->inputBufPos,bytesToCopy); state->inputBufPos+=bytesToCopy; return bytesToCopy; @@ -1890,7 +1894,7 @@ static FileState *findFile(yyscan_t yyscanner, const char *fileName,bool localIn static QCString extractTrailingComment(const char *s) { if (s==0) return ""; - int i=strlen(s)-1; + int i=(int)strlen(s)-1; while (i>=0) { char c=s[i]; @@ -1992,7 +1996,7 @@ static QCString stringize(const QCString &s) pc=0; while (i search for matching ) { - int level=1; + int lvl=1; arg+=c; //char term='\0'; while ((cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0) { - char c=(char)cc; + c=(char)cc; //printf("processing %c: term=%c (%d)\n",c,term,term); if (c=='\'' || c=='\"') // skip ('s and )'s inside strings { @@ -2128,13 +2132,13 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin } if (c==')') { - level--; + lvl--; arg+=c; - if (level==0) break; + if (lvl==0) break; } else if (c=='(') { - level++; + lvl++; arg+=c; } else @@ -2671,7 +2675,7 @@ static QCString removeIdsAndMarkers(const char *s) { nextChar: result+=c; - char lc=tolower(c); + char lc=(char)tolower(c); if (!isId(lc) && lc!='.' /*&& lc!='-' && lc!='+'*/) inNum=FALSE; p++; } @@ -2924,23 +2928,23 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc) else if (searchIncludes) // search in INCLUDE_PATH as well { QStrList &includePath = Config_getList(INCLUDE_PATH); - char *s=includePath.first(); - while (s) + char *incPath=includePath.first(); + while (incPath) { - QFileInfo fi(s); - if (fi.exists() && fi.isDir()) + QFileInfo fi3(incPath); + if (fi3.exists() && fi3.isDir()) { - QCString absName = QCString(fi.absFilePath().utf8())+"/"+incFileName; + absName = QCString(fi3.absFilePath().utf8())+"/"+incFileName; //printf("trying absName=%s\n",absName.data()); - QFileInfo fi2(absName); - if (fi2.exists()) + QFileInfo fi4(absName); + if (fi4.exists()) { - absIncFileName=fi2.absFilePath().utf8(); + absIncFileName=fi4.absFilePath().utf8(); break; } //printf( "absIncFileName = %s\n", absIncFileName.data() ); } - s=includePath.next(); + incPath=includePath.next(); } } //printf( "absIncFileName = %s\n", absIncFileName.data() ); @@ -3170,8 +3174,7 @@ static int getCurrentChar(yyscan_t yyscanner,const QCString &expr,QCString *rest else { int cc=yyinput(yyscanner); - returnCharToStream(yyscanner,cc); - //unput((char)cc); + returnCharToStream(yyscanner,(char)cc); //printf("%c=yyinput()\n",cc); return cc; } @@ -3297,14 +3300,14 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output QRegExp reId("[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*"); // regexp matching an id QDict argDict(17); argDict.setAutoDelete(TRUE); - int i=i_obrace+1,p,l,count=0; + int i=i_obrace+1,pi,l,count=0; // gather the formal arguments in a dictionary - while (i0) // see bug375037 { - argDict.insert(ds.mid(p,l),new int(count++)); - i=p+l; + argDict.insert(ds.mid(pi,l),new int(count++)); + i=pi+l; } else { @@ -3317,11 +3320,11 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output i=0; // substitute all occurrences of formal arguments by their // corresponding markers - while ((p=reId.match(tmp,i,&l))!=-1) + while ((pi=reId.match(tmp,i,&l))!=-1) { - if (p>i) definition+=tmp.mid(i,p-i); + if (pi>i) definition+=tmp.mid(i,pi-i); int *argIndex; - if ((argIndex=argDict[tmp.mid(p,l)])!=0) + if ((argIndex=argDict[tmp.mid(pi,l)])!=0) { QCString marker; marker.sprintf(" @%d ",*argIndex); @@ -3329,9 +3332,9 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output } else { - definition+=tmp.mid(p,l); + definition+=tmp.mid(pi,l); } - i=p+l; + i=pi+l; } if (i<(int)tmp.length()) definition+=tmp.mid(i,tmp.length()-i); @@ -3466,5 +3469,6 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output printlex(yy_flex_debug, FALSE, __FILE__, fileName); } - +#if USE_STATE2STRING #include "pre.l.h" +#endif diff --git a/src/pycode.l b/src/pycode.l index 9dee2e8..8cb85a3 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -23,6 +23,7 @@ %option never-interactive %option prefix="pycodeYY" +%option noyy_top_state %top{ #include } @@ -56,6 +57,8 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 +#define USE_STATE2STRING 0 + static ClassSDict g_codeClassSDict(17); static QCString g_curClassName; static QStrList g_curClassBases; @@ -100,7 +103,10 @@ static bool g_endComment; static void endFontClass(); static void adjustScopesAndSuites(unsigned indentLength); + +#if USE_STATE2STRING static const char *stateToString(int state); +#endif /*! Represents a stack of variable to class mappings as found in the @@ -688,19 +694,19 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, DBG_CTX((stderr,"scope=%s locName=%s mcd=%p\n",scope.data(),locName.data(),mcd)); if (mcd) { - MemberDef *md = mcd->getMemberByName(locName); - if (md) + MemberDef *mmd = mcd->getMemberByName(locName); + if (mmd) { - g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); - writeMultiLineCodeLink(ol,md,clName); + g_theCallContext.setClass(stripClassName(mmd->typeString(),mmd->getOuterScope())); + writeMultiLineCodeLink(ol,mmd,clName); addToSearchIndex(className); - const Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); - if (md->getGroupDef()) d = md->getGroupDef(); - if (d && d->isLinkable() && md->isLinkable() && + const Definition *d = mmd->getOuterScope()==Doxygen::globalScope ? + mmd->getBodyDef() : mmd->getOuterScope(); + if (mmd->getGroupDef()) d = mmd->getGroupDef(); + if (d && d->isLinkable() && mmd->isLinkable() && g_currentMemberDef && g_collectXRefs) { - addDocCrossReference(g_currentMemberDef,md); + addDocCrossReference(g_currentMemberDef,mmd); } return; } @@ -710,20 +716,20 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, const NamespaceDef *mnd = getResolvedNamespace(scope); if (mnd) { - MemberDef *md=mnd->getMemberByName(locName); - if (md) + MemberDef *mmd=mnd->getMemberByName(locName); + if (mmd) { //printf("name=%s scope=%s\n",locName.data(),scope.data()); - g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); - writeMultiLineCodeLink(ol,md,clName); + g_theCallContext.setClass(stripClassName(mmd->typeString(),mmd->getOuterScope())); + writeMultiLineCodeLink(ol,mmd,clName); addToSearchIndex(className); - const Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); - if (md->getGroupDef()) d = md->getGroupDef(); - if (d && d->isLinkable() && md->isLinkable() && + const Definition *d = mmd->getOuterScope()==Doxygen::globalScope ? + mmd->getBodyDef() : mmd->getOuterScope(); + if (mmd->getGroupDef()) d = mmd->getGroupDef(); + if (d && d->isLinkable() && mmd->isLinkable() && g_currentMemberDef && g_collectXRefs) { - addDocCrossReference(g_currentMemberDef,md); + addDocCrossReference(g_currentMemberDef,mmd); } return; } @@ -846,9 +852,9 @@ static void findMemberLink(CodeOutputInterface &ol,char *symName) #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); -static int yyread(char *buf,int max_size) +static yy_size_t yyread(char *buf,yy_size_t max_size) { - int c=0; + yy_size_t c=0; while( c < max_size && g_inputString[g_inputPosition] ) { *buf = g_inputString[g_inputPosition++] ; @@ -1269,7 +1275,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT // level that is about to be // used. codifyLines(yytext); - g_indents.push(yyleng); + g_indents.push(static_cast(yyleng)); // printf("Captured indent of %d [line %d]\n", yyleng, g_yyLineNr); BEGIN( Suite ); } @@ -1283,7 +1289,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT // should be improved. // (translate tabs to space, etc) codifyLines(yytext); - adjustScopesAndSuites((int)yyleng); + adjustScopesAndSuites(static_cast(yyleng)); } "\n"|({BB}"\n") { @@ -1669,5 +1675,6 @@ void PythonCodeParser::resetCodeParserState() ::resetPythonCodeParserState(); } - +#if USE_STATE2STRING #include "pycode.l.h" +#endif diff --git a/src/pyscanner.l b/src/pyscanner.l index 0abaae1..15e1040 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -64,6 +64,8 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 +#define USE_STATE2STRING 0 + /* ----------------------------------------------------------------- */ struct pyscannerYY_state @@ -72,7 +74,7 @@ struct pyscannerYY_state CommentScanner commentScanner; OutlineParserInterface *thisParser = 0; const char * inputString = 0; - int inputPosition = 0; + yy_size_t inputPosition = 0; Protection protection = Public; std::shared_ptr current_root; std::shared_ptr current; @@ -113,7 +115,9 @@ struct pyscannerYY_state }; //----------------------------------------------------------------------------- +#if USE_STATE2STRING static const char *stateToString(int state); +#endif static inline int computeIndent(const char *s); @@ -136,7 +140,8 @@ static void initSpecialBlock(yyscan_t yyscanner); static void searchFoundDef(yyscan_t yyscanner); static void searchFoundClass(yyscan_t yyscanner); static QCString findPackageScope(yyscan_t yyscanner,const char *fileName); -static int yyread(yyscan_t yyscanner,char *buf,int max_size); + +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size); //----------------------------------------------------------------------------- /* ----------------------------------------------------------------- */ @@ -1437,10 +1442,10 @@ STARTDOCSYMS "##" //---------------------------------------------------------------------------- -static int yyread(yyscan_t yyscanner,char *buf,int max_size) +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; - int c=0; + yy_size_t c=0; const char *p = yyextra->inputString + yyextra->inputPosition; while ( c < max_size && *p ) { *buf++ = *p++; c++; } yyextra->inputPosition+=c; @@ -1740,7 +1745,7 @@ static void parseCompounds(yyscan_t yyscanner,std::shared_ptr rt) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; //printf("parseCompounds(%s)\n",rt->name.data()); - for (int i=0; ichildren().size(); ++i) + for (size_t i=0; ichildren().size(); ++i) { std::shared_ptr ce = rt->children()[i]; if (!ce->program.isEmpty()) @@ -1865,7 +1870,7 @@ static void parsePrototype(yyscan_t yyscanner,const QCString &text) yyextra->packageCommentAllowed = FALSE; const char *orgInputString; - int orgInputPosition; + yy_size_t orgInputPosition; YY_BUFFER_STATE orgState; // save scanner state @@ -1951,4 +1956,6 @@ void PythonOutlineParser::parsePrototype(const char *text) //---------------------------------------------------------------------------- +#if USE_STATE2STRING #include "pyscanner.l.h" +#endif diff --git a/src/resourcemgr.cpp b/src/resourcemgr.cpp index 8cb831e..0f79c04 100644 --- a/src/resourcemgr.cpp +++ b/src/resourcemgr.cpp @@ -97,14 +97,14 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch { QCString n = name; n = n.left(n.length()-4)+".png"; // replace .lum by .png - uchar *p = (uchar*)res->data; - int width = (p[0]<<8)+p[1]; - int height = (p[2]<<8)+p[3]; + uchar *data = (uchar*)res->data; + ushort width = (data[0]<<8)+data[1]; + ushort height = (data[2]<<8)+data[3]; ColoredImgDataItem images[2]; images[0].name = n; images[0].width = width; images[0].height = height; - images[0].content = &p[4]; + images[0].content = &data[4]; images[0].alpha = 0; images[1].name = 0; // terminator writeColoredImgData(targetDir,images); @@ -115,15 +115,15 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch { QCString n = name; n = n.left(n.length()-5)+".png"; // replace .luma by .png - uchar *p = (uchar*)res->data; - int width = (p[0]<<8)+p[1]; - int height = (p[2]<<8)+p[3]; + uchar *data = (uchar*)res->data; + ushort width = (data[0]<<8)+data[1]; + ushort height = (data[2]<<8)+data[3]; ColoredImgDataItem images[2]; images[0].name = n; images[0].width = width; images[0].height = height; - images[0].content = &p[4]; - images[0].alpha = &p[4+width*height]; + images[0].content = &data[4]; + images[0].alpha = &data[4+width*height]; images[1].name = 0; // terminator writeColoredImgData(targetDir,images); return TRUE; diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 39741dc..221b44c 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -273,15 +273,14 @@ void RTFGenerator::beginRTFDocument() // sort styles ascending by \s-number via an intermediate QArray QDictIterator iter(rtf_Style); - const StyleData* style; + const StyleData* style = 0; unsigned maxIndex = 0; for(; (style = iter.current()); ++iter) { unsigned index = style->index; if (maxIndex < index) maxIndex = index; } - QArray array(maxIndex + 1); - array.fill(0); + std::vector array(maxIndex + 1, 0); ASSERT(maxIndex < array.size()); iter.toFirst(); @@ -297,10 +296,10 @@ void RTFGenerator::beginRTFDocument() } // write array elements - unsigned size = array.size(); - for(unsigned i = 0; i < size; i++) + size_t size = array.size(); + for(size_t i = 0; i < size; i++) { - const StyleData* style = array.at(i); + style = array.at(i); if (style != 0) t <<"{" << style->reference << style->definition << ";}\n"; } @@ -2463,7 +2462,7 @@ static bool preProcessFile(QDir &d,QCString &infName, FTextStream &t, bool bIncl { // null terminate at the last '}' //char *str = strrchr(buffer,'}'); - int pos = lineBuf.findRev('}'); + pos = lineBuf.findRev('}'); if (pos != -1) lineBuf.at(pos) = '\0'; diff --git a/src/rtfstyle.cpp b/src/rtfstyle.cpp index 47a8166..163d5b8 100644 --- a/src/rtfstyle.cpp +++ b/src/rtfstyle.cpp @@ -228,17 +228,20 @@ const QRegExp StyleData::s_clause("\\\\s[0-9]+\\s*"); StyleData::StyleData(const char* reference, const char* definition) { - int start = s_clause.match(reference); ASSERT(start >= 0); - reference += start; - index = (int)atol(reference + 2); ASSERT(index > 0); + const char *ref = reference; + const char *def = definition; - ASSERT(reference != 0); - size_t size = 1 + strlen(reference); - memcpy(this->reference = new char[size], reference, size); + int start = s_clause.match(ref); ASSERT(start >= 0); + ref += start; + index = (int)atol(ref + 2); ASSERT(index > 0); - ASSERT(definition != 0); - size = 1 + strlen(definition); - memcpy(this->definition = new char[size], definition, size); + ASSERT(ref != 0); + size_t size = 1 + strlen(ref); + memcpy(this->reference = new char[size], ref, size); + + ASSERT(def != 0); + size = 1 + strlen(def); + memcpy(this->definition = new char[size], def, size); } StyleData::~StyleData() diff --git a/src/scanner.l b/src/scanner.l index 2342795..479b18a 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -59,6 +59,8 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 +#define USE_STATE2STRING 0 + struct scannerYY_state { OutlineParserInterface *thisParser; @@ -190,12 +192,14 @@ struct scannerYY_state int column = 0; - int fencedSize = 0; + uint fencedSize = 0; bool nestedComment = false; std::vector< std::pair > > outerScopeEntries; }; +#if USE_STATE2STRING static const char *stateToString(int state); +#endif //----------------------------------------------------------------------------- // forward declarations for stateless functions @@ -218,7 +222,7 @@ static bool checkForKnRstyleC(yyscan_t yyscanner); static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &oldStyleArgName); static void addKnRArgInfo(yyscan_t yyscanner,const QCString &type,const QCString &name, const QCString &brief,const QCString &docs); -static int yyread(yyscan_t yyscanner,char *buf,int max_size); +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size); /* ----------------------------------------------------------------- */ @@ -6594,10 +6598,10 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) %% //---------------------------------------------------------------------------- -static int yyread(yyscan_t yyscanner,char *buf,int max_size) +static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; - int c=0; + yy_size_t c=0; while( c < max_size && yyextra->inputString[yyextra->inputPosition] ) { *buf = yyextra->inputString[yyextra->inputPosition++] ; @@ -6830,7 +6834,6 @@ static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &ol else // normal "int *var" { int l=si,i=l-1,j; - char c; // look for start of name in "type *name" while (i>=0 && isId(yyextra->current->args.at(i))) i--; j=i+1; @@ -7405,4 +7408,6 @@ void COutlineParser::parsePrototype(const char *text) //---------------------------------------------------------------------------- +#if USE_STATE2STRING #include "scanner.l.h" +#endif diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 329b123..e090717 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -394,8 +394,6 @@ void SearchIndex::write(const char *fileName) } } // write urls - QIntDictIterator udi(m_urls); - URL *url; for (udi.toFirst();(url=udi.current());++udi) { writeString(f,url->name); @@ -833,9 +831,9 @@ void createJavaScriptSearchIndex() } // index files - FileNameListIterator fnli(*Doxygen::inputNameList); + FileNameListIterator inli(*Doxygen::inputNameList); FileName *fn; - for (;(fn=fnli.current());++fnli) + for (;(fn=inli.current());++inli) { FileNameIterator fni(*fn); FileDef *fd; diff --git a/src/section.h b/src/section.h index 9bdfb3b..9f1916e 100644 --- a/src/section.h +++ b/src/section.h @@ -115,7 +115,7 @@ class SectionRefs const_iterator begin() const { return m_entries.cbegin(); } const_iterator end() const { return m_entries.cend(); } bool empty() const { return m_entries.empty(); } - int size() const { return m_entries.size(); } + int size() const { return (int)m_entries.size(); } private: SectionInfoVec m_entries; diff --git a/src/sortdict.h b/src/sortdict.h index 203ae5e..15282ec 100644 --- a/src/sortdict.h +++ b/src/sortdict.h @@ -99,7 +99,7 @@ class SDict private: SList *m_list; QDict *m_dict; - int m_sizeIndex; + uint m_sizeIndex; public: /*! Create an ordered dictionary. @@ -108,7 +108,7 @@ class SDict * \param caseSensitive indicated whether the keys should be sorted * in a case sensitive way. */ - SDict(int size=17,bool caseSensitive=TRUE) : m_sizeIndex(0) + SDict(uint size=17,bool caseSensitive=TRUE) : m_sizeIndex(0) { m_list = new SList(this); #if AUTORESIZE @@ -277,7 +277,7 @@ class SDict /*! Returns the number of items stored in the dictionary */ - int count() const + uint count() const { return m_list->count(); } diff --git a/src/sqlcode.l b/src/sqlcode.l index e73fe4c..58a2fce 100644 --- a/src/sqlcode.l +++ b/src/sqlcode.l @@ -44,6 +44,8 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 +#define USE_STATE2STRING 0 + struct sqlcodeYY_state { CodeOutputInterface * code; @@ -65,8 +67,10 @@ struct sqlcodeYY_state const char *currentFontClass; }; -static void codify(const char* text); +#if USE_STATE2STRING static const char *stateToString(int state); +#endif + static void setCurrentDoc(const QCString &anchor,yyscan_t yyscanner); static void startCodeLine(yyscan_t yyscanner); static void endFontClass(yyscan_t yyscanner); @@ -75,7 +79,7 @@ static void nextCodeLine(yyscan_t yyscanner); static void codifyLines(char *text,yyscan_t yyscanner); static void startFontClass(const char *s,yyscan_t yyscanner); static int countLines(yyscan_t yyscanner); -static int yyread(char *buf,int max_size,yyscan_t yyscanner); +static yy_size_t yyread(char *buf,yy_size_t max_size,yyscan_t yyscanner); #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size,yyscanner); @@ -193,12 +197,6 @@ commentclose "\*/" %% -static void codify(const char* text, yyscan_t yyscanner) -{ - struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; - yyextra->code->codify(text); -} - static void setCurrentDoc(const QCString &anchor, yyscan_t yyscanner) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; @@ -348,10 +346,10 @@ static int countLines(yyscan_t yyscanner) return count; } -static int yyread(char *buf,int max_size,yyscan_t yyscanner) +static yy_size_t yyread(char *buf,yy_size_t max_size,yyscan_t yyscanner) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; - int c=0; + yy_size_t c=0; while( c < max_size && yyextra->inputString[yyextra->inputPosition] ) { *buf = yyextra->inputString[yyextra->inputPosition++] ; @@ -487,4 +485,6 @@ void SQLCodeParser::resetCodeParserState() //--------------------------------------------------------------------------------- +#if USE_STATE2STRING #include "sqlcode.l.h" +#endif diff --git a/src/tclscanner.l b/src/tclscanner.l index 7f776ca..10aba97 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -63,7 +63,11 @@ #define MAX_INCLUDE_DEPTH 10 +#define USE_STATE2STRING 0 + +#if USE_STATE2STRING static const char *stateToString(int state); +#endif //! Application error. #define tcl_err \ @@ -470,7 +474,7 @@ struct tcl_struct static tcl_struct tcl; // scanner functions -static int yyread(char *buf,int max_size); +static yy_size_t yyread(char *buf,yy_size_t max_size); static tcl_scan *tcl_scan_start(char type, QCString content, QCString ns, Entry *entry_cls, Entry *entry_fn); static void tcl_scan_end(); static void tcl_comment(int what,const char *text); @@ -1952,25 +1956,25 @@ D // handle leading whitespace/opening brace/double quotes if (elem - token > 0) { - myScan = tcl_codify_token(myScan, "NULL", token.left(elem - token)); + myScan = tcl_codify_token(myScan, "NULL", token.left((uint)(elem - token))); } // handle actual element without braces/double quotes if (nextIsPattern) { - myScan = tcl_codify_token(myScan, "NULL", token.mid(elem - token,size)); + myScan = tcl_codify_token(myScan, "NULL", token.mid((uint)(elem - token),size)); //printf("pattern=%s\n",(const char*) token.mid(elem - token, size)); } else { - myScan = tcl_codify_token(myScan, "script", token.mid(elem - token, size)); + myScan = tcl_codify_token(myScan, "script", token.mid((uint)(elem - token), size)); //printf("script =%s\n", (const char*) token.mid(elem - token, size)); } // handle trailing whitespace/closing brace/double quotes if (next - elem - size > 0) { - myScan = tcl_codify_token(myScan, "NULL", token.mid(elem - token + size, next - elem - size)); + myScan = tcl_codify_token(myScan, "NULL", token.mid((uint)(elem - token + size), (uint)(next - elem - size))); } nextIsPattern = !nextIsPattern; - token = token.mid(next - token); + token = token.mid((int)(next - token)); } if (inBraces) { @@ -2783,7 +2787,7 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN? char myState='x';// last word: e'x'pr 't'hen 'b'ody 'e'lse else'i'f.. for (unsigned int i = 4; i < tcl.list_commandwords.count(); i = i + 2) { - QCString myStr=(*tcl.list_commandwords.at(i)); + myStr=(*tcl.list_commandwords.at(i)); if (myState=='x') { if (myStr=="then") @@ -3014,9 +3018,9 @@ void TclOutlineParser::parsePrototype(const char *text) (void)text; } -static int yyread(char *buf,int max_size) +static yy_size_t yyread(char *buf,yy_size_t max_size) { - int c=0; + yy_size_t c=0; *buf = '\0'; while ( c < max_size && tcl.input_string.at(tcl.input_position) ) @@ -3147,4 +3151,6 @@ void tclDummy() yy_top_state(); } +#if USE_STATE2STRING #include "tclscanner.l.h" +#endif diff --git a/src/template.cpp b/src/template.cpp index ca28c73..1763eec 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -336,7 +336,7 @@ int TemplateList::release() return count; } -int TemplateList::count() const +uint TemplateList::count() const { return p->elems.count(); } @@ -406,9 +406,9 @@ TemplateListIntf::ConstIterator *TemplateList::createIterator() const return new TemplateListConstIterator(*this); } -TemplateVariant TemplateList::at(int index) const +TemplateVariant TemplateList::at(uint index) const { - if (index>=0 && index<(int)p->elems.count()) + if (indexelems.count()) { return p->elems[index]; } @@ -780,7 +780,7 @@ class FilterLength } if (v.type()==TemplateVariant::List) { - return TemplateVariant(v.toList()->count()); + return TemplateVariant((int)v.toList()->count()); } else if (v.type()==TemplateVariant::String) { @@ -1125,7 +1125,7 @@ class FilterAlphaIndex { int i=0; if (startLetter>='0' && startLetter<='9') s[i++] = 'x'; - s[i++]=tolower((char)startLetter); + s[i++]=(char)tolower((char)startLetter); s[i++]=0; } else @@ -2268,7 +2268,6 @@ class ExpressionParser if (p==q) // still no valid token found -> error { m_curToken.type = ExprToken::Unknown; - char s[2]; s[0]=c; s[1]=0; warn(m_parser->templateName(),m_line,"Found unknown token '%s' (%d) while parsing %s",s,c,m_tokenStream); @@ -2877,19 +2876,21 @@ class TemplateNodeIf : public TemplateNodeCreator stopAt.append("else"); // if 'nodes' - GuardedNodes *guardedNodes = new GuardedNodes; - ExpressionParser ex(parser,line); - guardedNodes->line = line; - guardedNodes->guardAst = ex.parse(data); - parser->parse(this,line,stopAt,guardedNodes->trueNodes); - m_ifGuardedNodes.append(guardedNodes); + { + GuardedNodes *guardedNodes = new GuardedNodes; + ExpressionParser ex(parser,line); + guardedNodes->line = line; + guardedNodes->guardAst = ex.parse(data); + parser->parse(this,line,stopAt,guardedNodes->trueNodes); + m_ifGuardedNodes.append(guardedNodes); + } TemplateToken *tok = parser->takeNextToken(); // elif 'nodes' while (tok && tok->data.left(5)=="elif ") { ExpressionParser ex(parser,line); - guardedNodes = new GuardedNodes; + GuardedNodes *guardedNodes = new GuardedNodes; guardedNodes->line = tok->line; guardedNodes->guardAst = ex.parse(tok->data.mid(5)); parser->parse(this,tok->line,stopAt,guardedNodes->trueNodes); @@ -3119,15 +3120,15 @@ class TemplateNodeRange : public TemplateNodeCreator while (!done) { // set the forloop meta-data variable - TemplateAutoRef s(TemplateStruct::alloc()); - s->set("counter0", (int)index); - s->set("counter", (int)(index+1)); - s->set("revcounter", (int)(l-index)); - s->set("revcounter0", (int)(l-index-1)); - s->set("first",index==0); - s->set("last", (int)index==l-1); - s->set("parentloop",parentLoop ? *parentLoop : TemplateVariant()); - c->set("forloop",s.get()); + TemplateAutoRef ls(TemplateStruct::alloc()); + ls->set("counter0", (int)index); + ls->set("counter", (int)(index+1)); + ls->set("revcounter", (int)(l-index)); + ls->set("revcounter0", (int)(l-index-1)); + ls->set("first",index==0); + ls->set("last", (int)index==l-1); + ls->set("parentloop",parentLoop ? *parentLoop : TemplateVariant()); + c->set("forloop",ls.get()); // set the iterator variable c->set(m_var,i); @@ -3278,7 +3279,7 @@ class TemplateNodeFor : public TemplateNodeCreator } c->push(); //int index = m_reversed ? list.count() : 0; - TemplateVariant v; + //TemplateVariant v; const TemplateVariant *parentLoop = c->getRef("forloop"); uint index = m_reversed ? listSize-1 : 0; TemplateListIntf::ConstIterator *it = list->createIterator(); @@ -3622,7 +3623,6 @@ class TemplateNodeCreate : public TemplateNodeCreator : TemplateNodeCreator(parser,parent,line), m_templateExpr(0), m_fileExpr(0) { TRACE(("TemplateNodeCreate(%s)\n",data.data())); - ExpressionParser ep(parser,line); if (data.isEmpty()) { parser->warn(m_templateName,line,"create tag is missing arguments"); @@ -4979,7 +4979,7 @@ TemplateToken *TemplateParser::takeNextToken() const TemplateToken *TemplateParser::currentToken() const { return m_tokens.getFirst(); -}; +} void TemplateParser::removeNextToken() { diff --git a/src/template.h b/src/template.h index 4602c53..40bd43f 100644 --- a/src/template.h +++ b/src/template.h @@ -355,10 +355,10 @@ class TemplateListIntf virtual ~TemplateListIntf() {} /** Returns the number of elements in the list */ - virtual int count() const = 0; + virtual uint count() const = 0; /** Returns the element at index position \a index. */ - virtual TemplateVariant at(int index) const = 0; + virtual TemplateVariant at(uint index) const = 0; /** Creates a new iterator for this list. * @note the user should call delete on the returned pointer. @@ -377,8 +377,8 @@ class TemplateList : public TemplateListIntf { public: // TemplateListIntf methods - virtual int count() const; - virtual TemplateVariant at(int index) const; + virtual uint count() const; + virtual TemplateVariant at(uint index) const; virtual TemplateListIntf::ConstIterator *createIterator() const; virtual int addRef(); virtual int release(); @@ -457,6 +457,7 @@ class TemplateStruct : public TemplateStructIntf class TemplateEscapeIntf { public: + virtual ~TemplateEscapeIntf() {} /** Returns the \a input after escaping certain characters */ virtual QCString escape(const QCString &input) = 0; /** Setting tabbing mode on or off (for LaTeX) */ @@ -469,6 +470,7 @@ class TemplateEscapeIntf class TemplateSpacelessIntf { public: + virtual ~TemplateSpacelessIntf() {} /** Returns the \a input after removing redundant whitespace */ virtual QCString remove(const QCString &input) = 0; /** Reset filter state */ diff --git a/src/translator_dk.h b/src/translator_dk.h index 70e9032..df063ef 100644 --- a/src/translator_dk.h +++ b/src/translator_dk.h @@ -1775,7 +1775,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0 const char* base, const char* plurSuffix) { QCString result(base); - if (first_capital) result.at(0) = toupper(result.at(0)); + if (first_capital) result[0] = (char)toupper(result[0]); if (!singular) result+=plurSuffix; return result; } diff --git a/src/util.cpp b/src/util.cpp index fae2e90..b7dc69d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1628,34 +1628,6 @@ const ClassDef *getResolvedClass(const Definition *scope, //------------------------------------------------------------------------- //------------------------------------------------------------------------- -static bool findOperator(const QCString &s,int i) -{ - int b = s.findRev("operator",i); - if (b==-1) return FALSE; // not found - b+=8; - while (b - { - if (!isspace((uchar)s.at(b))) return FALSE; - b++; - } - return TRUE; -} - -static bool findOperator2(const QCString &s,int i) -{ - int b = s.findRev("operator",i); - if (b==-1) return FALSE; // not found - b+=8; - while (b('(')].before=FALSE; + charMap[static_cast('=')].before=FALSE; + charMap[static_cast('&')].before=FALSE; + charMap[static_cast('*')].before=FALSE; + charMap[static_cast('[')].before=FALSE; + charMap[static_cast('|')].before=FALSE; + charMap[static_cast('+')].before=FALSE; + charMap[static_cast(';')].before=FALSE; + charMap[static_cast(':')].before=FALSE; + charMap[static_cast('/')].before=FALSE; + + charMap[static_cast('=')].after=FALSE; + charMap[static_cast(' ')].after=FALSE; + charMap[static_cast('[')].after=FALSE; + charMap[static_cast(']')].after=FALSE; + charMap[static_cast('\t')].after=FALSE; + charMap[static_cast('\n')].after=FALSE; + charMap[static_cast(')')].after=FALSE; + charMap[static_cast(',')].after=FALSE; + charMap[static_cast('<')].after=FALSE; + charMap[static_cast('|')].after=FALSE; + charMap[static_cast('+')].after=FALSE; + charMap[static_cast('(')].after=FALSE; + charMap[static_cast('/')].after=FALSE; } struct CharElem { @@ -2707,165 +2679,6 @@ exit: return prot; } -#ifndef NEWMATCH -// strip any template specifiers that follow className in string s -static QCString trimTemplateSpecifiers( - const QCString &namespaceName, - const QCString &className, - const QCString &s - ) -{ - //printf("trimTemplateSpecifiers(%s,%s,%s)\n",namespaceName.data(),className.data(),s.data()); - QCString scopeName=mergeScopes(namespaceName,className); - ClassDef *cd=getClass(scopeName); - if (cd==0) return s; // should not happen, but guard anyway. - - QCString result=s; - - int i=className.length()-1; - if (i>=0 && className.at(i)=='>') // template specialization - { - // replace unspecialized occurrences in s, with their specialized versions. - int count=1; - int cl=i+1; - while (i>=0) - { - char c=className.at(i); - if (c=='>') count++,i--; - else if (c=='<') { count--; if (count==0) break; } - else i--; - } - QCString unspecClassName=className.left(i); - int l=i; - int p=0; - while ((i=result.find(unspecClassName,p))!=-1) - { - if (result.at(i+l)!='<') // unspecialized version - { - result=result.left(i)+className+result.right(result.length()-i-l); - l=cl; - } - p=i+l; - } - } - - //printf("result after specialization: %s\n",result.data()); - - QCString qualName=cd->qualifiedNameWithTemplateParameters(); - //printf("QualifiedName = %s\n",qualName.data()); - // We strip the template arguments following className (if any) - if (!qualName.isEmpty()) // there is a class name - { - int is,ps=0; - int p=0,l,i; - - while ((is=getScopeFragment(qualName,ps,&l))!=-1) - { - QCString qualNamePart = qualName.right(qualName.length()-is); - //printf("qualNamePart=%s\n",qualNamePart.data()); - while ((i=result.find(qualNamePart,p))!=-1) - { - int ql=qualNamePart.length(); - result=result.left(i)+cd->name()+result.right(result.length()-i-ql); - p=i+cd->name().length(); - } - ps=is+l; - } - } - //printf("result=%s\n",result.data()); - - return result.stripWhiteSpace(); -} - -/*! - * @param pattern pattern to look for - * @param s string to search in - * @param p position to start - * @param len resulting pattern length - * @returns position on which string is found, or -1 if not found - */ -static int findScopePattern(const QCString &pattern,const QCString &s, - int p,int *len) -{ - int sl=s.length(); - int pl=pattern.length(); - int sp=0; - *len=0; - while (p') - { - bc--; - if (bc==0) - { - p++; - break; - } - } - //printf("skipping pos=%d c=%c\n",p,s.at(p)); - p++; - } - } - else if (s.at(p)==pattern.at(pp)) - { - //printf("match at position p=%d pp=%d c=%c\n",p,pp,s.at(p)); - p++; - pp++; - } - else // no match - { - //printf("restarting at %d c=%c pat=%s\n",p,s.at(p),pattern.data()); - p=sp+1; - break; - } - } - if (pp==pl) // whole pattern matches - { - *len=p-sp; - return sp; - } - } - return -1; -} - -static QCString trimScope(const QCString &name,const QCString &s) -{ - int scopeOffset=name.length(); - QCString result=s; - do // for each scope - { - QCString tmp; - QCString scope=name.left(scopeOffset)+"::"; - //printf("Trying with scope='%s'\n",scope.data()); - - int i,p=0,l; - while ((i=findScopePattern(scope,result,p,&l))!=-1) // for each occurrence - { - tmp+=result.mid(p,i-p); // add part before pattern - p=i+l; - } - tmp+=result.right(result.length()-p); // add trailing part - - scopeOffset=name.findRev("::",scopeOffset-1); - result = tmp; - } while (scopeOffset>0); - //printf("trimScope(name=%s,scope=%s)=%s\n",name.data(),s.data(),result.data()); - return result; -} -#endif - void trimBaseClassScope(BaseClassList *bcl,QCString &s,int level=0) { //printf("trimBaseClassScope level=%d '%s'\n",level,s.data()); @@ -3032,276 +2845,6 @@ void stripIrrelevantConstVolatile(QCString &s) //#define MATCH printf("Match at line %d\n",__LINE__); //#define NOMATCH printf("Nomatch at line %d\n",__LINE__); -#ifndef NEWMATCH -static bool matchArgument(const Argument *srcA,const Argument *dstA, - const QCString &className, - const QCString &namespaceName, - NamespaceSDict *usingNamespaces, - SDict *usingClasses) -{ - //printf("match argument start '%s|%s' <-> '%s|%s' using nsp=%p class=%p\n", - // srcA->type.data(),srcA->name.data(), - // dstA->type.data(),dstA->name.data(), - // usingNamespaces, - // usingClasses); - - // TODO: resolve any typedefs names that are part of srcA->type - // before matching. This should use className and namespaceName - // and usingNamespaces and usingClass to determine which typedefs - // are in-scope, so it will not be very efficient :-( - - QCString srcAType=trimTemplateSpecifiers(namespaceName,className,srcA->type); - QCString dstAType=trimTemplateSpecifiers(namespaceName,className,dstA->type); - QCString srcAName=srcA->name.stripWhiteSpace(); - QCString dstAName=dstA->name.stripWhiteSpace(); - srcAType.stripPrefix("class "); - dstAType.stripPrefix("class "); - - // allow distinguishing "const A" from "const B" even though - // from a syntactic point of view they would be two names of the same - // type "const". This is not fool prove of course, but should at least - // catch the most common cases. - if ((srcAType=="const" || srcAType=="volatile") && !srcAName.isEmpty()) - { - srcAType+=" "; - srcAType+=srcAName; - } - if ((dstAType=="const" || dstAType=="volatile") && !dstAName.isEmpty()) - { - dstAType+=" "; - dstAType+=dstAName; - } - if (srcAName=="const" || srcAName=="volatile") - { - srcAType+=srcAName; - srcAName.resize(0); - } - else if (dstA->name=="const" || dstA->name=="volatile") - { - dstAType+=dstA->name; - dstAName.resize(0); - } - - stripIrrelevantConstVolatile(srcAType); - stripIrrelevantConstVolatile(dstAType); - - // strip typename keyword - if (qstrncmp(srcAType,"typename ",9)==0) - { - srcAType = srcAType.right(srcAType.length()-9); - } - if (qstrncmp(dstAType,"typename ",9)==0) - { - dstAType = dstAType.right(dstAType.length()-9); - } - - srcAType = removeRedundantWhiteSpace(srcAType); - dstAType = removeRedundantWhiteSpace(dstAType); - - //srcAType=stripTemplateSpecifiersFromScope(srcAType,FALSE); - //dstAType=stripTemplateSpecifiersFromScope(dstAType,FALSE); - - //printf("srcA='%s|%s' dstA='%s|%s'\n",srcAType.data(),srcAName.data(), - // dstAType.data(),dstAName.data()); - - if (srcA->array!=dstA->array) // nomatch for char[] against char - { - NOMATCH - return FALSE; - } - if (srcAType!=dstAType) // check if the argument only differs on name - { - - // remove a namespace scope that is only in one type - // (assuming a using statement was used) - //printf("Trimming %s<->%s: %s\n",srcAType.data(),dstAType.data(),namespaceName.data()); - //trimNamespaceScope(srcAType,dstAType,namespaceName); - //printf("After Trimming %s<->%s\n",srcAType.data(),dstAType.data()); - - //QCString srcScope; - //QCString dstScope; - - // strip redundant scope specifiers - if (!className.isEmpty()) - { - srcAType=trimScope(className,srcAType); - dstAType=trimScope(className,dstAType); - //printf("trimScope: '%s' <=> '%s'\n",srcAType.data(),dstAType.data()); - ClassDef *cd; - if (!namespaceName.isEmpty()) - cd=getClass(namespaceName+"::"+className); - else - cd=getClass(className); - if (cd && cd->baseClasses()) - { - trimBaseClassScope(cd->baseClasses(),srcAType); - trimBaseClassScope(cd->baseClasses(),dstAType); - } - //printf("trimBaseClassScope: '%s' <=> '%s'\n",srcAType.data(),dstAType.data()); - } - if (!namespaceName.isEmpty()) - { - srcAType=trimScope(namespaceName,srcAType); - dstAType=trimScope(namespaceName,dstAType); - } - //printf("#usingNamespace=%d\n",usingNamespaces->count()); - if (usingNamespaces && usingNamespaces->count()>0) - { - NamespaceSDict::Iterator nli(*usingNamespaces); - NamespaceDef *nd; - for (;(nd=nli.current());++nli) - { - srcAType=trimScope(nd->name(),srcAType); - dstAType=trimScope(nd->name(),dstAType); - } - } - //printf("#usingClasses=%d\n",usingClasses->count()); - if (usingClasses && usingClasses->count()>0) - { - SDict::Iterator cli(*usingClasses); - Definition *cd; - for (;(cd=cli.current());++cli) - { - srcAType=trimScope(cd->name(),srcAType); - dstAType=trimScope(cd->name(),dstAType); - } - } - - //printf("2. srcA=%s|%s dstA=%s|%s\n",srcAType.data(),srcAName.data(), - // dstAType.data(),dstAName.data()); - - if (!srcAName.isEmpty() && !dstA->type.isEmpty() && - (srcAType+" "+srcAName)==dstAType) - { - MATCH - return TRUE; - } - else if (!dstAName.isEmpty() && !srcA->type.isEmpty() && - (dstAType+" "+dstAName)==srcAType) - { - MATCH - return TRUE; - } - - - uint srcPos=0,dstPos=0; - bool equal=TRUE; - while (srcPos if no then there is no match - if (!srcAName.isEmpty() || !dstAName.isEmpty()) - { - NOMATCH - return FALSE; - } - // types only - while (srcPos no match - } - } - else // maybe dst has a name while src has not - { - dstPos++; - while (dstPos no match - } - } - } - else if (srcPos no match - } - } - else // maybe src has a name while dst has not - { - srcPos++; - while (srcPos no match - } - } - } - } - MATCH - return TRUE; -} - -#endif - static QCString stripDeclKeywords(const QCString &s) { int i=s.find(" class "); @@ -3869,7 +3412,6 @@ static void findMembersWithSpecificName(MemberName *mn, ) { bool match=TRUE; - ArgumentList *argList=0; if (args && !md->isDefine() && qstrcmp(args,"()")!=0) { const ArgumentList &mdAl = md->argumentList(); @@ -4760,7 +4302,7 @@ bool resolveLink(/* in */ const char *scName, } else if ((pd=Doxygen::pageSDict->find(linkRef))) // link to a page { - const GroupDef *gd = pd->getGroupDef(); + gd = pd->getGroupDef(); if (gd) { if (!pd->name().isEmpty()) si=SectionManager::instance().find(pd->name()); @@ -4951,7 +4493,7 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) const int maxAddrSize = 20; char addr[maxAddrSize]; - qsnprintf(addr,maxAddrSize,"%p:",fnDict); + qsnprintf(addr,maxAddrSize,"%p:",(void*)fnDict); QCString key = addr; key+=n; @@ -5157,7 +4699,7 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst,in r+=dstLen; } qstrcpy(r,p); - result.resize(strlen(result.data())+1); + result.resize((int)strlen(result.data())+1); //printf("substitute(%s,%s,%s)->%s\n",s,src,dst,result.data()); return result; } @@ -5402,7 +4944,7 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor else { growBuf.addChar('_'); - growBuf.addChar(tolower(c)); + growBuf.addChar((char)tolower(c)); } break; } @@ -5462,7 +5004,7 @@ QCString unescapeCharsInString(const char *s) default: if (!caseSenseNames && c>='a' && c<='z') // lower to upper case escape, _a -> 'A' { - result+=toupper(*p); + result+=(char)toupper(*p); p++; } else // unknown escape, pass underscore character as-is @@ -6347,7 +5889,6 @@ QCString substituteTemplateArgumentsInString( { result += name.mid(p,i-p); QCString n = name.mid(i,l); - auto formIt = formalArgs.begin(); auto actIt = actualArgs.begin(); // if n is a template argument, then we substitute it @@ -6570,7 +6111,7 @@ int getScopeFragment(const QCString &s,int p,int *l) while (sp> operators! - char c=s.at(sp++); + c=s.at(sp++); switch(c) { case '<': count++; break; @@ -7480,7 +7021,7 @@ const char *writeUtf8Char(FTextStream &t,const char *s) return s; } -int nextUtf8CharPosition(const QCString &utf8Str,int len,int startPos) +int nextUtf8CharPosition(const QCString &utf8Str,uint len,uint startPos) { int bytes=1; if (startPos>=len) return len; @@ -7604,7 +7145,7 @@ static int findEndOfCommand(const char *s) QCString args = extractAliasArgs(p,0); i+=args.length(); } - i+=p-s; + i+=(int)(p-s); } return i; } diff --git a/src/util.h b/src/util.h index 9586f78..fc5eee4 100644 --- a/src/util.h +++ b/src/util.h @@ -442,7 +442,7 @@ bool patternMatch(const QFileInfo &fi,const QStrList *patList); QCString externalLinkTarget(const bool parent = false); QCString externalRef(const QCString &relPath,const QCString &ref,bool href); -int nextUtf8CharPosition(const QCString &utf8Str,int len,int startPos); +int nextUtf8CharPosition(const QCString &utf8Str,uint len,uint startPos); const char *writeUtf8Char(FTextStream &t,const char *s); diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 7350bfe..808e5a2 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -53,6 +53,8 @@ #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 + +#define USE_STATE2STRING 0 // Toggle for some debugging info //#define DBG_CTX(x) fprintf x @@ -116,7 +118,10 @@ static bool writeColoredWord(QCString& word ); static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName, bool typeOnly=FALSE, const char *curr_class=0); static void endFontClass(); static void startFontClass(const char *s); + +#if USE_STATE2STRING static const char *stateToString(int state); +#endif //------------------------------------------------------------------- @@ -855,7 +860,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI generateMemLink(*g_code,g_PortMapComp,s1); while (index++ g_vhdlKeyDict3(17,FALSE); static void initUCF(Entry* root,const char* type,QCString & qcs,int line,QCString & fileName,QCString & brief); static void writeUCFLink(const MemberDef* mdef,OutputList &ol); -static void assignBinding(VhdlConfNode* conf); static void addInstance(ClassDef* entity, ClassDef* arch, ClassDef *inst, const std::shared_ptr &cur); @@ -768,22 +767,22 @@ MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& mem Definition *d = cd->getOuterScope(); QCString tt=d->name(); - ClassDef *ecd =getClass(tt); - if (!ecd) + ClassDef *acd =getClass(tt); + if (!acd) { tt=tt.upper(); - ecd =getClass(tt); + acd =getClass(tt); } - if (!ecd) + if (!acd) { tt=tt.lower(); - ecd =getClass(tt); + acd =getClass(tt); } - if (ecd) //d && d->definitionType()==Definition::TypeClass) + if (acd) //d && d->definitionType()==Definition::TypeClass) { - if(!packages.contains(ecd)) + if(!packages.contains(acd)) { - VhdlDocGen::findAllPackages(ecd); + VhdlDocGen::findAllPackages(acd); } } } @@ -1154,7 +1153,6 @@ void VhdlDocGen::parseFuncProto(const char* text,QCString& name,QCString& ret,bo } else { - QCString s1(text); s1=s1.stripWhiteSpace(); int i=s1.find("(",0,FALSE); int s=s1.find(QRegExp("[ \\t]")); @@ -1421,7 +1419,7 @@ void VhdlDocGen::formatString(const QCString &s, OutputList& ol,const MemberDef* void VhdlDocGen::writeProcedureProto(OutputList& ol,const ArgumentList &al,const MemberDef* mdef) { bool sem=FALSE; - int len=al.size(); + size_t len=al.size(); ol.docify("( "); if (len > 2) { @@ -1477,7 +1475,7 @@ void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList &al,const { if (!al.hasParameters()) return; bool sem=FALSE; - int len=al.size(); + size_t len=al.size(); ol.startBold(); ol.docify(" ( "); ol.endBold(); @@ -1586,7 +1584,7 @@ bool VhdlDocGen::writeFuncProcDocu( //bool sem=FALSE; ol.enableAll(); - int index=al.size(); + size_t index=al.size(); if (index==0) { ol.docify(" ( ) "); @@ -2455,10 +2453,10 @@ void VhdlDocGen::parseUCF(const char* input, Entry* entity,QCString fileName,b { if (altera) { - int i=temp.find("-name"); - if (i>0) + int in=temp.find("-name"); + if (in>0) { - temp=temp.remove(0,i+5); + temp=temp.remove(0,in+5); } temp.stripPrefix("set_location_assignment"); @@ -2468,8 +2466,8 @@ void VhdlDocGen::parseUCF(const char* input, Entry* entity,QCString fileName,b else { QRegExp ee("[\\s=]"); - int i=temp.find(ee); - QCString ff=temp.left(i); + int in=temp.find(ee); + QCString ff=temp.left(in); temp.stripPrefix(ff.data()); ff.append("#"); if (!temp.isEmpty()) @@ -2684,111 +2682,6 @@ QCString VhdlDocGen::parseForBinding(QCString & entity,QCString & arch) } -//@param arch bit0:flipflop -//@param binding e.g entity work.foo(bar) -//@param label |label0|label1 -// label0:architecture name -//@param confVhdl of configuration file (identifier::entity_name) or -// the architecture if isInlineConf TRUE -//@param isInlineConf -//@param confN List of configurations - -void assignBinding(VhdlConfNode * conf) -{ - ClassDef *archClass=0,*entClass=0; - QCString archName; - QCString arcBind,entBind; - - bool others,all; - entBind=conf->binding; - QCString conf2=VhdlDocGen::parseForBinding(entBind,arcBind); - - if (conf2!="configuration") - { - QCString a,c,e; - if (conf->isInlineConf) - { - c=conf->confVhdl; - e=VhdlDocGen::getIndexWord(conf->confVhdl.data(),0); - } - else - { - a=VhdlDocGen::getIndexWord(conf->compSpec.data(),0); - e=VhdlDocGen::getIndexWord(conf->confVhdl.data(),1); - c=e+"::"+a; - } - archClass= VhdlDocGen::findVhdlClass(c.data());//Doxygen::classSDict->find(a.data()); - entClass= VhdlDocGen::findVhdlClass(e.data()); //Doxygen::classSDict->find(e.data()); - } - - QCString label=conf->compSpec.lower(); - //label.prepend("|"); - - if (!archClass) - { - // err("architecture %s not found ! ",conf->confVhdl.data()); - return; - } - - archName=archClass->name(); - QCString allOt=VhdlDocGen::getIndexWord(conf->arch.data(),0); - all=allOt.lower()=="all" ; - others= allOt.lower()=="others"; - - for (const auto &cur : getVhdlInstList()) - { - if (cur->exception.lower()==label || conf->isInlineConf) - { - QCString archy; - - if (all || others) - { - archy=VhdlDocGen::getIndexWord(conf->arch.data(),1); - } - else - { - archy=conf->arch; - } - - QCString inst1=VhdlDocGen::getIndexWord(archy.data(),0).lower(); - QCString comp=VhdlDocGen::getIndexWord(archy.data(),1).lower(); - - QCStringList ql=QCStringList::split(",",inst1); - - for (uint j=0;jarch.data(),1); - sign1=cur->type; - } - else - { - archy1=comp+":"+ql[j]; - sign1=cur->type+":"+cur->name; - } - - if (archy1==sign1.lower() && !cur->stat) - { - // fprintf(stderr," \n label [%s] [%s] [%s]",cur->exception.data(),cur->type.data(),cur->name.data()); - ClassDef *ent= VhdlDocGen::findVhdlClass(entBind.data());//Doxygen::classSDict->find(entBind.data()); - - if (entClass==0 || ent==0) - { - continue; - } - - addInstance(ent,archClass,entClass,cur); - cur->stat=TRUE; - break; - } - }// for - } - }//for each element in instList - -}//assignBinding - /* // file foo.vhd @@ -3880,7 +3773,7 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart* fl) else { if (fl->text.isEmpty()) return; - bool var=(fl->type & FlowChart::VARIABLE_NO); + bool isVar=(fl->type & FlowChart::VARIABLE_NO); QCString q=fl->text; if (exit) @@ -3896,7 +3789,7 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart* fl) } t << "[shape=none margin=0.1, label=<\n"; t << "
\n "; - if (var) + if (isVar) { t << "
"; } @@ -3959,7 +3852,7 @@ void FlowChart::writeEdge(FTextStream &t,int fl_from,int fl_to,int i,bool bFrom, void FlowChart::alignFuncProc( QCString & q,const ArgumentList &al,bool isFunc) { - int index=al.size(); + size_t index=al.size(); if (index==0) return; int len=q.length()+VhdlDocGen::getFlowMember()->name().length(); diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp index 22e2e01..725349e 100644 --- a/src/vhdljjparser.cpp +++ b/src/vhdljjparser.cpp @@ -731,8 +731,8 @@ void VHDLOutlineParser::error_skipto(int kind) Token *op; do { - Token *t = p->vhdlParser->getNextToken();// step to next token - op=p->vhdlParser->getToken(1); // get first token + p->vhdlParser->getNextToken(); // step to next token + op=p->vhdlParser->getToken(1); // get first token if (op==0) break; //fprintf(stderr,"\n %s",t->image.data()); } while (op->kind != kind); diff --git a/src/xmlcode.l b/src/xmlcode.l index edc98d5..b583bf5 100644 --- a/src/xmlcode.l +++ b/src/xmlcode.l @@ -72,7 +72,9 @@ static MemberDef * g_currentMemberDef; static bool g_includeCodeFragment; static const char * g_currentFontClass; +#if USE_STATE2STRING static const char *stateToString(int state); +#endif static void codify(const char* text) { @@ -438,4 +440,6 @@ void XMLCodeParser::resetCodeParserState() resetXmlCodeParserState(); } +#if USE_STATE2STRING #include "xmlcode.l.h" +#endif diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 21fa77e..33426a7 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -1,9 +1,6 @@ /****************************************************************************** * - * - * - * - * Copyright (C) 1997-2015 by Dimitri van Heesch. + * Copyright (C) 1997-2020 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -1084,10 +1081,10 @@ void XmlDocVisitor::visitPre(DocParamList *pl) { if (pl->paramTypes().count()>0) { - QListIterator li(pl->paramTypes()); + QListIterator li2(pl->paramTypes()); DocNode *type; m_t << ""; - for (li.toFirst();(type=li.current());++li) + for (li2.toFirst();(type=li2.current());++li2) { if (type->kind()==DocNode::Kind_Word) { diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index d674ed8..bca5f7b 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1007,7 +1007,6 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream if (mdict) { MemberSDict::Iterator mdi(*mdict); - const MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { writeMemberReference(t,def,rmd,"references"); @@ -1017,7 +1016,6 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream if (mdict) { MemberSDict::Iterator mdi(*mdict); - const MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { writeMemberReference(t,def,rmd,"referencedby"); diff --git a/vhdlparser/vhdlstring.h b/vhdlparser/vhdlstring.h index ee01b06..59e9e22 100755 --- a/vhdlparser/vhdlstring.h +++ b/vhdlparser/vhdlstring.h @@ -58,7 +58,7 @@ class VhdlString } VhdlString(const char *s) { - m_len = strlen(s); + m_len = (int)strlen(s); m_str=(char*)malloc(m_len+1); memcpy(m_str,s,m_len+1); } @@ -87,7 +87,7 @@ class VhdlString } VhdlString& append(const char *s) { - return append(s,strlen(s)); + return append(s,(int)strlen(s)); } VhdlString& append(const VhdlString &other) { @@ -123,9 +123,6 @@ class VhdlString int m_len; }; -// declare it static otherwise we will get: -// multiple definition of `operator+(char const*, VhdlString)' -// as we are in an include file -static VhdlString operator+ (const char *s, VhdlString v) { return VhdlString(s).append(v); } +inline VhdlString operator+ (const char *s, VhdlString v) { return VhdlString(s).append(v); } #endif -- cgit v0.12