Commit Graph

30 Commits

Author SHA1 Message Date
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
Peter Johnson
acfbb1a44a [ntcore] DispatcherBase::Flush: Use wpi::Now()
This is faster on some platforms than steady_clock, and will more
consistently support simulation timing.
2020-12-21 09:53:45 -08:00
Peter Johnson
d85a6d8fe4 [ntcore] Reduce limit on flush and update rate to 5 ms 2020-12-21 09:53:45 -08:00
sciencewhiz
f758af826d [wpilib] Use misspell to find more spelling errors (NFC) (#2679) 2020-09-02 19:41:05 -07:00
Tyler Veness
22c0e2813a [build] Upgrade CI to clang-format 10.0 (#1961)
MacOS no longer ships 6.0, and Arch Linux's mesa GPU drivers are no longer compatible with LLVM 6.0.
2020-06-27 20:39:00 -07:00
Thad House
2b188b54d8 [ntcore] Always show StartLocal instances as connected (#2462)
This is useful for testing things that check IsConnected().
2020-04-02 17:58:07 -07:00
Peter Johnson
6ea13ea8f3 ntcore: Add support for local-only operation (#2204)
StartLocal() causes future calls to StartServer() or StartClient() to have
no effect. StopLocal() re-enables these calls.
2019-12-29 14:56:41 -06:00
Thad House
bc59db5e6f Rename DEBUG macro to DEBUG0 (#1871)
This avoids conflicts with the platform DEBUG macro on some platforms.
2019-09-06 20:45:52 -05:00
Tyler Veness
62be0392b6 Replace std::lock_guard and std::lock with std::scoped_lock (#1758)
std::scoped_lock was introduced in C++17 and is strictly better than
std::lock_guard as it supports locking any number of mutexes safely.
It's also easier to use than std::lock for locking multiple mutexes at
once.
2019-07-08 22:58:39 -07:00
Tyler Veness
841ef5d739 Remove template types from lock RAII wrapper usages (#1756)
C++17 has template type autodeduction. These wrappers include
std::lock_guard and std::unique_lock.
2019-07-07 19:17:14 -07:00
Thad House
221011494d Update for C++17 and fix MSVC warnings (#1694)
* Update MSVC arguments
* Fix json allocator
* Fix simulation diamond
* Bump gtest
* Remove empty varargs in unit tests
* Replace test case with test suite
* Remove deprecation warning in optional
* Remove need for NOMIXMAX to be defined in wpilib headers
2019-05-31 15:43:32 -05:00
Tyler Veness
f432f65bef Update copyright year in license to 2019 (#1524)
Also update clang-format to 6.0.
2019-05-17 17:35:09 -07:00
Peter Johnson
2de3bf7f58 Update LLVM from stable upstream (#1653)
Replace CheckedMalloc with upstream safe_malloc.
2019-04-27 20:33:08 -07:00
Peter Johnson
0e1f9c2ed2 ntcore: Read ini escaped quotes correctly (#1579) 2019-02-01 23:01:00 -08:00
Peter Johnson
ceed1d74dc ntcore: Strip whitespace from IP addresses (#1516) 2018-12-29 14:47:25 -08:00
Thad House
0c3b488e18 Make ntcore instances not smart pointers (#1485)
During static shutdown, the instances hang on windows 7, so let them leak instead.
2018-12-13 21:33:58 -08:00
Thad House
3d546428ab Add missing SubTableListener methods to C++ NetworkTable (#1465) 2018-12-06 23:27:49 -08:00
Austin Schuh
ac751d3224 Fix unused variable warnings in ntcore (#1416)
This avoids -Wextra warnings.
2018-11-09 20:02:58 -08:00
Peter Johnson
18c8cce6a7 SafeThread: Avoid use-after-free risk in thread shutdown (#1355)
Use shared_ptr to keep data alive until the thread has terminated.
2018-10-05 16:32:43 -07:00
Sam Carlberg
175c6c1f01 Add fluent builders for more flexibly adding data to Shuffleboard (#1022) 2018-09-28 01:18:18 -07:00
Peter Johnson
7b95c5341a ntcore: Change params in Java RpcAnswer from String to byte[] (#1280)
The underlying protocol uses raw bytes, so they should not be required to be
a valid string.
2018-08-20 13:07:13 -07:00
Thad House
86285b427f Removes MSVC 2013 Shims (#1130)
We have done things recently that have broken any builds before VS 2015
2018-06-03 17:16:51 -07:00
Thad House
8eafe7f325 Solve some safety issues with RPCs (#1127)
Java would never properly dispose, and C++'s were easy to respond after disposing.
We now return a bool if the call was successful or not.
2018-06-03 08:43:48 -07:00
Peter Johnson
664a3c2463 ntcore: Fix C API polling array returns. (#1126)
The implementation of ConvertToC for arrays was broken.  Also change it
to be templated on the returned array type, rather than passing the array.
This makes the uses a bit more clean.
2018-06-01 13:45:33 -07:00
Thad House
307da3ad2d Simplify allocation of JNI global classes and exceptions (#1110)
Helps ensure they get freed properly (We have had a few cases before where this wasn't the case).
2018-05-29 15:44:16 -07:00
Peter Johnson
a2ecb1027a Update LLVM to latest upstream. (#1080)
Also change header guards to WPI header guards.
Remove StringRef::c_str() customization, replacing the handful of uses with Twine or SmallString.
TCPStream: Include errno.h and make Windows includes lowercase for consistency.

Upstream LLVM version: eb4186cca7924fb1706357545311a2fa3de40c59
2018-05-22 23:31:08 -07:00
Tyler Veness
6729a7d6b1 Run wpiformat on merged repo (#1021) 2018-05-13 17:09:56 -07:00
Peter Johnson
7a34f5d17d Check for nullptr return from malloc, calloc, and realloc. (#1023)
These are used in ntcore and cscore.  Add inline null-checking versions
to wpi/memory.h and use them throughout.
2018-05-04 17:55:46 -07:00
Peter Johnson
f84018af5f Move entirety of llvm namespace to wpi namespace.
During shared library loading, a different libLLVM can be pulled in, causing
llvm symbols from dependent libraries to resolve to that library instead of
this one. This has been seen in the wild with the Mesa OpenGL implementation
in JavaFX applications (see wpilibsuite/shuffleboard#361).

This is clearly a very breaking change. For some level of backwards
compatibility, a namespace alias from llvm to wpi is performed in the "llvm"
headers.  Unfortunately, forward declarations of llvm classes will still break,
but compilers seem to generate clear error messages in those cases
("namespace alias 'llvm' not allowed here, assuming 'wpi'").

This change also moves all the wpiutil headers to a single "wpi" subdirectory
from the previously split "llvm", "support", "tcpsockets", and "udpsockets".
Shim headers will be added for backwards compatibility in a later commit.
2018-04-30 10:22:54 -07:00
Peter Johnson
7210a8fd28 Prepare ntcore for merge into allwpilib. 2018-04-27 19:57:35 -07:00