~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to libw64crt/string/memicmp.c

  • Committer: ktietz70
  • Date: 2009-12-07 19:49:25 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:1611
Rename to iCrt (ironCrate)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <w64crt.h>
2
 
#include <w64string.h>
3
 
 
4
 
#define TOUPPER(CH) \
5
 
  (((CH) >= 'a' && (CH) <= 'z') ? ((CH) - 'a' + 'A') : (CH))
6
 
 
7
 
int
8
 
memicmp (const void *s1, const void *s2, size_t n)
9
 
{
10
 
  const char *sc1 = (const char *) s1;
11
 
  const char *sc2 = (const char *) s2;
12
 
  const char *sc2end = sc2 + n;
13
 
 
14
 
  while (sc2 < sc2end && TOUPPER (*sc1) == TOUPPER (*sc2))
15
 
    sc1++, sc2++;
16
 
  if (sc2 == sc2end)
17
 
    return 0;
18
 
  return (int) (TOUPPER (*sc1) - TOUPPER (*sc2));
19
 
}
20