Ruby  2.7.1p83(2020-03-31revisiona0c7c23c9cec0d0ffcba012279cd652d28ad5bf3)
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  tmp = *a++ - *b++;
15  if (tmp)
16  return tmp;
17  }
18  return 0;
19 }
s2
const char * s2
Definition: rb_mjit_min_header-2.7.1.h:5415
memcmp
int memcmp(const void *s1, const void *s2, size_t len)
Definition: memcmp.c:7
missing.h
len
uint8_t len
Definition: escape.c:17