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

Commit 7b6751d2 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

libutils: remove unused strzcmp16_h_n.

Bug: N/A
Test: builds
Change-Id: I864bfb3597da76cd0a4fecce67e39d5d81538764
parent 5f42ee18
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -340,27 +340,6 @@ int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2)
           : 0);
}

int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2)
{
    const char16_t* e1 = s1H+n1;
    const char16_t* e2 = s2N+n2;

    while (s1H < e1 && s2N < e2) {
        const char16_t c2 = ntohs(*s2N);
        const int d = (int)*s1H++ - (int)c2;
        s2N++;
        if (d) {
            return d;
        }
    }

    return n1 < n2
        ? (0 - (int)ntohs(*s2N))
        : (n1 > n2
           ? ((int)*s1H - 0)
           : 0);
}

void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst, size_t dst_len)
{
    if (src == nullptr || src_len == 0 || dst == nullptr) {
+0 −3
Original line number Diff line number Diff line
@@ -40,9 +40,6 @@ char16_t *strstr16(const char16_t*, const char16_t*);
// equivalent result as strcmp16 (unlike strncmp16).
int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2);

// Version of strzcmp16 for comparing strings in different endianness.
int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2);

// Standard string functions on char32_t strings.
size_t strlen32(const char32_t *);
size_t strnlen32(const char32_t *, size_t);