Commit Graph

14 Commits

Author SHA1 Message Date
Wyatt Hepler
3c4e5de42f Add or expand docs.rst
Change-Id: I18d1529088beb41b37be00a77ba8999f6b6f810a
2020-03-05 02:00:04 +00:00
Rob Mohr
a0ba54f648 Roll GN to 239533d
This caused gn format to flag many things which were also fixed.

Change-Id: Ie1d9081a1b08047bec52c60f54d2a94366be1ba6
2020-02-28 01:33:18 +00:00
Wyatt Hepler
4681e15135 pw_varint: Make the varint tests faster
Change-Id: Icb0e3590100d56e1e4a7bf039eb9affe188c4110
2020-02-13 14:05:12 -08:00
Wyatt Hepler
588907ad42 Make span and varint C++11 compatible
Change-Id: Idb9f4e1563d4d4cfeb460b23c82d11fd9c298939
2020-01-17 15:04:43 -08:00
Wyatt Hepler
2119240da1 GN build: Override built-in targets
- Override built-in targets, which gives more flexibility than
  set_defaults.
- Provide the default C++ in the toolchain, which can be overridden by
  explicitly specifying a config on a target.
- Remove the C++17 default flags from public configs, since it is no
  longer needed.

Change-Id: If211bada971c46cef83909bf15811a4f2c1eb7fd
2020-01-16 11:41:15 -08:00
Alexei Frolov
8ecefe902b pw_varint: C support
This change exposes a subset of the pw::varint API for use in C code.

Change-Id: I7db2dd1d2622711785e23c8534de6119301c57c3
2020-01-14 00:13:55 +00:00
Alexei Frolov
5d63df9c0b
pw_varint: Expose zig-zag decoding
This change moves the ZigZagDecode function from varint.cc to varint.h
so that it is part of pw_varint's public interface.

Change-Id: I53a659f1e5c701465c277eab2082d57624c0e65c
2020-01-07 10:57:09 -08:00
Alexei Frolov
65ffd22d01 pw_varint: Rename varint functions
This change removes "Varint" from the names of the Encode and Decode
functions in the pw_varint module, as they are already namespaced by
pw::varint.

Change-Id: I8f1383e390624b677d161a2ac2a1327c5e7ba5b1
2020-01-07 18:55:55 +00:00
Alexei Frolov
311c620af6 pw_varint: use std::byte instead of uint8_t
This change switches pw_varint to using spans of std::byte instead of
uint8_t for encoding and decoding. The pw_protobuf module, which uses
pw_varint, is also updated.

A ToString formatter for std::byte is also added to pw_string (required
to use std::byte in unit test EXPECT statements).

Change-Id: I198370eecdabde32a85987dda98aed84c85b9c91
2020-01-06 19:47:54 +00:00
Wyatt Hepler
61def0a64a Bazel: Move include paths to libraries
Instead of having a global list of -I include paths, have each library
provide a -I for the public/ directory using the includes argument.

Change-Id: I2e321752906920cd94beaaab97b8796af85078e4
2020-01-06 18:41:23 +00:00
Wyatt Hepler
0fbcdfc3cd Basic CMake build
- Automatically add simple modules with pw_auto_add_simmple_module.
- Define libraries in a module with pw_add_module_library.
- Define tests and test groups with pw_add_test and
  pw_add_test_to_groups.
- Tests execute with full Ninja dependency resolution, as in the GN
  build.
- Add CMakeLists.txt for existing modules.
- Currently there is no support for targets, but these libraries would
  be trivial to integrate with an existing CMake build.

Change-Id: If73d8b61bce88f91141737eb773f1ebce3a7676e
2020-01-04 01:05:46 +00:00
Wyatt Hepler
8c493bbf76 Fix the copyright notice on a few files
Change-Id: Ieff83592399946000fc806a037b0f5ffcaa3bd10
2019-12-03 00:00:28 +00:00
Rob Mohr
3895a127c7 Fix bazel build.
pw_string/util_test.cc was not tested and pw_varint had no BUILD file.

Change-Id: Ibaf5c05d3876b6cef5eb1fc70f644f03468bca2b
2019-12-02 21:44:15 +00:00
Alexei Frolov
82d3cb35d3 pw_varint: Add varint module
This change adds a pw_varint module containing functions for encoding
and decoding variable-length integers.

Change-Id: I50bdf6d9d6762bffb93ee638683de53afed9c849
2019-12-02 18:39:29 +00:00