]> sigrok.org Git - libsigrok.git/commitdiff
demo: Use memset(), might be faster.
authorUwe Hermann <redacted>
Fri, 6 May 2011 18:38:48 +0000 (20:38 +0200)
committerUwe Hermann <redacted>
Sun, 8 May 2011 22:59:05 +0000 (00:59 +0200)
hardware/demo/demo.c

index 356a9bca5d6c8e4444e8eb3df085bdadb393431f..c10316ab4183561ab7200f260a700a433ce9728f 100644 (file)
@@ -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. */