[Doxygen-develop] MSC generator patch + misc
Brought to you by:
dimitri
From: <aca...@fr...> - 2008-11-14 16:01:32
|
Hi all, Below is a patch with a few modifications. The unimportant ones are: - Some spurious '\n' in warning string have been removed - Replace '$filename' keyword in the warning string template by the filename of the file without the path (normally, '$file' is replaced by path+filename) - Additional option for MSVC++ linker to prevent a warning The last one enables the output from the MSCGEN child process and print it to stdout. Actually, I do not understand why it has been disabled. MSCGEN syntax is not trivial and errors are frequent. Having to generate the chart externally and reimport it in its source file when it is error free is really tedious and this little change is of great help (may be some side effect on other platform? I only tried under windows/cygwin). The output is unfortunately quite raw, and do not print real error location (source file name and line number) as an intermediate file is generated for MSCGEN. I was thinking of providing a better patch that give some info to MSCGEN as options, in order to print a correct error message if needed but that is not obvious when looking at the doxy source. The input filename and line seem to be unknown when MSCGEN is called; actually, I would be interested if some doxy gurus can provide me some hints about this point, in order to provide a elegant patch that could be integrated in the main branch. Thanks, Antoine Calando ------------------------- attached patch: ------------------------- Index: src/commentscan.l =================================================================== --- src/commentscan.l (revision 661) +++ src/commentscan.l (working copy) @@ -2462,14 +2462,14 @@ { //if (g_memberGroupId!=DOX_NOGROUP) //{ - // warn(fileName,line,"Warning: end of file while inside a member group\n"); + // warn(fileName,line,"Warning: end of file while inside a member group"); //} g_memberGroupId=DOX_NOGROUP; g_memberGroupRelates.resize(0); g_memberGroupDocs.resize(0); if (!g_autoGroupStack.isEmpty()) { - warn(fileName,line,"Warning: end of file while inside a group\n"); + warn(fileName,line,"Warning: end of file while inside a group"); } } @@ -2477,7 +2477,7 @@ { if (g_memberGroupId!=DOX_NOGROUP) { - warn(fileName,line,"Warning: try to put compound %s inside a member group\n",name); + warn(fileName,line,"Warning: try to put compound %s inside a member group",name); } g_memberGroupId=DOX_NOGROUP; g_memberGroupRelates.resize(0); Index: src/doxygen.cpp =================================================================== --- src/doxygen.cpp (revision 661) +++ src/doxygen.cpp (working copy) @@ -518,7 +518,7 @@ gd->setGroupTitle( root->type ); else if ( root->type.length() > 0 && root->name != root->type && gd->groupTitle() != root->type ) warn( root->fileName,root->startLine, - "group %s: ignoring title \"%s\" that does not match old title \"%s\"\n", + "group %s: ignoring title \"%s\" that does not match old title \"%s\"", root->name.data(), root->type.data(), gd->groupTitle() ); //if ( gd->briefDescription().isEmpty() ) gd->setBriefDescription(root->brief,root->briefFile,root->briefLine); Index: src/message.cpp =================================================================== --- src/message.cpp (revision 661) +++ src/message.cpp (working copy) @@ -18,6 +18,7 @@ #include <stdarg.h> #include <stdio.h> #include <qdatetime.h> +#include <qfileinfo.h> #include "config.h" #include "util.h" #include "debug.h" @@ -117,7 +118,15 @@ if (!Config_getBool(tag)) return; // warning type disabled char text[40960]; vsprintf(text, fmt, args); - QCString fileSubst = file==0 ? "<unknown>" : file; + QCString fileSubst = "<unknown>"; + QCString filenameSubst = fileSubst; + if (file) + { + fileSubst = file; + QFileInfo f(file); + filenameSubst = f.fileName(); + } + QCString lineSubst; lineSubst.setNum(line); QCString textSubst = text; QCString versionSubst; @@ -136,8 +145,11 @@ substitute( substitute( substitute( - substitute( - outputFormat, + substitute( + substitute( + outputFormat, + "$filename",filenameSubst + ), "$file",fileSubst ), "$text",textSubst Index: src/msc.cpp =================================================================== --- src/msc.cpp (revision 661) +++ src/msc.cpp (working copy) @@ -119,7 +119,7 @@ mscArgs+=extension+"\""; int exitCode; //printf("*** running: %s %s\n",mscExe.data(),mscArgs.data()); - if ((exitCode=portable_system(mscExe,mscArgs,FALSE))!=0) + if ((exitCode=portable_system(mscExe,mscArgs,TRUE))!=0) { goto error; } @@ -155,7 +155,7 @@ mscArgs+=outFile + "\""; int exitCode; - if ((exitCode=portable_system(mscExe,mscArgs,FALSE))!=0) + if ((exitCode=portable_system(mscExe,mscArgs,TRUE))!=0) { QDir::setCurrent(oldDir); return ""; Index: winbuild/Doxygen.vcproj =================================================================== --- winbuild/Doxygen.vcproj (revision 661) +++ winbuild/Doxygen.vcproj (working copy) @@ -78,6 +78,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/NODEFAULTLIB:library" AdditionalDependencies="qtools.lib libpng.lib zlib.lib ws2_32.lib iconv.lib" OutputFile="..\bin\Debug\doxygen.exe" LinkIncremental="2" |