Subversion Repositories freemyipod

Rev

Rev 881 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 881 Rev 925
Line 141... Line 141...
141
    return dst_void;
141
    return dst_void;
142
}
142
}
143
 
143
 
144
__attribute__((weak,alias("memmove"))) void* memcpy(void* dst, const void* src, size_t len);
144
__attribute__((weak,alias("memmove"))) void* memcpy(void* dst, const void* src, size_t len);
145
*/
145
*/
-
 
146
 
-
 
147
__attribute__((weak)) int memcmp(const void* ptr1, const void* ptr2, size_t len)
-
 
148
{
-
 
149
    uint8_t* a = (uint8_t*)ptr1;
-
 
150
    uint8_t* b = (uint8_t*)ptr2;
-
 
151
    int d;
-
 
152
    while (len--)
-
 
153
        if ((d = *a++ - *b++))
-
 
154
            return d;
-
 
155
    return 0;
-
 
156
}
-
 
157
 
146
__attribute__((weak)) int strlen(const char* string)
158
__attribute__((weak)) size_t strlen(const char* string)
147
{
159
{
148
    const char* pos = string;
160
    const char* pos = string;
149
    while (*pos++);
161
    while (*pos++);
150
    return pos - string;
162
    return pos - string - 1;
151
}
163
}
152
 
164
 
153
static const char hextab[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
165
static const char hextab[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
154
 
166
 
155
void to_hex(char* dest, int len, uint32_t value)
167
void to_hex(char* dest, int len, uint32_t value)