Commit 941eea99 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Some restructuring and some compiler warning fixes

parent c1e25238
......@@ -460,10 +460,10 @@ settings where overruled.
When using doxygen for Fortran code you should
set \ref cfg_optimize_for_fortran "OPTIMIZE_FOR_FORTRAN" to \c YES.
The parser tries to guess wheter the source code is fixed format Fortran or
free format Fortran code. This is not always correct, in the later case
The parser tries to guess if the source code is fixed format Fortran or
free format Fortran code. This may not always be correct. If not
one should use \ref cfg_extension_mapping "EXTENSION_MAPPING" to correct this.
By setteing `EXTENSION_MAPPING = f=FortranFixed f90=FortranFree` files with
By setting `EXTENSION_MAPPING = f=FortranFixed f90=FortranFree` files with
extension \c f90 are interpreted as fixed format Fortran code and files with
extension \c f are interpreted as free format Fortran code.
......
......@@ -16,7 +16,7 @@
*/
#ifndef _COMMENTCNV_H
#define _COMMNETCNV_H
#define _COMMENTCNV_H
class BufStr;
......
......@@ -4045,7 +4045,7 @@ class ClassInheritanceContext::Private : public GenericNodeListContext
bool b;
if (cd->getLanguage()==SrcLangExt_VHDL)
{
if (!(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS)
if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
{
continue;
}
......
......@@ -2462,8 +2462,12 @@ void DotGfxHierarchyTable::addClassList(ClassSDict *cl)
for (cli.toLast();(cd=cli.current());--cli)
{
//printf("Trying %s subClasses=%d\n",cd->name().data(),cd->subClasses()->count());
if (cd->getLanguage()==SrcLangExt_VHDL && !(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS)
if (cd->getLanguage()==SrcLangExt_VHDL &&
(VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS
)
{
continue;
}
if (!hasVisibleRoot(cd->baseClasses()) &&
cd->isVisibleInHierarchy()
) // root node in the forest
......
......@@ -15,8 +15,10 @@
*
*/
#ifndef CODE_H
#define CODE_H
#ifndef FORTRANCODE_H
#define FORTRANCODE_H
#include "types.h"
class CodeOutputInterface;
class FileDef;
......@@ -28,7 +30,7 @@ void parseFortranCode(CodeOutputInterface &,const char *,const QCString &,
bool ,const char *,FileDef *fd,
int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
bool collectRefs, FortranKind codeType);
bool collectRefs, FortranFormat format);
void resetFortranCodeParserState();
void codeFreeScanner();
......
......@@ -154,13 +154,13 @@ static int bracketCount = 0;
// simplified way to know if this is fixed form
// duplicate in fortranscanner.l
static bool recognizeFixedForm(const char* contents, FortranKind codeType)
static bool recognizeFixedForm(const char* contents, FortranFormat format)
{
int column=0;
bool skipLine=FALSE;
if (codeType == FORTRAN_FIXED) return TRUE;
if (codeType == FORTRAN_FREE) return FALSE;
if (format == FortranFormat_Fixed) return TRUE;
if (format == FortranFormat_Free) return FALSE;
for (int i=0;;i++)
{
column++;
......@@ -1110,7 +1110,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool,Definition *searchCtx,
bool collectXRefs, FortranKind codeType)
bool collectXRefs, FortranFormat format)
{
//printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);
......@@ -1124,7 +1124,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
g_code = &od;
g_inputString = s;
g_inputPosition = 0;
g_isFixedForm = recognizeFixedForm((const char*)s,codeType);
g_isFixedForm = recognizeFixedForm((const char*)s,format);
g_currentFontClass = 0;
g_needsTermination = FALSE;
g_searchCtx = searchCtx;
......
......@@ -19,7 +19,6 @@
#define SCANNER_FORTRAN_H
#include "parserintf.h"
#include "util.h"
/** \brief Fortran language parser using state-based lexical scanning.
*
......@@ -28,10 +27,10 @@
class FortranLanguageScanner : public ParserInterface
{
public:
FortranLanguageScanner(void) { codeType = FORTRAN_UNKNOWN;}
virtual ~FortranLanguageScanner(void) {}
FortranLanguageScanner(FortranFormat format=FortranFormat_Unknown) : m_format(format) { }
virtual ~FortranLanguageScanner() {}
void startTranslationUnit(const char *) {}
void finishTranslationUnit(void) {}
void finishTranslationUnit() {}
void parseInput(const char *fileName,
const char *fileBuf,
Entry *root,
......@@ -53,22 +52,23 @@ class FortranLanguageScanner : public ParserInterface
Definition *searchCtx=0,
bool collectXRefs=TRUE
);
void resetCodeParserState(void);
void resetCodeParserState();
void parsePrototype(const char *text);
FortranKind codeType;
private:
FortranFormat m_format;
};
class FortranLanguageScannerFree : public FortranLanguageScanner
{
public:
FortranLanguageScannerFree(void) { codeType = FORTRAN_FREE; }
FortranLanguageScannerFree() : FortranLanguageScanner(FortranFormat_Free) { }
};
class FortranLanguageScannerFixed : public FortranLanguageScanner
{
public:
FortranLanguageScannerFixed(void) { codeType = FORTRAN_FIXED; }
FortranLanguageScannerFixed() : FortranLanguageScanner(FortranFormat_Fixed) { }
};
#endif
......@@ -1313,13 +1313,13 @@ void truncatePrepass(int index)
// simplified way to know if this is fixed form
// duplicate in fortrancode.l
static bool recognizeFixedForm(const char* contents, FortranKind codeType)
static bool recognizeFixedForm(const char* contents, FortranFormat format)
{
int column=0;
bool skipLine=FALSE;
if (codeType == FORTRAN_FIXED) return TRUE;
if (codeType == FORTRAN_FREE) return FALSE;
if (format == FortranFormat_Fixed) return TRUE;
if (format == FortranFormat_Free) return FALSE;
for(int i=0;;i++) {
column++;
......@@ -2246,7 +2246,7 @@ level--;
#endif
static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, FortranKind codeType)
static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, FortranFormat format)
{
char *tmpBuf = NULL;
initParser();
......@@ -2266,7 +2266,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra
inputFile.setName(fileName);
if (inputFile.open(IO_ReadOnly))
{
isFixedForm = recognizeFixedForm(fileBuf,codeType);
isFixedForm = recognizeFixedForm(fileBuf,format);
if (isFixedForm)
{
......@@ -2345,7 +2345,7 @@ void FortranLanguageScanner::parseInput(const char *fileName,
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
::parseMain(fileName,fileBuf,root,this->codeType);
::parseMain(fileName,fileBuf,root,m_format);
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
......@@ -2368,7 +2368,7 @@ void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
{
::parseFortranCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef,
showLineNumbers,searchCtx,collectXRefs,this->codeType);
showLineNumbers,searchCtx,collectXRefs,m_format);
}
bool FortranLanguageScanner::needsPreprocessing(const QCString &extension)
......
......@@ -811,7 +811,7 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT
bool b;
if (cd->getLanguage()==SrcLangExt_VHDL)
{
if (!(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS)
if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
{
continue;
}
......
......@@ -156,16 +156,6 @@
Translator *theTranslator=0;
static const char obsoleteMsg[] =
"---------\n"
"ERROR: The selected language is no longer supported!\n"
"If you want doxygen to produce output in this language \n"
"you are kindly requested to help bringing the documentation \n"
"up to date. Please read the development section of the manual \n"
"for more information or contact Petr Prikryl (Prikryl@skil.cz).\n"
"Thanks in advance!\n"
"---------\n";
bool setTranslator(const char *langName)
{
if (L_EQUAL("english"))
......
......@@ -1146,10 +1146,10 @@ static unsigned encodeLZ77_brute(uivector* out, const unsigned char* in, size_t
}
#endif
/*
static const unsigned HASH_NUM_VALUES = 65536;
static const unsigned HASH_NUM_CHARACTERS = 6;
static const unsigned HASH_SHIFT = 2;
/*
Good and fast values: HASH_NUM_VALUES=65536, HASH_NUM_CHARACTERS=6, HASH_SHIFT=2
making HASH_NUM_CHARACTERS larger (like 8), makes the file size larger but is a bit faster
making HASH_NUM_CHARACTERS smaller (like 3), makes the file size smaller but is slower
......
......@@ -210,4 +210,11 @@ enum MemberType
MemberType_Service,
};
enum FortranFormat
{
FortranFormat_Unknown,
FortranFormat_Free,
FortranFormat_Fixed
};
#endif
......@@ -414,7 +414,6 @@ QCString externalRef(const QCString &relPath,const QCString &ref,bool href);
int nextUtf8CharPosition(const QCString &utf8Str,int len,int startPos);
const char *writeUtf8Char(FTextStream &t,const char *s);
enum FortranKind { FORTRAN_UNKNOWN = 0, FORTRAN_FREE, FORTRAN_FIXED};
/** Data associated with a HSV colored image. */
struct ColoredImgDataItem
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment