mirror of https://github.com/FOME-Tech/fome-fw.git
dead code
This commit is contained in:
parent
06a660035c
commit
e81172143b
|
@ -79,33 +79,6 @@ int indexOf(const char *string, char c) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// string to integer
|
|
||||||
int atoi(const char *string) {
|
|
||||||
int len = strlen(string);
|
|
||||||
if (len == 0) {
|
|
||||||
return -ATOI_ERROR_CODE;
|
|
||||||
}
|
|
||||||
if (string[0] == '-') {
|
|
||||||
return -atoi(string + 1);
|
|
||||||
}
|
|
||||||
int result = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < len; i++) {
|
|
||||||
char c = string[i];
|
|
||||||
if (c < '0' || c > '9') {
|
|
||||||
if (i > 0) {
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
return ATOI_ERROR_CODE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int num = c - '0';
|
|
||||||
result = result * 10 + num;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char todofixthismesswithcopy[100];
|
static char todofixthismesswithcopy[100];
|
||||||
|
|
||||||
static char *ltoa_internal(char *p, uint32_t num, unsigned radix) {
|
static char *ltoa_internal(char *p, uint32_t num, unsigned radix) {
|
||||||
|
|
Loading…
Reference in New Issue