tree-wide: use our memset() macros instead of memset() itself

This commit is contained in:
Lennart Poettering
2014-12-11 16:58:45 +01:00
parent f7340ab269
commit eccaf89933
5 changed files with 7 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ int sd_icmp6_nd_set_mac(sd_icmp6_nd *nd, const struct ether_addr *mac_addr) {
if (mac_addr)
memcpy(&nd->mac_addr, mac_addr, sizeof(nd->mac_addr));
else
memset(&nd->mac_addr, 0x00, sizeof(nd->mac_addr));
zero(nd->mac_addr);
return 0;

View File

@@ -3184,7 +3184,7 @@ static int screen_TBC(term_screen *screen, const term_seq *seq) {
break;
case 3:
if (screen->page->width > 0)
memset(screen->tabs, 0, (screen->page->width + 7) / 8);
memzero(screen->tabs, (screen->page->width + 7) / 8);
break;
}

View File

@@ -482,7 +482,7 @@ static unsigned skip_free_buckets(HashmapBase *h, unsigned idx) {
}
static void bucket_mark_free(HashmapBase *h, unsigned idx) {
memset(bucket_at(h, idx), 0, hashmap_type_info[h->type].entry_size);
memzero(bucket_at(h, idx), hashmap_type_info[h->type].entry_size);
bucket_set_dib(h, idx, DIB_FREE);
}
@@ -1154,7 +1154,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) {
}
/* Zero the area of newly added entries (including the old DIB area) */
memset(bucket_at(h, old_n_buckets), 0,
memzero(bucket_at(h, old_n_buckets),
(n_buckets(h) - old_n_buckets) * hi->entry_size);
/* The upper half of the new DIB array needs initialization */
@@ -1182,7 +1182,7 @@ static int resize_buckets(HashmapBase *h, unsigned entries_add) {
new_dibs[idx] = DIB_RAW_FREE;
bucket_move_entry(h, &swap, idx, IDX_PUT);
/* bucket_move_entry does not clear the source */
memset(bucket_at(h, idx), 0, hi->entry_size);
memzero(bucket_at(h, idx), hi->entry_size);
do {
/*

View File

@@ -100,7 +100,7 @@ static void test_pty(void) {
Pty *pty;
rcvsiz = 0;
memset(rcvbuf, 0, sizeof(rcvbuf));
zero(rcvbuf);
assert_se(sd_event_default(&event) >= 0);

View File

@@ -36,7 +36,7 @@ static void test_ring(void) {
struct iovec vec[2];
int s;
memset(&r, 0, sizeof(r));
zero(r);
l = ring_peek(&r, vec);
assert_se(l == 0);