When compiled with -DNDEBUG, we get warnings about set-but-unused variables.
In general, it's not something we care about, but since removing those
variables arguably makes the code nicer, let's just to it in this case.
#include "hexdecoct.h"
void initialize_libgcrypt(bool secmem) {
- const char *p;
if (gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P))
return;
- p = gcry_check_version("1.4.5");
- assert(p);
+ assert_se(gcry_check_version("1.4.5"));
/* Turn off "secmem". Clients which wish to make use of this
* feature should initialize the library manually */
static bool match_parent(sd_device_enumerator *enumerator, sd_device *device) {
const char *syspath_parent, *syspath;
Iterator i;
- int r;
assert(enumerator);
assert(device);
if (set_isempty(enumerator->match_parent))
return true;
- r = sd_device_get_syspath(device, &syspath);
- assert(r >= 0);
+ assert_se(sd_device_get_syspath(device, &syspath) >= 0);
SET_FOREACH(syspath_parent, enumerator->match_parent, i)
if (path_startswith(syspath, syspath_parent))
static int netdev_fou_tunnel_create(NetDev *netdev) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL;
uint32_t serial;
- FouTunnel *t;
int r;
assert(netdev);
-
- t = FOU(netdev);
-
- assert(t);
+ assert(FOU(netdev));
r = netdev_fill_fou_tunnel_message(netdev, &m);
if (r < 0)
}
static int netdev_wireguard_post_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
- Wireguard *w;
-
assert(netdev);
- w = WIREGUARD(netdev);
- assert(w);
+ assert(WIREGUARD(netdev));
(void) wireguard_set_interface(netdev);
resolve_endpoints(netdev);
int fstab_find_pri(const char *options, int *ret);
static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no) {
- int r;
const char *opt;
/* If first name given is last, return 1.
* If second name given is last or neither is found, return 0. */
- r = fstab_filter_options(opts, yes_no, &opt, NULL, NULL);
- assert(r >= 0);
+ assert_se(fstab_filter_options(opts, yes_no, &opt, NULL, NULL) >= 0);
return opt == yes_no;
}