annotate gcc/config/memcmp.c @ 63:b7f97abdc517
gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author |
ryoma <e075725@ie.u-ryukyu.ac.jp> |
date |
Mon, 24 May 2010 12:47:05 +0900 |
parents |
a06113de4d67 |
children |
|
rev |
line source |
0
|
1 /* Public domain. */
|
|
2 #include <stddef.h>
|
|
3
|
|
4 int
|
|
5 memcmp (const void *str1, const void *str2, size_t count)
|
|
6 {
|
|
7 const unsigned char *s1 = str1;
|
|
8 const unsigned char *s2 = str2;
|
|
9
|
|
10 while (count-- > 0)
|
|
11 {
|
|
12 if (*s1++ != *s2++)
|
|
13 return s1[-1] < s2[-1] ? -1 : 1;
|
|
14 }
|
|
15 return 0;
|
|
16 }
|