From d0709a1e0a04bf74f240dc0fdb8697f030b68cea Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Tue, 29 Oct 2024 22:45:21 +0000 Subject: New upstream version 0.0.0.73~rc1 --- ALSASound.c | 84 ++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 26 deletions(-) (limited to 'ALSASound.c') diff --git a/ALSASound.c b/ALSASound.c index fc950a4..6cb6121 100644 --- a/ALSASound.c +++ b/ALSASound.c @@ -1789,32 +1789,6 @@ int gpioInitialise(void) -int stricmp(const unsigned char * pStr1, const unsigned char *pStr2) -{ - unsigned char c1, c2; - int v; - - if (pStr1 == NULL) - { - if (pStr2) - Debugprintf("stricmp called with NULL 1st param - 2nd %s ", pStr2); - else - Debugprintf("stricmp called with two NULL params"); - - return 1; - } - - - do { - c1 = *pStr1++; - c2 = *pStr2++; - /* The casts are necessary when pStr1 is shorter & char is signed */ - v = tolower(c1) - tolower(c2); - } while ((v == 0) && (c1 != '\0') && (c2 != '\0') ); - - return v; -} - char Leds[8]= {0}; unsigned int PKTLEDTimer = 0; @@ -2107,5 +2081,63 @@ int gethints() return 0; } +// Microsoft routines not available in gcc + +int memicmp(unsigned char *a, unsigned char *b, int n) +{ + if (n) + { + while (n && (toupper(*a) == toupper(*b))) + n--, a++, b++; + + if (n) + return toupper(*a) - toupper(*b); + } + return 0; +} +int stricmp(const unsigned char * pStr1, const unsigned char *pStr2) +{ + unsigned char c1, c2; + int v; + + if (pStr1 == NULL) + { + if (pStr2) + Debugprintf("stricmp called with NULL 1st param - 2nd %s ", pStr2); + else + Debugprintf("stricmp called with two NULL params"); + + return 1; + } + + + do { + c1 = *pStr1++; + c2 = *pStr2++; + /* The casts are necessary when pStr1 is shorter & char is signed */ + v = tolower(c1) - tolower(c2); + } while ((v == 0) && (c1 != '\0') && (c2 != '\0')); + + return v; +} +char * strupr(char* s) +{ + char* p = s; + + if (s == 0) + return 0; + + while (*p = toupper(*p)) p++; + return s; +} + +char * strlwr(char* s) +{ + char* p = s; + while (*p = tolower(*p)) p++; + return s; +} + + -- cgit v1.2.3