From 7416ebd7c6591c95a0ae79be8ed10203714d385d Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Wed, 29 Feb 2012 17:04:04 +0000
Subject: [PATCH] Update StaticAnalysisTest to check for missing header files.
 Fix found incorrect header file paths in the demos and projects.

---
 BuildTests/StaticAnalysisTest/makefile               | 12 ++++++++----
 .../ClassDriver/MassStorage/Lib/DataflashManager.h   |  4 ++--
 Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h      |  4 ++--
 .../MassStorageKeyboard/Lib/DataflashManager.h       |  4 ++--
 .../ClassDriver/MassStorageKeyboard/Lib/SCSI.h       |  4 ++--
 .../VirtualSerialMassStorage/Lib/DataflashManager.h  |  4 ++--
 .../ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h  |  4 ++--
 .../Incomplete/Sideshow/Lib/SideshowCommands.h       |  2 +-
 .../LowLevel/MassStorage/Lib/DataflashManager.h      |  4 ++--
 Demos/Device/LowLevel/MassStorage/Lib/SCSI.h         |  4 ++--
 Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h      |  2 +-
 .../LowLevel/MassStorageHost/Lib/MassStoreCommands.h |  2 +-
 .../StandaloneProgrammer/Lib/DataflashManager.h      |  4 ++--
 Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h  |  4 ++--
 Projects/TempDataLogger/Lib/DataflashManager.h       |  4 ++--
 Projects/Webserver/Lib/DataflashManager.h            |  2 +-
 Projects/Webserver/Lib/uIPManagement.h               |  8 ++++----
 17 files changed, 38 insertions(+), 34 deletions(-)

diff --git a/BuildTests/StaticAnalysisTest/makefile b/BuildTests/StaticAnalysisTest/makefile
index 766bf080c..44c7d5f82 100644
--- a/BuildTests/StaticAnalysisTest/makefile
+++ b/BuildTests/StaticAnalysisTest/makefile
@@ -9,15 +9,19 @@
 # Static anlysis of the entire LUFA source tree, using the free cross-platform "cppcheck" tool.
 
 # Path to the root of the LUFA tree to scan
-LUFA_ROOT_PATH   = ../../
+LUFA_ROOT_PATH    = ../../
 
 # Filenames or directories (including fragments) to exclude from the analysis
-EXCLUDE_LIST     = HostLoaderApp/ FATFs/ PetiteFATFs/ uip/
+EXCLUDE_LIST      = HostLoaderApp/ FATFs/ PetiteFATFs/ uip/
 
 # Output message template for found warnings and errors
-MESSAGE_TEMPLATE = "{file}({line}): {severity} ({id}): {message}"
+MESSAGE_TEMPLATE  = "{file}({line}): {severity} ({id}): {message}"
+
+# Checks to suppress so that generated warnings are discarded
+SUPPRESS_WARNINGS = variableScope unusedFunction missingInclude
 
 all:
-	cppcheck -q -f --error-exitcode=1 --inline-suppr --enable=style --suppress=variableScope --template $(MESSAGE_TEMPLATE) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)
+	cppcheck -q --std=c99 --check-config $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)
+	cppcheck -q -f --std=c99 --error-exitcode=1 --inline-suppr --enable=all $(SUPPRESS_WARNINGS:%=--suppress=%) --template $(MESSAGE_TEMPLATE) $(EXCLUDE_LIST:%=-i%) $(LUFA_ROOT_PATH)
 	
 %:
\ No newline at end of file
diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h
index 3144c87ad..18606eaf1 100644
--- a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h
+++ b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h
@@ -39,8 +39,8 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "MassStorage.h"
-		#include "Descriptors.h"
+		#include "../MassStorage.h"
+		#include "../Descriptors.h"
 
 		#include <LUFA/Common/Common.h>
 		#include <LUFA/Drivers/USB/USB.h>
diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h
index 635bd067f..d44662382 100644
--- a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h
+++ b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h
@@ -42,8 +42,8 @@
 
 		#include <LUFA/Drivers/USB/USB.h>
 
-		#include "MassStorage.h"
-		#include "Descriptors.h"
+		#include "../MassStorage.h"
+		#include "../Descriptors.h"
 		#include "DataflashManager.h"
 
 	/* Macros: */
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h
index 8ef430aa5..f7552dc4a 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h
@@ -39,8 +39,8 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "MassStorageKeyboard.h"
-		#include "Descriptors.h"
+		#include "../MassStorageKeyboard.h"
+		#include "../Descriptors.h"
 
 		#include <LUFA/Common/Common.h>
 		#include <LUFA/Drivers/USB/USB.h>
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h
index cc4581dea..5c3d3bf97 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h
@@ -42,8 +42,8 @@
 
 		#include <LUFA/Drivers/USB/USB.h>
 
-		#include "MassStorageKeyboard.h"
-		#include "Descriptors.h"
+		#include "../MassStorageKeyboard.h"
+		#include "../Descriptors.h"
 		#include "DataflashManager.h"
 
 	/* Macros: */
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h
index dbcbb5dde..1d1238658 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h
@@ -39,8 +39,8 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "VirtualSerialMassStorage.h"
-		#include "Descriptors.h"
+		#include "../VirtualSerialMassStorage.h"
+		#include "../Descriptors.h"
 
 		#include <LUFA/Common/Common.h>
 		#include <LUFA/Drivers/USB/USB.h>
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h
index 214ddafb5..83d5646c4 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h
@@ -42,8 +42,8 @@
 
 		#include <LUFA/Drivers/USB/USB.h>
 
-		#include "VirtualSerialMassStorage.h"
-		#include "Descriptors.h"
+		#include "../VirtualSerialMassStorage.h"
+		#include "../Descriptors.h"
 		#include "DataflashManager.h"
 
 	/* Macros: */
diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h
index 963164bc9..4f4b5c170 100644
--- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h
+++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h
@@ -36,7 +36,7 @@
 		#include <stdbool.h>
 		#include <string.h>
 
-		#include "Sideshow.h"
+		#include "../Sideshow.h"
 		#include "SideshowCommon.h"
 		#include "SideshowApplications.h"
 		#include "SideshowContent.h"
diff --git a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h
index ab68049f9..d70a86c19 100644
--- a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h
+++ b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h
@@ -39,8 +39,8 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "MassStorage.h"
-		#include "Descriptors.h"
+		#include "../MassStorage.h"
+		#include "../Descriptors.h"
 
 		#include <LUFA/Common/Common.h>
 		#include <LUFA/Drivers/USB/USB.h>
diff --git a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h
index 244daaa91..b0065cd13 100644
--- a/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h
+++ b/Demos/Device/LowLevel/MassStorage/Lib/SCSI.h
@@ -44,8 +44,8 @@
 		#include <LUFA/Drivers/USB/USB.h>
 		#include <LUFA/Drivers/Board/LEDs.h>
 
-		#include "MassStorage.h"
-		#include "Descriptors.h"
+		#include "../MassStorage.h"
+		#include "../Descriptors.h"
 		#include "DataflashManager.h"
 
 	/* Macros: */
diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h
index cd2ff5578..8bf8bdfaf 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h
+++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h
@@ -40,7 +40,7 @@
 		#include <avr/io.h>
 		#include <stdbool.h>
 
-		#include "RNDISEthernet.h"
+		#include "../RNDISEthernet.h"
 		#include "Ethernet.h"
 
 	/* External Variables: */
diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
index 5e4e04da4..5b050e8b1 100644
--- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
+++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
@@ -39,7 +39,7 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "MassStorageHost.h"
+		#include "../MassStorageHost.h"
 
 		#include <LUFA/Drivers/USB/USB.h>
 
diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h b/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h
index f470907e6..d353477da 100644
--- a/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h
+++ b/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h
@@ -39,8 +39,8 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "StandaloneProgrammer.h"
-		#include "Descriptors.h"
+		#include "../StandaloneProgrammer.h"
+		#include "../Descriptors.h"
 
 		#include <LUFA/Drivers/USB/USB.h>
 		#include <LUFA/Drivers/Board/Dataflash.h>
diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h
index 955a8fec9..a0940a796 100644
--- a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h
+++ b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h
@@ -42,8 +42,8 @@
 
 		#include <LUFA/Drivers/USB/USB.h>
 
-		#include "StandaloneProgrammer.h"
-		#include "Descriptors.h"
+		#include "../StandaloneProgrammer.h"
+		#include "../Descriptors.h"
 		#include "DataflashManager.h"
 
 	/* Macros: */
diff --git a/Projects/TempDataLogger/Lib/DataflashManager.h b/Projects/TempDataLogger/Lib/DataflashManager.h
index f93d50589..5d598cad5 100644
--- a/Projects/TempDataLogger/Lib/DataflashManager.h
+++ b/Projects/TempDataLogger/Lib/DataflashManager.h
@@ -39,8 +39,8 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "TempDataLogger.h"
-		#include "Descriptors.h"
+		#include "../TempDataLogger.h"
+		#include "../Descriptors.h"
 
 		#include <LUFA/Common/Common.h>
 		#include <LUFA/Drivers/USB/USB.h>
diff --git a/Projects/Webserver/Lib/DataflashManager.h b/Projects/Webserver/Lib/DataflashManager.h
index bdc27a2a0..af76f7f62 100644
--- a/Projects/Webserver/Lib/DataflashManager.h
+++ b/Projects/Webserver/Lib/DataflashManager.h
@@ -39,7 +39,7 @@
 	/* Includes: */
 		#include <avr/io.h>
 
-		#include "Descriptors.h"
+		#include "../Descriptors.h"
 
 		#include <LUFA/Common/Common.h>
 		#include <LUFA/Drivers/USB/USB.h>
diff --git a/Projects/Webserver/Lib/uIPManagement.h b/Projects/Webserver/Lib/uIPManagement.h
index d51df090b..390d3c448 100644
--- a/Projects/Webserver/Lib/uIPManagement.h
+++ b/Projects/Webserver/Lib/uIPManagement.h
@@ -44,10 +44,10 @@
 		#include <uip-split.h>
 		#include <timer.h>
 
-		#include "Lib/DHCPClientApp.h"
-		#include "Lib/DHCPServerApp.h"
-		#include "Lib/HTTPServerApp.h"
-		#include "Lib/TELNETServerApp.h"
+		#include "DHCPClientApp.h"
+		#include "DHCPServerApp.h"
+		#include "HTTPServerApp.h"
+		#include "TELNETServerApp.h"
 
 	/* Macros: */
 		/** IP address that the webserver should use once connected to a RNDIS device (when DHCP is disabled). */
-- 
GitLab