Skip to content

Commit

Permalink
VS2013 bugfix - FileType is no longer present, using extension to det…
Browse files Browse the repository at this point in the history
…ermine C++ source files instead
  • Loading branch information
VioletGiraffe committed Feb 7, 2014
1 parent bab68ef commit 8d8a04e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CPPCheckPlugin/AnalyzerCppcheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class AnalyzerCppcheck : ICodeAnalyzer
public override void analyze(List<SourceFile> filesToAnalyze, OutputWindowPane outputWindow, bool is64bitConfiguration,
bool isDebugConfiguration, bool bringOutputToFrontAfterAnalysis)
{
if (filesToAnalyze.Count == 0)
return;

Debug.Assert(_numCores > 0);
String cppheckargs = CppcheckSettings.DefaultArguments;

Expand Down
7 changes: 3 additions & 4 deletions CPPCheckPlugin/CPPCheckPluginPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ private void checkCurrentProject()
foreach (dynamic file in project.Files)
{
// Only checking cpp files (performance)
dynamic fileType = file.FileType;
Type fileTypeEnumType = fileType.GetType();
var fileTypeEnumConstant = Enum.GetName(fileTypeEnumType, fileType);
if (fileTypeEnumConstant == "eFileTypeCppCode")
String fileExtension = (file.Extension as String).ToLower();
if (fileExtension == ".cpp" || fileExtension == ".cxx" || fileExtension == ".c" || fileExtension == ".c++" || fileExtension == ".cc" || fileExtension == ".cp")
{
if (!(file.Name.StartsWith("moc_") && file.Name.EndsWith(".cpp")) && !(file.Name.StartsWith("ui_") && file.Name.EndsWith(".h")) && !(file.Name.StartsWith("qrc_") && file.Name.EndsWith(".cpp"))) // Ignoring Qt MOC and UI files
{
Expand All @@ -136,6 +134,7 @@ private void checkCurrentProject()
files.Add(f);
}
}

}
break; // Only checking one project at a time for now
}
Expand Down

0 comments on commit 8d8a04e

Please sign in to comment.