Commit Graph

22 Commits

Author SHA1 Message Date
Jade
043c155087 Fix a few clangd warnings (#7335) 2024-11-05 09:47:54 -07:00
Ryan Blue
496e7c1bba [hal] Refactor C++ handle closing; check for invalid handle before closing (#7016)
Adds a close function pointer template parameter to hal::Handle.  This allows default destructors in many places.
The status parameter has been removed from close functions; in most places it was not used. Where it was, an error is printed instead.
2024-09-07 10:58:15 -07:00
Jade
5dcaa6d671 [wpilibc] Add FRC_ReportWarning (#6681) 2024-07-27 20:20:08 -07:00
Tyler Veness
2bb1409b82 Clean up Java style (#5990)
Also make equivalent changes in C++ where applicable.

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2023-12-03 16:21:32 -08:00
Tyler Veness
1fc098e696 Enable log macros to work with no args (#4475)
This is enabled by the C++20 __VA_OPT__ feature.
Uses of "{}" format string were updated.
Some warning suppressions were required for older clang versions.
Also improve codegen of wpi::Logger::Log(), frc::ReportError(), and frc::MakeError();
these generate better and less redundant code if they use fmt::string_view for the
format string instead of templating on it.
2022-10-19 10:49:27 -07:00
Tyler Veness
151dabb2af [wpiutil] Upgrade to fmt 9.0.0 (#4337)
fmt removed fmt::make_args_checked since it's no longer needed for
constexpr format string checks.

fmt deprecated implicit conversions from enums to integers in format
arguments, so I added explicit static casts.
2022-08-16 15:35:26 -07:00
Kevin-OConnor
b85c24a79c [wpilib] Add warning about onboard I2C (#3842) 2021-12-30 13:13:03 -08:00
PJ Reiniger
2edd510ab7 [sim] Add sim wrappers for sensors that use SimDevice (#3517) 2021-08-20 23:19:59 -07:00
Peter Johnson
831c10bdfc [wpilibc] Errors: Use fmtlib 2021-05-25 10:04:32 -07:00
Peter Johnson
8d961dfd25 [wpilibc] Remove ErrorBase (#3306)
Replace with new exception-based error reporting, consistent with Java.
This also builds stacktraces into the reporting/exceptions.
2021-04-18 20:35:29 -07:00
Peter Johnson
2aed432b4b Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java.
Also update clang-format settings to always add a line break (even if no braces are used).
2020-12-28 12:58:06 -08:00
Peter Johnson
8f1f64ffb6 Remove year from file copyright message (NFC) (#2972)
Also update copyright to include "and other WPILib contributors" and clarify
license referral language to not be restricted to FIRST teams.
2020-12-26 14:12:05 -08:00
Thad House
9bcff37b93 Add HAL specific version of wpi_setError (#2055)
Cleans up error writing, and allows fewer headers to be included in many of the wpilibc cpp files.

This removes all usages of the hal/HAL.h header.
2019-11-08 22:53:20 -08:00
Peter Johnson
a0be07c370 Refactor HAL handle move construction/assignment (#1845)
A templated hal::Handle class is used to wrap handles to make them move-only.
This eliminates a lot of boilerplate move constructor/assignment code
in the main WPILib classes.  HAL_SPIPort and HAL_I2CPort are also wrapped.

The wrapper class does not implement destruction.  This would require the
wrapper class to be handle-specific (rather than generic) and would result
in more code added than it removed, plus would add header dependencies on
more HAL headers.  In addition, some HAL handle release functions are more
complex (e.g. have return values) and can't be easily mapped to a destructor.
2019-08-25 18:42:00 -07:00
Tyler Veness
1aa8446725 Add move constructors and assignment operators to wpilibc (#1314)
Fixes #898.
2018-09-24 00:08:25 -07:00
Tyler Veness
d89b7dd412 Move CameraServer and WPILib headers into their own folder
The old headers were moved into folders because doing so avoids polluting
the system include directories.

Folder names were also normalized to lowercase.
2018-07-22 19:40:57 -07:00
Tyler Veness
8c680a26f8 Moved C++ comments from source files to headers (#1111)
Also sorted functions in C++ sources to match order in related headers.
2018-05-31 20:47:15 -07:00
Tyler Veness
0ef9803363 Update copyright year to 2018 (#864)
Also fix a few files with incorrect line endings.
2018-01-02 11:20:21 -06:00
Tyler Veness
c663d7cd16 Reflowed comments and removed commented out code (#735) 2017-11-16 00:33:51 -08:00
Tyler Veness
6e4f66cc8b Classify other libraries' headers properly and fix committed formatting issues (#620) 2017-08-27 00:11:52 -07:00
Tyler Veness
f151892db5 Contents of copyright line now has more standard ordering (#585) 2017-08-24 00:06:13 -05:00
Thad House
e1195e8b9d Update to 2018_v4 image and new build system. (#598)
* Revert "Force OpenCV to 3.1.0 (#602)"

This reverts commit 50ed55e8e2.

* Removes Simulation

* Removes old build system

* Removes old gtest

* Adds new gmock and gtest

* Updates to new ni-libraries

* removes MyRobot (to be replaced)

* moves files to new location

* Adds new sim backend and new test executables

* updates .styleguide and .gitignore

* Changes cpp WPILibVersion to a function

MSVC throws an AV with the old version.

* Disables USBCamera on all systems except for linux

* 2018 NI Libraries

* New build system
2017-08-18 21:35:53 -07:00