Merge wpiformat configs (#8365)

After replacing the remaining include guards with `#pragma once`, I was
able to merge all the wpiformat configs into one file in the repo root.
This should make the config easier to reason about and maintain in the
future.
This commit is contained in:
Tyler Veness
2025-11-11 22:00:42 -08:00
committed by GitHub
parent 23906ee2f7
commit 7a04d6a6a2
117 changed files with 182 additions and 873 deletions

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_CONFIGURABLESOURCEIMPL_HPP_
#define CSCORE_CONFIGURABLESOURCEIMPL_HPP_
#pragma once
#include <atomic>
#include <functional>
@@ -49,5 +48,3 @@ class ConfigurableSourceImpl : public SourceImpl {
};
} // namespace wpi::cs
#endif // CSCORE_CONFIGURABLESOURCEIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_FRAME_HPP_
#define CSCORE_FRAME_HPP_
#pragma once
#include <atomic>
#include <memory>
@@ -251,5 +250,3 @@ class Frame {
};
} // namespace wpi::cs
#endif // CSCORE_FRAME_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_HANDLE_HPP_
#define CSCORE_HANDLE_HPP_
#pragma once
#include "wpi/cs/cscore_c.h"
#include "wpi/util/Synchronization.h"
@@ -64,5 +63,3 @@ class Handle {
};
} // namespace wpi::cs
#endif // CSCORE_HANDLE_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_HTTPCAMERAIMPL_HPP_
#define CSCORE_HTTPCAMERAIMPL_HPP_
#pragma once
#include <atomic>
#include <functional>
@@ -159,5 +158,3 @@ class AxisCameraImpl : public HttpCameraImpl {
};
} // namespace wpi::cs
#endif // CSCORE_HTTPCAMERAIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_IMAGE_HPP_
#define CSCORE_IMAGE_HPP_
#pragma once
#include <string_view>
#include <vector>
@@ -130,5 +129,3 @@ class Image {
};
} // namespace wpi::cs
#endif // CSCORE_IMAGE_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_INSTANCE_HPP_
#define CSCORE_INSTANCE_HPP_
#pragma once
#include <memory>
#include <utility>
@@ -111,5 +110,3 @@ class Instance {
};
} // namespace wpi::cs
#endif // CSCORE_INSTANCE_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_JPEGUTIL_HPP_
#define CSCORE_JPEGUTIL_HPP_
#pragma once
#include <string>
#include <string_view>
@@ -26,5 +25,3 @@ bool ReadJpeg(wpi::util::raw_istream& is, std::string& buf, int* width,
int* height);
} // namespace wpi::cs
#endif // CSCORE_JPEGUTIL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_LOG_HPP_
#define CSCORE_LOG_HPP_
#pragma once
#include <string_view>
@@ -85,5 +84,3 @@ inline void NamedLog(wpi::util::Logger& logger, unsigned int level,
#define SDEBUG4(format, ...) \
SLOG(::wpi::util::WPI_LOG_DEBUG4, format __VA_OPT__(, ) __VA_ARGS__)
#endif
#endif // CSCORE_LOG_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_MJPEGSERVERIMPL_HPP_
#define CSCORE_MJPEGSERVERIMPL_HPP_
#pragma once
#include <atomic>
#include <memory>
@@ -63,5 +62,3 @@ class MjpegServerImpl : public SinkImpl {
};
} // namespace wpi::cs
#endif // CSCORE_MJPEGSERVERIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_NETWORKLISTENER_HPP_
#define CSCORE_NETWORKLISTENER_HPP_
#pragma once
#include <memory>
@@ -27,5 +26,3 @@ class NetworkListener {
};
} // namespace wpi::cs
#endif // CSCORE_NETWORKLISTENER_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_NOTIFIER_HPP_
#define CSCORE_NOTIFIER_HPP_
#pragma once
#include <functional>
#include <utility>
@@ -89,5 +88,3 @@ class Notifier
};
} // namespace wpi::cs
#endif // CSCORE_NOTIFIER_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_PROPERTYCONTAINER_HPP_
#define CSCORE_PROPERTYCONTAINER_HPP_
#pragma once
#include <atomic>
#include <cstddef>
@@ -125,5 +124,3 @@ class PropertyContainer {
};
} // namespace wpi::cs
#endif // CSCORE_PROPERTYCONTAINER_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_PROPERTYIMPL_HPP_
#define CSCORE_PROPERTYIMPL_HPP_
#pragma once
#include <string>
#include <string_view>
@@ -49,5 +48,3 @@ class PropertyImpl {
};
} // namespace wpi::cs
#endif // CSCORE_PROPERTYIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_RAWSINKIMPL_HPP_
#define CSCORE_RAWSINKIMPL_HPP_
#pragma once
#include <stdint.h>
@@ -18,6 +17,7 @@
#include "wpi/util/condition_variable.hpp"
namespace wpi::cs {
class SourceImpl;
class RawSinkImpl : public SinkImpl {
@@ -48,6 +48,5 @@ class RawSinkImpl : public SinkImpl {
std::thread m_thread;
std::function<void(uint64_t time)> m_processFrame;
};
} // namespace wpi::cs
#endif // CSCORE_RAWSINKIMPL_HPP_
} // namespace wpi::cs

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_RAWSOURCEIMPL_HPP_
#define CSCORE_RAWSOURCEIMPL_HPP_
#pragma once
#include <atomic>
#include <functional>
@@ -33,5 +32,3 @@ class RawSourceImpl : public ConfigurableSourceImpl {
};
} // namespace wpi::cs
#endif // CSCORE_RAWSOURCEIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_SINKIMPL_HPP_
#define CSCORE_SINKIMPL_HPP_
#pragma once
#include <memory>
#include <string>
@@ -73,5 +72,3 @@ class SinkImpl : public PropertyContainer {
};
} // namespace wpi::cs
#endif // CSCORE_SINKIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_SOURCEIMPL_HPP_
#define CSCORE_SOURCEIMPL_HPP_
#pragma once
#include <atomic>
#include <cstddef>
@@ -194,5 +193,3 @@ class SourceImpl : public PropertyContainer {
};
} // namespace wpi::cs
#endif // CSCORE_SOURCEIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_TELEMETRY_HPP_
#define CSCORE_TELEMETRY_HPP_
#pragma once
#include "wpi/cs/cscore_cpp.hpp"
#include "wpi/util/SafeThread.hpp"
@@ -42,5 +41,3 @@ class Telemetry {
};
} // namespace wpi::cs
#endif // CSCORE_TELEMETRY_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_UNLIMITEDHANDLERESOURCE_HPP_
#define CSCORE_UNLIMITEDHANDLERESOURCE_HPP_
#pragma once
#include <memory>
#include <span>
@@ -190,5 +189,3 @@ UnlimitedHandleResource<THandle, TStruct, typeValue, TMutex>::FindIf(F func) {
}
} // namespace wpi::cs
#endif // CSCORE_UNLIMITEDHANDLERESOURCE_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_USBCAMERALISTENER_HPP_
#define CSCORE_USBCAMERALISTENER_HPP_
#pragma once
#include <memory>
@@ -27,5 +26,3 @@ class UsbCameraListener {
};
} // namespace wpi::cs
#endif // CSCORE_USBCAMERALISTENER_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_C_UTIL_HPP_
#define CSCORE_C_UTIL_HPP_
#pragma once
#include <cstring>
#include <string_view>
@@ -18,5 +17,3 @@ inline void ConvertToC(struct WPI_String* output, std::string_view str) {
}
} // namespace wpi::cs
#endif // CSCORE_C_UTIL_HPP_

View File

@@ -2,8 +2,7 @@
// http://stackoverflow.com/questions/21028299/is-this-behavior-of-vectorresizesize-type-n-under-c11-and-boost-container
// Credits: Casey and Howard Hinnant
#ifndef CSCORE_DEFAULT_INIT_ALLOCATOR_HPP_
#define CSCORE_DEFAULT_INIT_ALLOCATOR_HPP_
#pragma once
#include <memory>
#include <utility>
@@ -37,5 +36,3 @@ class default_init_allocator : public A {
};
} // namespace wpi::cs
#endif // CSCORE_DEFAULT_INIT_ALLOCATOR_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_WPI_CS_CSCORE_H_
#define CSCORE_WPI_CS_CSCORE_H_
#pragma once
/* C API */
#include "wpi/cs/cscore_c.h"
@@ -13,5 +12,3 @@
#include "wpi/cs/cscore_cpp.hpp"
#include "wpi/cs/cscore_oo.hpp"
#endif /* __cplusplus */
#endif // CSCORE_WPI_CS_CSCORE_H_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_WPI_CS_CSCORE_C_H_
#define CSCORE_WPI_CS_CSCORE_C_H_
#pragma once
#include <stdint.h>
@@ -527,5 +526,3 @@ struct WPI_String* CS_GetNetworkInterfaces(int* count);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // CSCORE_WPI_CS_CSCORE_C_H_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_WPI_CS_CSCORE_CPP_HPP_
#define CSCORE_WPI_CS_CSCORE_CPP_HPP_
#pragma once
#include <stdint.h>
@@ -456,5 +455,3 @@ std::vector<std::string> GetNetworkInterfaces();
// Disable uninitialized variable warnings
#pragma warning(pop)
#endif
#endif // CSCORE_WPI_CS_CSCORE_CPP_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_WPI_CS_CSCORE_CV_HPP_
#define CSCORE_WPI_CS_CSCORE_CV_HPP_
#pragma once
#include <functional>
@@ -432,5 +431,3 @@ inline WPI_TimestampSource CvSink::LastFrameTimeSource() {
}
} // namespace wpi::cs
#endif // CSCORE_WPI_CS_CSCORE_CV_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_WPI_CS_CSCORE_OO_HPP_
#define CSCORE_WPI_CS_CSCORE_OO_HPP_
#pragma once
#include <functional>
#include <initializer_list>
@@ -1578,5 +1577,3 @@ class VideoListener {
/** @} */
} // namespace wpi::cs
#endif // CSCORE_WPI_CS_CSCORE_OO_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_WPI_CS_CSCORE_RAW_H_
#define CSCORE_WPI_CS_CSCORE_RAW_H_
#pragma once
#include <functional>
@@ -239,5 +238,3 @@ inline uint64_t RawSink::GrabFrameLastTime(wpi::util::RawFrame& image,
} // namespace wpi::cs
#endif
#endif // CSCORE_WPI_CS_CSCORE_RAW_H_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_USBCAMERABUFFER_HPP_
#define CSCORE_USBCAMERABUFFER_HPP_
#pragma once
#include <sys/mman.h>
@@ -51,5 +50,3 @@ class UsbCameraBuffer {
};
} // namespace wpi::cs
#endif // CSCORE_USBCAMERABUFFER_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_USBCAMERAIMPL_HPP_
#define CSCORE_USBCAMERAIMPL_HPP_
#pragma once
#include <linux/videodev2.h>
@@ -178,5 +177,3 @@ class UsbCameraImpl : public SourceImpl {
};
} // namespace wpi::cs
#endif // CSCORE_USBCAMERAIMPL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_USBCAMERAPROPERTY_HPP_
#define CSCORE_USBCAMERAPROPERTY_HPP_
#pragma once
#include <linux/videodev2.h>
@@ -74,5 +73,3 @@ class UsbCameraProperty : public PropertyImpl {
};
} // namespace wpi::cs
#endif // CSCORE_USBCAMERAPROPERTY_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_USBUTIL_HPP_
#define CSCORE_USBUTIL_HPP_
#pragma once
#include <string>
@@ -20,5 +19,3 @@ int CheckedIoctl(int fd, unsigned long req, void* data, // NOLINT(runtime/int)
CheckedIoctl(fd, req, data, #req, __FILE__, __LINE__, true)
} // namespace wpi::cs
#endif // CSCORE_USBUTIL_HPP_

View File

@@ -2,8 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#ifndef CSCORE_USBCAMERAIMPL_HPP_
#define CSCORE_USBCAMERAIMPL_HPP_
#pragma once
#include <windows.h>
#include <dbt.h>
@@ -174,5 +173,3 @@ class UsbCameraImpl : public SourceImpl,
};
} // namespace wpi::cs
#endif // CSCORE_USBCAMERAIMPL_HPP_