Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a23f8c4 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Fixes for simulator build on lucid



strchr and strrchr now return const char* instead of char*

Change-Id: I5ca831b8951af7e6306eb9d9d6f78ed2ec13d649
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent ce38d0c2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -81,13 +81,13 @@ status_t MediaScanner::processDirectory(
}

static bool fileMatchesExtension(const char* path, const char* extensions) {
    char* extension = strrchr(path, '.');
    const char* extension = strrchr(path, '.');
    if (!extension) return false;
    ++extension;    // skip the dot
    if (extension[0] == 0) return false;

    while (extensions[0]) {
        char* comma = strchr(extensions, ',');
        const char* comma = strchr(extensions, ',');
        size_t length = (comma ? comma - extensions : strlen(extensions));
        if (length == strlen(extension) && strncasecmp(extension, extensions, length) == 0) return true;
        extensions += length;
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ static bool ParseURL(
        path->setTo(slashPos);
    }

    char *colonPos = strchr(host->string(), ':');
    const char *colonPos = strchr(host->string(), ':');

    if (colonPos != NULL) {
        unsigned long x;
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
        out->setTo(baseURL);
        out->append(url);
    } else {
        char *slashPos = strrchr(baseURL, '/');
        const char *slashPos = strrchr(baseURL, '/');

        if (slashPos > &baseURL[6]) {
            out->setTo(baseURL, slashPos - baseURL);
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ bool ARTSPConnection::ParseURL(
        path->setTo(slashPos);
    }

    char *colonPos = strchr(host->c_str(), ':');
    const char *colonPos = strchr(host->c_str(), ':');

    if (colonPos != NULL) {
        unsigned long x;
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ void ASessionDescription::getFormatType(
    AString format;
    getFormat(index, &format);

    char *lastSpacePos = strrchr(format.c_str(), ' ');
    const char *lastSpacePos = strrchr(format.c_str(), ' ');
    CHECK(lastSpacePos != NULL);

    char *end;
Loading