From 2af099cae27fef1a57aa25d48fc915d619ea216d Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 6 Mar 2018 18:44:11 +0100 Subject: all: drop fmem{cpy,set} There is no need to explicity use the builtins. According to [1], GCC will recognize mem{cpy,set} as built-in functions, unless the corresponding -fno-builtin-* option is specified (which is not the case for netsniff-ng). [1] https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html Signed-off-by: Tobias Klauser --- trafgen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'trafgen.c') diff --git a/trafgen.c b/trafgen.c index 0996703..d9e0e0e 100644 --- a/trafgen.c +++ b/trafgen.c @@ -343,7 +343,7 @@ static void apply_csum16(int id) uint16_t sum = 0; struct csum16 *csum = &packet_dyn[id].csum[j]; - fmemset(&packets[id].payload[csum->off], 0, sizeof(sum)); + memset(&packets[id].payload[csum->off], 0, sizeof(sum)); if (unlikely((size_t) csum->to >= packets[id].len)) csum->to = packets[id].len - 1; @@ -381,7 +381,7 @@ static void apply_csum16(int id) break; } - fmemcpy(&packets[id].payload[csum->off], &sum, sizeof(sum)); + memcpy(&packets[id].payload[csum->off], &sum, sizeof(sum)); } } @@ -490,7 +490,7 @@ static int xmit_smoke_probe(int icmp_sock, struct ctx *ctx) .events = POLLIN, }; - fmemset(idstore, 0, sizeof(idstore)); + memset(idstore, 0, sizeof(idstore)); for (j = 0; j < SMOKE_N_PROBES; j++) { while ((ident = htons((short) rand())) == 0) sleep(0); @@ -776,7 +776,7 @@ static void xmit_fastpath_or_die(struct ctx *ctx, unsigned int cpu, unsigned lon packet_apply_dyn_elements(i); - fmemcpy(out, packets[i].payload, packets[i].len); + memcpy(out, packets[i].payload, packets[i].len); tx_bytes += packets[i].len; tx_packets++; @@ -1021,7 +1021,7 @@ int main(int argc, char **argv) enum shaper_type shape_type; struct timespec delay; - fmemset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx)); ctx.cpus = get_number_cpus_online(); ctx.uid = getuid(); ctx.gid = getgid(); -- cgit v1.2.3-54-g00ecf