FreeCalypso > hg > freecalypso-tools
annotate target-utils/libc/strcmp.c @ 733:bed7981ac8ca
doc/Compal-FFS: update for IMEI found in OTP cells
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 28 Aug 2020 15:58:46 +0000 |
parents | 7fb62fc724dc |
children |
rev | line source |
---|---|
87
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0 |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 strcmp(s1, s2) |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 register char *s1, *s2; |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 { |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 while (*s1 == *s2++) |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 if (*s1++=='\0') |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 return(0); |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 return(*s1 - *--s2); |
7fb62fc724dc
target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 } |