source:
buchla-68k/libsm/memset.c@
0acb7d0
| Last change on this file since 0acb7d0 was bf89cfb, checked in by , 8 years ago | |
|---|---|
|
|
| File size: 426 bytes | |
| Rev | Line | |
|---|---|---|
| [f40a309] | 1 | /* |
| 2 | ============================================================================= | |
| 3 | memset.c -- fill memory | |
| 4 | Version 1 -- 1987-06-12 | |
| 5 | ||
| [5c13d64] | 6 | Set an array of n chars starting at vp to the character c. |
| 7 | Return vp. | |
| [f40a309] | 8 | ============================================================================= |
| 9 | */ | |
| 10 | ||
| [b28a12e] | 11 | #include "ram.h" |
| [6262b5c] | 12 | |
| [bf89cfb] | 13 | void *memset(void *vp, uint8_t c, int16_t n) |
| [f40a309] | 14 | { |
| [bf89cfb] | 15 | uint8_t *cp = vp; |
| [f40a309] | 16 | |
| [5c13d64] | 17 | while (--n >= 0) |
| 18 | *cp++ = c; | |
| [f40a309] | 19 | |
| [5c13d64] | 20 | return(vp); |
| [f40a309] | 21 | } |
Note:
See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](http://bob.lopatic.de/chrome/site/logo.png)