2 * Copyright (C) 2004 by Digital Mars, www.digitalmars.com
3 * Written by Walter Bright
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, in both source and binary form, subject to the following
14 * o The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software
16 * in a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
18 * o Altered source versions must be plainly marked as such, and must not
19 * be misrepresented as being the original software.
20 * o This notice may not be removed or altered from any source
28 // Functions from the C library.
29 void *memcpy(void *, void *, size_t);
34 short *_memset16(short *p, short value, size_t count)
39 for (ptop = &p[count]; p < ptop; p++)
44 int *_memset32(int *p, int value, size_t count)
64 for (ptop = &p[count]; p < ptop; p++)
70 long *_memset64(long *p, long value, size_t count)
75 for (ptop = &p[count]; p < ptop; p++)
80 cdouble *_memset128(cdouble *p, cdouble value, size_t count)
85 for (ptop = &p[count]; p < ptop; p++)
90 real *_memset80(real *p, real value, size_t count)
95 for (ptop = &p[count]; p < ptop; p++)
100 creal *_memset160(creal *p, creal value, size_t count)
105 for (ptop = &p[count]; p < ptop; p++)
110 void *_memsetn(void *p, void *value, int count, size_t sizelem)
114 for (i = 0; i < count; i++)
116 memcpy(p, value, sizelem);
117 p = cast(void *)(cast(char *)p + sizelem);