]> git.ipfire.org Git - thirdparty/plymouth.git/commit
ply-buffer: Fix unused-value warning
authorRay Strode <rstrode@redhat.com>
Thu, 7 Mar 2024 20:09:44 +0000 (15:09 -0500)
committerRay Strode <rstrode@redhat.com>
Thu, 7 Mar 2024 20:14:34 +0000 (15:14 -0500)
commitc65d37e4ac64e86f9570bd9aa9272a3915da136c
treeb9f3843118c05d6df7371f70ed58013c3caad938
parent18691572ee837f3903ed21b6fb17123794a47e38
ply-buffer: Fix unused-value warning

We currently get warnings during the build like

```
../src/libply/ply-buffer.h:60:20: warning: value computed is not
used [-Wunused-value]
60 |              !_ran && (*bytes = (char *) ply_buffer_get_bytes(buffer),
   |                    ^~
```

This commit changes the macro to use a GCC statement expression with
an if statement to work around the warning.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/246
src/libply/ply-buffer.h