diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2018-03-06 18:44:11 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2018-03-06 18:44:11 +0100 |
commit | 2af099cae27fef1a57aa25d48fc915d619ea216d (patch) | |
tree | ff661aad6ab62c6db94b68a3eacba930ffb87881 /trafgen.c | |
parent | 18f5d4dde7ef18efa0489f2007f5ebeed89975ea (diff) |
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 <tklauser@distanz.ch>
Diffstat (limited to 'trafgen.c')
-rw-r--r-- | trafgen.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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(); |