summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/classlist.cpp4
-rw-r--r--src/commentscan.l4
-rw-r--r--src/definition.cpp20
-rw-r--r--src/doctokenizer.l6
-rw-r--r--src/formula.cpp2
-rw-r--r--src/fortrancode.l6
-rw-r--r--src/fortranscanner.l14
-rw-r--r--src/htmlgen.cpp10
-rw-r--r--src/message.cpp2
-rw-r--r--src/pre.l12
-rw-r--r--src/pycode.l4
-rw-r--r--src/section.h2
-rw-r--r--src/util.cpp2
-rw-r--r--src/vhdldocgen.cpp8
14 files changed, 51 insertions, 45 deletions
diff --git a/src/classlist.cpp b/src/classlist.cpp
index f06f744..5e14051 100644
--- a/src/classlist.cpp
+++ b/src/classlist.cpp
@@ -168,7 +168,7 @@ void GenericsSDict::insert(const QCString &key,ClassDef *cd)
if (i==-1) return;
ArgumentList argList;
stringToArgumentList(SrcLangExt_CSharp, key.mid(i),argList);
- int c = argList.size();
+ int c = (int)argList.size();
if (c==0) return;
GenericsCollection *collection = m_dict.find(key.left(i));
if (collection==0) // new name
@@ -201,7 +201,7 @@ ClassDef *GenericsSDict::find(const QCString &key)
{
ArgumentList argList;
stringToArgumentList(SrcLangExt_CSharp,key.mid(i),argList);
- int c = argList.size();
+ int c = (int)argList.size();
return collection->find(c);
}
}
diff --git a/src/commentscan.l b/src/commentscan.l
index 053436c..13ea0c1 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -735,9 +735,9 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
yyextra->parseMore=TRUE;
yyextra->needNewEntry = TRUE;
#if YY_FLEX_MAJOR_VERSION>=2 && (YY_FLEX_MINOR_VERSION>5 || (YY_FLEX_MINOR_VERSION==5 && YY_FLEX_SUBMINOR_VERSION>=33))
- yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + strlen(yytext);
+ yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
#else
- yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - yy_current_buffer->yy_ch_buf) + strlen(yytext);
+ yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - yy_current_buffer->yy_ch_buf) + (int)strlen(yytext);
#endif
yyterminate();
}
diff --git a/src/definition.cpp b/src/definition.cpp
index 043e210..28b552b 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -695,7 +695,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 +722,7 @@ class FilterCache
if (f)
{
bool success=TRUE;
- str.resize(item->fileSize+1);
+ str.resize(static_cast<uint>(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 +730,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",
@@ -768,16 +768,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 +785,7 @@ class FilterCache
return FALSE;
}
size+=bytesWritten;
- str.addArray(buf,bytesWritten);
+ str.addArray(buf,static_cast<int>(bytesWritten));
}
str.addChar('\0');
item->fileSize = size;
@@ -805,8 +805,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<int>(bytesRead));
}
str.addChar('\0');
fclose(f);
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 0f8cb1c..5b10e5c 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -1033,7 +1033,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<uint>(yyleng)-2);
}
else
{
@@ -1170,9 +1170,9 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
}
<St_Param>[^ \t\n,@\\]+ {
g_token->name = yytext;
- if (g_token->name.at(yyleng-1)==':')
+ if (g_token->name.at(static_cast<uint>(yyleng)-1)==':')
{
- g_token->name=g_token->name.left(yyleng-1);
+ g_token->name=g_token->name.left(static_cast<uint>(yyleng)-1);
}
return TK_WORD;
}
diff --git a/src/formula.cpp b/src/formula.cpp
index de004ed..3130122 100644
--- a/src/formula.cpp
+++ b/src/formula.cpp
@@ -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<std::string,int>(key,id));
p->formulas.push_back(key);
return id;
diff --git a/src/fortrancode.l b/src/fortrancode.l
index 4d8dc1c..bf6c22e 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -78,7 +78,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<int>(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;}
@@ -1120,7 +1120,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<int>(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 +1141,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<int>(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;
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 3a5123c..0265fc3 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -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
@@ -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/htmlgen.cpp b/src/htmlgen.cpp
index 2dc62fa..05486d8 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'");
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/pre.l b/src/pre.l
index fbf7bde..648c2c5 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -475,7 +475,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<*>"??"[=/'()!<>-] { // Trigraph
unput(resolveTrigraph(yytext[2]));
}
-<Start>^{B}*"#" { BEGIN(Command); yyextra->yyColNr+=yyleng; yyextra->yyMLines=0;}
+<Start>^{B}*"#" { BEGIN(Command); yyextra->yyColNr+=(int)yyleng; yyextra->yyMLines=0;}
<Start>^{B}*/[^#] {
outputArray(yyscanner,yytext,(int)yyleng);
BEGIN(CopyLine);
@@ -795,7 +795,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<Command>("cmake")?"define"{B}+ {
//printf("!!!DefName\n");
- yyextra->yyColNr+=yyleng;
+ yyextra->yyColNr+=(int)yyleng;
BEGIN(DefName);
}
<Command>"ifdef"/{B}*"(" {
@@ -879,7 +879,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
yyextra->yyLineNr++;
}
<IgnoreLine>.
-<Command>. {yyextra->yyColNr+=yyleng;}
+<Command>. {yyextra->yyColNr+=(int)yyleng;}
<UndefName>{ID} {
Define *def;
if ((def=yyextra->defineManager.isDefined(yytext))
@@ -1239,7 +1239,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
else
{
outputArray(yyscanner,yytext,(int)yyleng);
- yyextra->fenceSize=yyleng;
+ yyextra->fenceSize=(int)yyleng;
BEGIN(SkipVerbatim);
}
}
@@ -1252,7 +1252,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
else
{
outputArray(yyscanner,yytext,(int)yyleng);
- yyextra->fenceSize=yyleng;
+ yyextra->fenceSize=(int)yyleng;
BEGIN(SkipVerbatim);
}
}
@@ -1890,7 +1890,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];
diff --git a/src/pycode.l b/src/pycode.l
index 9dee2e8..970c221 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -1269,7 +1269,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<int>(yyleng));
// printf("Captured indent of %d [line %d]\n", yyleng, g_yyLineNr);
BEGIN( Suite );
}
@@ -1283,7 +1283,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
// should be improved.
// (translate tabs to space, etc)
codifyLines(yytext);
- adjustScopesAndSuites((int)yyleng);
+ adjustScopesAndSuites(static_cast<int>(yyleng));
}
"\n"|({BB}"\n") {
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/util.cpp b/src/util.cpp
index fae2e90..df1b748 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -5157,7 +5157,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;
}
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index c54bf78..dfd2aa1 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -1421,7 +1421,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 +1477,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 +1586,7 @@ bool VhdlDocGen::writeFuncProcDocu(
//bool sem=FALSE;
ol.enableAll();
- int index=al.size();
+ size_t index=al.size();
if (index==0)
{
ol.docify(" ( ) ");
@@ -3959,7 +3959,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();