aboutsummaryrefslogtreecommitdiff
path: root/src/base/mem/set32.c
blob: 21ad64f5f8a2eeb0ffec27f30b7cd703cab0f8ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "internal.h"

int
mem·set32(void *dst, uintptr size, uint32 val)
{
    intptr i;

    for(i = 0; i < (size & (~3)); i += 4)
        mem·copy((byte*)dst + i, 4, &val);

    for(; i < size; i++)
        ((byte*)dst)[i] = ((byte*)&val)[i&3];

    return 0;
}