438 Commits

Author SHA1 Message Date
Thad House
ecd376be4c Export C functions from JNI statically linked library (#1425)
The JNI libraries are useful from other tools, so they should contain the C functions.
2018-11-12 19:38:35 -08:00
Austin Schuh
ac751d3224 Fix unused variable warnings in ntcore (#1416)
This avoids -Wextra warnings.
2018-11-09 20:02:58 -08:00
Thad House
a8aacd3657 Update build setup for raspbian and debug binaries (#1384)
- Build both debug and release binaries
- Append "d" to debug libraries in the style of opencv
- Split shared and static classifiers
- Add raspbian support
2018-10-27 00:19:38 -07:00
Thad House
b9fa3a4398 Update to 2019 RoboRIO and 2019 v4 image (#1352)
Also make updates for Java 11:
* Disable errorprone plugin (currently broken on Java 11)
* Update checkstyle to 8.12
* Update pmd to 6.7.0
2018-10-07 18:11:57 -07: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
Thad House
1137582a7a Revert "Move deprecated ntcore classes to wpilibj jar (#1322)" (#1326)
This reverts commit 12c92a822d.
2018-09-21 11:32:11 -07:00
Thad House
12c92a822d Move deprecated ntcore classes to wpilibj jar (#1322)
Will allow for modularization
2018-09-20 21:50:30 -07:00
Peter Johnson
025af24523 Make NetworkTableEntry.callRpc and createRpc public (#1303) 2018-09-08 21:19:14 -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
Peter Johnson
5283726cce ntcore: Describe RPC version 0 in spec (#1279) 2018-08-20 13:06:43 -07:00
Peter Johnson
fa78f30e30 ntcore: Make protocol revision more visible in docs (#1278)
Also add author line to correct document formatting.
2018-08-19 01:38:23 -07:00
Peter Johnson
0e9172f9a7 Fix many errorprone warnings (#1247)
This fixes two real bugs:
- TimedRobot had a m_period that was hiding the IterativeRobotBase m_period
  and was not getting initialized.
- PDPSim was swapping two parameters to getCurrent()
2018-07-29 16:47:22 -07:00
Peter Johnson
9408fd5176 Add Doxygen comments for namespaces (#1245) 2018-07-29 12:49:28 -07:00
Thad House
00c2cd7dab Improve JNI loading efficiency (#1224)
A hash is stored for each native library with the name libraryName.hash.
If the library is not found on the system search path, it is extracted to a cache directory.
Extracted libraries are named with the hash appended, so the library will not be
re-extracted if one with the same hash already exists.

Hashing without the hash file requires double traversing if the file is not in the cache,
but it is still faster than creating a new file in most cases.  This won't be needed
after opencv is updated to provide a hash as well.
2018-07-29 10:20:41 -07:00
Peter Johnson
186e1dc54b ntcore: Documentation cleanups (#1237) 2018-07-28 17:41:57 -07:00
Austin Shalit
9108a93598 Switch non-integration tests to JUnit 5 (#1120) 2018-06-11 15:01:49 -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
Austin Shalit
e548a5f705 Update and enable PMD 6.3.0 (#1107) 2018-06-03 10:00:53 -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
Austin Shalit
39f80730de Disable broken ntcore tests using JUnit 5 (#1116) 2018-05-28 23:07:28 -07:00
Austin Shalit
40cc743cc7 Enable checkstyle on cscore, ntcore, wpiutil (#1032)
Also update to version 8.10.
2018-05-24 00:31:04 -04:00
Austin Shalit
ba93f79d8b Fix mac builds (#1087) 2018-05-23 21:36:43 -04:00
Thad House
cbaff52850 Implements AutoCloseable for types, replacing free() (#1048) 2018-05-22 23:33:17 -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
Thad House
f07799c67b Disables unstable and failing unit tests (#1057) 2018-05-13 21:59:45 -07:00
Tyler Veness
01d8d0c795 Moved C++ header includes out of extern "C" and added missing C header includes (#1053) 2018-05-13 19:05:39 -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
8cbfe35bd4 ntcore: Remove MSVC 2013 shim. (#1018) 2018-05-04 02:06:45 -07:00
Thad House
954f8c40f5 Adds CMake Builds (#1015) 2018-05-02 21:15:30 -07:00
Peter Johnson
1043aef7f7 ntcore: Make header actually a C header (#1007) 2018-05-01 22:51:28 -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
Thad House
7f88cf768d New 2018 and later build setup (#1001) 2018-04-29 13:29:07 -07:00
Thad House
cb2c9eb6d5 Remove gmock and builds from utility libraries (#999) 2018-04-27 22:14:26 -07:00
Peter Johnson
7210a8fd28 Prepare ntcore for merge into allwpilib. 2018-04-27 19:57:35 -07:00