Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

memcmp.c
Go to the documentation of this file.
1 /* public domain rewrite of memcmp(3) */
2
3 #include "ruby/missing.h"
4 #include <stddef.h>
5
6 int
7 memcmp(const void *s1, const void *s2, size_t len)
8 {
9 register unsigned char *a = (unsigned char*)s1;
10 register unsigned char *b = (unsigned char*)s2;
11 register int tmp;
12
13 for (; len; --len) {
14 if (tmp = *a++ - *b++)
15 return tmp;
16 }
17 return 0;
18 }
tmp
volatile VALUE tmp
Definition: tcltklib.c:10209
a
Real * a
Definition: bigdecimal.c:1182
missing.h
memcmp
int memcmp(const void *s1, const void *s2, size_t len)
Definition: memcmp.c:7
b
Real * b
Definition: bigdecimal.c:1182
len
size_t len
Definition: tcltklib.c:3568