Last change
on this file since f806726 was dade7a0, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
No more warnings in libsm.
|
-
Property mode
set to
100644
|
File size:
521 bytes
|
Line | |
---|
1 | /*
|
---|
2 | =============================================================================
|
---|
3 | memcmp.c -- compare memory areas
|
---|
4 | Version 2 -- 1987-06-15
|
---|
5 |
|
---|
6 | Compare n bytes: vp1>vp2: >0 vp1==vp2: 0 vp1<vp2: <0
|
---|
7 | =============================================================================
|
---|
8 | */
|
---|
9 |
|
---|
10 | #include "ram.h"
|
---|
11 |
|
---|
12 | int16_t memcmp(void *vp1, void *vp2, int16_t n)
|
---|
13 | {
|
---|
14 | int8_t *cp1 = vp1;
|
---|
15 | int8_t *cp2 = vp2;
|
---|
16 | register int16_t diff;
|
---|
17 |
|
---|
18 | if (cp1 != cp2)
|
---|
19 | while (--n >= 0)
|
---|
20 | if ((diff = *cp1++ - *cp2++))
|
---|
21 | return(diff);
|
---|
22 |
|
---|
23 | return(0);
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.