Skip to content
This repository was archived by the owner on Aug 9, 2025. It is now read-only.

Commit 8d8a04e

Browse files
author
VioletGiraffe
committed
VS2013 bugfix - FileType is no longer present, using extension to determine C++ source files instead
1 parent bab68ef commit 8d8a04e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CPPCheckPlugin/AnalyzerCppcheck.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class AnalyzerCppcheck : ICodeAnalyzer
1212
public override void analyze(List<SourceFile> filesToAnalyze, OutputWindowPane outputWindow, bool is64bitConfiguration,
1313
bool isDebugConfiguration, bool bringOutputToFrontAfterAnalysis)
1414
{
15+
if (filesToAnalyze.Count == 0)
16+
return;
17+
1518
Debug.Assert(_numCores > 0);
1619
String cppheckargs = CppcheckSettings.DefaultArguments;
1720

CPPCheckPlugin/CPPCheckPluginPackage.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,8 @@ private void checkCurrentProject()
124124
foreach (dynamic file in project.Files)
125125
{
126126
// Only checking cpp files (performance)
127-
dynamic fileType = file.FileType;
128-
Type fileTypeEnumType = fileType.GetType();
129-
var fileTypeEnumConstant = Enum.GetName(fileTypeEnumType, fileType);
130-
if (fileTypeEnumConstant == "eFileTypeCppCode")
127+
String fileExtension = (file.Extension as String).ToLower();
128+
if (fileExtension == ".cpp" || fileExtension == ".cxx" || fileExtension == ".c" || fileExtension == ".c++" || fileExtension == ".cc" || fileExtension == ".cp")
131129
{
132130
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
133131
{
@@ -136,6 +134,7 @@ private void checkCurrentProject()
136134
files.Add(f);
137135
}
138136
}
137+
139138
}
140139
break; // Only checking one project at a time for now
141140
}

0 commit comments

Comments
 (0)