Created
June 30, 2015 19:24
-
-
Save mlabbe/d3ad1f5d580351e728c0 to your computer and use it in GitHub Desktop.
stricmp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int ftg_stricmp(const char *s1, const char *s2) | |
| { | |
| int result; | |
| const char *p1; | |
| const char *p2; | |
| if ( s1==s2) | |
| return 0; | |
| p1 = s1; | |
| p2 = s2; | |
| result = 0; | |
| if ( p1 == p2 ) | |
| return result; | |
| while (!result) | |
| { | |
| result = tolower(*p1) - tolower(*p2); | |
| if ( *p1 == '\0' ) | |
| break; | |
| ++p1; | |
| ++p2; | |
| } | |
| return result; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ifdef WIN32
void perf_stricmp_w32(void)
{
const unsigned long REPS=10000000; /* default is 10mil */
char s1[] = "dogeatdogisSTORYOFMYLIFE";
char s2[] = "DOGEATDOGISSTORYOFMYLIFE";
unsigned long i;
LARGE_INTEGER frequency;
LARGE_INTEGER start;
LARGE_INTEGER end;
double interval;
}
endif