[wpilibc] Clean up include files (#2708)

Based on run of include-what-you-use.org to identify unused include files in various .h and .cpp files.

The changes mostly fall into 3 categories:
- Actually unused includes - copy-paste errors, not removing includes after cleaning up code, etc
- A too-broad include used where a more specific (and hopefully smaller) header will do
- Interface .h files including headers only needed by the .cpp implementation - moving from .h to .cpp
  will mean that code which uses the .h doesn't pay the price of processing the header file they don't need
This commit is contained in:
Kevin Jaget
2020-10-03 12:21:03 -04:00
committed by GitHub
parent 9a63cd36cd
commit fa809b2c4b
66 changed files with 72 additions and 166 deletions

View File

@@ -10,7 +10,6 @@
#include <stdint.h>
#include <hal/CANAPITypes.h>
#include <wpi/ArrayRef.h>
#include "frc/ErrorBase.h"

View File

@@ -16,11 +16,9 @@
#include <hal/DriverStationTypes.h>
#include <wpi/Twine.h>
#include <wpi/condition_variable.h>
#include <wpi/deprecated.h>
#include <wpi/mutex.h>
#include "frc/ErrorBase.h"
#include "frc/RobotState.h"
namespace frc {

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,8 +7,6 @@
#pragma once
#include <stdint.h>
#include <string>
#include <wpi/StringRef.h>
@@ -19,8 +17,6 @@
#undef GetMessage
#endif
#include "frc/Base.h"
namespace frc {
class ErrorBase;

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -11,9 +11,7 @@
#include <wpi/StringRef.h>
#include <wpi/Twine.h>
#include <wpi/mutex.h>
#include "frc/Base.h"
#include "frc/Error.h"
// Forward declared manually to avoid needing to pull in entire HAL header.

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -9,8 +9,6 @@
#include <array>
#include <wpi/deprecated.h>
#include "frc/GenericHID.h"
namespace frc {

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,8 +7,6 @@
#pragma once
#include <memory>
namespace frc {
class RobotState {

View File

@@ -7,11 +7,6 @@
#pragma once
#include <units/time.h>
#include <wpi/deprecated.h>
#include <wpi/mutex.h>
#include "frc/Base.h"
#include "frc2/Timer.h"
namespace frc {

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -11,13 +11,8 @@
* @file Contains global utility functions
*/
#include <stdint.h>
#include <string>
#include <wpi/StringRef.h>
#include <wpi/Twine.h>
#include <wpi/deprecated.h>
#define wpi_assert(condition) \
wpi_assert_impl(condition, #condition, "", __FILE__, __LINE__, __FUNCTION__)

View File

@@ -8,11 +8,8 @@
#pragma once
#include <units/time.h>
#include <wpi/deprecated.h>
#include <wpi/mutex.h>
#include "frc/Base.h"
namespace frc2 {
/**