X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstring%2Fmemset.c;h=3d4a64ea0cbbf18753989955c36155972ac973bc;hp=2771ae1e580f0a86c242ff623657cc1cb3631668;hb=0a5395faab237ba9008352b0f4bee9659bbd3d5f;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec diff --git a/functions/string/memset.c b/functions/string/memset.c index 2771ae1..3d4a64e 100644 --- a/functions/string/memset.c +++ b/functions/string/memset.c @@ -6,3 +6,26 @@ // ---------------------------------------------------------------------------- void * memset( void * s, int c, size_t n ) { /* TODO */ }; + +/* Therx code +{ + unsigned short * tmp = (unsigned short *) s; // TODO: unsigned short? + for( ; n != 0; n-- ) + { + *tmp++ = c; + } + return s; +} +*/ + +/* PDPC code - unreviewed +{ + size_t x = 0; + + for (x = 0; x < n; x++) + { + *((char *)s + x) = (unsigned char)c; + } + return (s); +} +*/