From: Uwe Hermann Date: Fri, 6 May 2011 18:38:48 +0000 (+0200) Subject: demo: Use memset(), might be faster. X-Git-Tag: libsigrok-0.1.0~256 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5a9660dd4e4977b9c3a86fe895e0b714e64a44a1;p=libsigrok.git demo: Use memset(), might be faster. --- diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 356a9bca..c10316ab 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -288,12 +288,10 @@ static void samples_generator(uint8_t *buf, uint64_t size, void *data) *(buf + i) = i; break; case PATTERN_ALL_LOW: /* All probes are low */ - for (i = 0; i < size; i++) - *(buf + i) = 0x00; + memset(buf, 0x00, size); break; case PATTERN_ALL_HIGH: /* All probes are high */ - for (i = 0; i < size; i++) - *(buf + i) = 0xff; + memset(buf, 0xff, size); break; default: /* TODO: Error handling. */