Commit Graph

12 Commits

Author SHA1 Message Date
Wyatt Hepler
6d1a6c6939 pw_span: Move pw_string, pw_unit_test to std::span
- Update pw_string and the test framework to std::span.
- Have pw_string pass std::span by value, for consistency with other
  uses in Pigweed.
- Recommend using template specializations instead of overloads for
  custom ToString implementations. Template specializations are
  preferred because the main ToString definition is a template.

Change-Id: Ib67c6bce1752c4a90e2138bdb1f20c6671f55d50
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12841
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-06-23 20:45:28 +00:00
Armando Montanez
82bbce4aeb Remove legacy_target.gni
Transition to args is done, so this import is no longer needed.

Change-Id: Id42e06ec9fcc16eace2cc7ef51a5dacaf012147a
2020-06-16 09:50:59 -07:00
Armando Montanez
fb3d3fba79 Don't declare pigweed variables as globals
Require targets to explicitly import pigweed variable definitions. This
moves out some necessary logic from the BUILDCONFIG.gn file.

Change-Id: If9c9fe5a680cc9d897a0e8a55889873be618ed84
2020-06-16 09:50:59 -07:00
Alexei Frolov
edd2f148be pw_build: Switch to pw_* target types
This change replaces the implicit overrides of the default GN target
types in BUILDCONFIG.gn with explicit pw_* versions. This is done to
allow Pigweed to build within larger GN projects without modifying their
BUILDCONFIG files.

Change-Id: I1d1e41d5e9bde8fe076f7031f3c2b98b9630ff70
2020-06-16 09:50:59 -07:00
Rob Mohr
044065e40a roll: clang
From: git_revision:65f58878e72a40d68ef3899c766846ee9ec7cf29
To: git_revision:dd484baffdf4a92e564c38a17d35a742e633b0e0

CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: Id143184f2eb6ca9bdd7f71d72bf03c57459e768c
2020-05-31 08:19:36 -07: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
2596fe5418 pw_string: Rename va_list Format to FormatVaList
On Windows, sometimes the va_list overload would be used when formatting
with a single argument. To avoid potential conflicts like these, the
va_list versions of string::Format and StringBuilder::Format are renamed
to FormatVaList.

Change-Id: Id29fae21b13ed420b13841a479e3748a1d3b91ce
2020-01-24 22:53:22 +00:00
Wyatt Hepler
becb431e5f Apply pw format to the repository
Change-Id: I3c8e4f956dfe6c9e81d3069f72c30c5950852074
2019-12-05 09:31:11 -08:00
Rob Mohr
416af48496 Config bazel for pw_bloaty and size_report.
Fill out pw_bloaty/BUILD and add pw_string/size_report/BUILD.

Change-Id: I5ff98de0a452491cdff595ad56ee7365f40590dd
2019-12-04 23:21:51 +00:00
Wyatt Hepler
1a96094ce6 Fix copyright notices
- Add missing copright header in conf.py.
- Fix inconsistent copyright notice line breaking.

Change-Id: Ib78f7768643069c49ff986a48a176df9fd06e891
2019-11-27 22:34:02 +00:00
Wyatt Hepler
fe85de25cf pw_string: start docs; StringBuilder size report
Change-Id: Id1dbc070b14a85aeb782606e85d566ed0347fcd4
2019-11-26 21:27:22 +00:00
Wyatt Hepler
8a823ceebb Size report for pw::string::Format
Add size report comparing pw::string::Format to std::snprintf.

Report with arm-none-eabi-gcc at -Os:

            Using pw::string::Format instead of snprintf
            ────────────────────────────────────────────
┌────────────────────────────┬───────────┬────────┬───────┬────────┐
│            Label           │  Segment  │ Before │ Delta │  After │
├════════════════════════════┼═══════════┼════════┼═══════┼════════┤
│    One string, return size │ SEG FLASH │  2,840 │   +80 │  2,920 │
├────────────────────────────┼───────────┼────────┼───────┼────────┤
│ Ten strings, handle errors │     (all) │ (same) │     0 │ (same) │
├────────────────────────────┼───────────┼────────┼───────┼────────┤
│   Fifty calls, same buffer │ SEG FLASH │  3,816 │   -72 │  3,744 │
└────────────────────────────┴───────────┴────────┴───────┴────────┘

Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-19 12:58:31 -08:00