source: buchla-68k/libsm/memcmp.c@ 7258c6a

Last change on this file since 7258c6a was 7258c6a, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Use standard integer types.

  • Property mode set to 100644
File size: 501 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
10int16_t memcmp(void *vp1, void *vp2, int16_t n)
11{
12 int8_t *cp1 = vp1;
13 int8_t *cp2 = vp2;
14 register int16_t diff;
15
16 if (cp1 != cp2)
17 while (--n >= 0)
18 if (diff = *cp1++ - *cp2++)
19 return(diff);
20
21 return(0);
22}
Note: See TracBrowser for help on using the repository browser.