diff options
author | Chris Robinson <[email protected]> | 2019-09-16 14:55:52 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-16 14:55:52 -0700 |
commit | 6d93b2ba81958eb277da4361924e89bc7048da41 (patch) | |
tree | f68163c28c18a941b8576f5c03044e9d6f1eaba6 /utils | |
parent | 7a9463f8637de3196e630264deaedc77e414a1e8 (diff) |
Use our case-insensitive compare functions in makemhr
Diffstat (limited to 'utils')
-rw-r--r-- | utils/makemhr/loaddef.cpp | 39 | ||||
-rw-r--r-- | utils/makemhr/makemhr.cpp | 3 |
2 files changed, 22 insertions, 20 deletions
diff --git a/utils/makemhr/loaddef.cpp b/utils/makemhr/loaddef.cpp index aaefd62c..bc62b725 100644 --- a/utils/makemhr/loaddef.cpp +++ b/utils/makemhr/loaddef.cpp @@ -21,6 +21,8 @@ * Or visit: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ +#include "loaddef.h" + #include <cstring> #include <cstdarg> #include <limits> @@ -28,8 +30,7 @@ #include "mysofa.h" -#include "loaddef.h" - +#include "alstring.h" // Constants for accessing the token reader's ring buffer. #define TR_RING_BITS (16) @@ -1197,9 +1198,9 @@ static int LoadSource(SourceRefT *src, const uint hrirRate, const uint n, double // Match the channel type from a given identifier. static ChannelTypeT MatchChannelType(const char *ident) { - if(strcasecmp(ident, "mono") == 0) + if(al::strcasecmp(ident, "mono") == 0) return CT_MONO; - if(strcasecmp(ident, "stereo") == 0) + if(al::strcasecmp(ident, "stereo") == 0) return CT_STEREO; return CT_NONE; } @@ -1226,7 +1227,7 @@ static int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint trunc TrIndication(tr, &line, &col); if(!TrReadIdent(tr, MAX_IDENT_LEN, ident)) return 0; - if(strcasecmp(ident, "rate") == 0) + if(al::strcasecmp(ident, "rate") == 0) { if(hasRate) { @@ -1240,7 +1241,7 @@ static int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint trunc hData->mIrRate = static_cast<uint>(intVal); hasRate = 1; } - else if(strcasecmp(ident, "type") == 0) + else if(al::strcasecmp(ident, "type") == 0) { char type[MAX_IDENT_LEN+1]; @@ -1267,7 +1268,7 @@ static int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint trunc } hasType = 1; } - else if(strcasecmp(ident, "points") == 0) + else if(al::strcasecmp(ident, "points") == 0) { if(hasPoints) { @@ -1297,7 +1298,7 @@ static int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint trunc hData->mIrSize = points; hasPoints = 1; } - else if(strcasecmp(ident, "radius") == 0) + else if(al::strcasecmp(ident, "radius") == 0) { if(hasRadius) { @@ -1311,7 +1312,7 @@ static int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint trunc hData->mRadius = fpVal; hasRadius = 1; } - else if(strcasecmp(ident, "distance") == 0) + else if(al::strcasecmp(ident, "distance") == 0) { uint count = 0; @@ -1350,7 +1351,7 @@ static int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint trunc fdCount = count; hasDistance = 1; } - else if(strcasecmp(ident, "azimuths") == 0) + else if(al::strcasecmp(ident, "azimuths") == 0) { uint count = 0; @@ -1468,15 +1469,15 @@ static int ReadIndexTriplet(TokenReaderT *tr, const HrirDataT *hData, uint *fi, // Match the source format from a given identifier. static SourceFormatT MatchSourceFormat(const char *ident) { - if(strcasecmp(ident, "ascii") == 0) + if(al::strcasecmp(ident, "ascii") == 0) return SF_ASCII; - if(strcasecmp(ident, "bin_le") == 0) + if(al::strcasecmp(ident, "bin_le") == 0) return SF_BIN_LE; - if(strcasecmp(ident, "bin_be") == 0) + if(al::strcasecmp(ident, "bin_be") == 0) return SF_BIN_BE; - if(strcasecmp(ident, "wave") == 0) + if(al::strcasecmp(ident, "wave") == 0) return SF_WAVE; - if(strcasecmp(ident, "sofa") == 0) + if(al::strcasecmp(ident, "sofa") == 0) return SF_SOFA; return SF_NONE; } @@ -1484,9 +1485,9 @@ static SourceFormatT MatchSourceFormat(const char *ident) // Match the source element type from a given identifier. static ElementTypeT MatchElementType(const char *ident) { - if(strcasecmp(ident, "int") == 0) + if(al::strcasecmp(ident, "int") == 0) return ET_INT; - if(strcasecmp(ident, "fp") == 0) + if(al::strcasecmp(ident, "fp") == 0) return ET_FP; return ET_NONE; } @@ -1680,9 +1681,9 @@ static int ReadSofaRef(TokenReaderT *tr, SourceRefT *src) // Match the target ear (index) from a given identifier. static int MatchTargetEar(const char *ident) { - if(strcasecmp(ident, "left") == 0) + if(al::strcasecmp(ident, "left") == 0) return 0; - if(strcasecmp(ident, "right") == 0) + if(al::strcasecmp(ident, "right") == 0) return 1; return -1; } diff --git a/utils/makemhr/makemhr.cpp b/utils/makemhr/makemhr.cpp index 5930e582..8071ac18 100644 --- a/utils/makemhr/makemhr.cpp +++ b/utils/makemhr/makemhr.cpp @@ -87,6 +87,7 @@ #include "../getopt.h" #endif +#include "alstring.h" #include "loaddef.h" #include "loadsofa.h" @@ -178,7 +179,7 @@ static int StrSubst(const char *in, const char *pat, const char *rep, const size { if(patLen <= inLen-si) { - if(strncasecmp(&in[si], pat, patLen) == 0) + if(al::strncasecmp(&in[si], pat, patLen) == 0) { if(repLen > maxLen-di) { |