Skip to content

Commit

Permalink
Remove DAWN_DECLARE_UNUSED
Browse files Browse the repository at this point in the history
The `DAWN_DECLARE_UNUSED` is used in three places, the majority of the
code base uses `[[maybe_unused]]`. This Cl switches those three
locations to `maybe_unused` and removes the `DAWN_DECLARE_UNUSED` define.

Change-Id: I2d74e3a2fb98543fdf92000663996e81c7e8492d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/203834
Reviewed-by: Corentin Wallez <[email protected]>
Commit-Queue: dan sinclair <[email protected]>
  • Loading branch information
dj2 authored and Dawn LUCI CQ committed Aug 26, 2024
1 parent 9b7ad9b commit 95af3b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions generator/templates/dawn/wire/WireCmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
{% endif %}

//* Returns the required transfer size for `record` in addition to the transfer structure.
DAWN_DECLARE_UNUSED size_t {{Return}}{{name}}GetExtraRequiredSize([[maybe_unused]] const {{Return}}{{name}}{{Cmd}}& record) {
[[maybe_unused]] size_t {{Return}}{{name}}GetExtraRequiredSize([[maybe_unused]] const {{Return}}{{name}}{{Cmd}}& record) {
size_t result = 0;

//* Gather how much space will be needed for the extension chain.
Expand Down Expand Up @@ -232,7 +232,7 @@

//* Serializes `record` into `transfer`, using `buffer` to get more space for pointed-to data
//* and `provider` to serialize objects.
DAWN_DECLARE_UNUSED WireResult {{Return}}{{name}}Serialize(
[[maybe_unused]] WireResult {{Return}}{{name}}Serialize(
const {{Return}}{{name}}{{Cmd}}& record,
{{Return}}{{name}}Transfer* transfer,
[[maybe_unused]] SerializeBuffer* buffer
Expand Down Expand Up @@ -331,7 +331,7 @@
//* Deserializes `transfer` into `record` getting more serialized data from `buffer` and `size`
//* if needed, using `allocator` to store pointed-to values and `resolver` to translate object
//* Ids to actual objects.
DAWN_DECLARE_UNUSED WireResult {{Return}}{{name}}Deserialize(
[[maybe_unused]] WireResult {{Return}}{{name}}Deserialize(
{{Return}}{{name}}{{Cmd}}* record,
const volatile {{Return}}{{name}}Transfer* transfer,
DeserializeBuffer* deserializeBuffer,
Expand Down
9 changes: 0 additions & 9 deletions src/dawn/common/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,6 @@
#define DAWN_UNLIKELY(x) (x)
#endif

// DAWN_DECLARE_UNUSED
//
// Prevents unused function warnings a subsequent declaration.
#if DAWN_COMPILER_IS(GCC) || DAWN_COMPILER_IS(CLANG)
#define DAWN_DECLARE_UNUSED __attribute__((unused))
#else
#define DAWN_DECLARE_UNUSED
#endif

// DAWN_NO_SANITIZE(instrumentation)
//
// Annotate a function or a global variable declaration to specify that a particular instrumentation
Expand Down

0 comments on commit 95af3b1

Please sign in to comment.