duff's cowfiller
public c v1 · immutablevoid cowfill( unsigned char *buffer, size_t length ){ unsigned char *ptr = buffer; int n = length / 4; if ( ! length ) { return; } switch ( length % 4 ) { while ( n-- ) { ptr+= 4; case 0: ptr[3] = 0xEF; case 3: ptr[2] = 0xBE; case 2: ptr[1] = 0xAD; case 1: ptr[0] = 0xDE; } }}