Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Optimize (size and speed) strncasecmp (based on a newlib patch).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24542 a1c6a512-1295-4272-9138-f99709370657

+10 -10
+10 -10
firmware/common/strcasecmp.c
··· 14 14 15 15 int strncasecmp(const char *s1, const char *s2, size_t n) 16 16 { 17 - if(!n) 18 - return 0; 19 - 20 - while (n-- != 0 && tolower(*s1) == tolower(*s2)) { 21 - if(n == 0 || *s1 == '\0') 22 - break; 23 - s1++; 24 - s2++; 17 + int d = 0; 18 + 19 + for(; n != 0; n--) 20 + { 21 + int c1 = tolower(*s1++); 22 + int c2 = tolower(*s2++); 23 + if((d = c1 - c2) != 0 || c2 == '\0') 24 + break; 25 25 } 26 - 27 - return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); 26 + 27 + return d; 28 28 }