Commit 28633c72 by malcolm

fixed const correctness

parent 97402ab3
Showing with 6 additions and 6 deletions
...@@ -69,7 +69,7 @@ int strncmp(const char *s1, const char *s2, size_t n) ...@@ -69,7 +69,7 @@ int strncmp(const char *s1, const char *s2, size_t n)
return 0; return 0;
} }
int atoi(char *p) int atoi(const char *p)
{ {
int k = 0; int k = 0;
while (*p) { while (*p) {
...@@ -84,7 +84,7 @@ bool isNumericChar(char x) ...@@ -84,7 +84,7 @@ bool isNumericChar(char x)
return (x >= '0' && x <= '9')? true: false; return (x >= '0' && x <= '9')? true: false;
} }
int stoi(char *str) int stoi(const char *str)
{ {
if ((*str) == 0) if ((*str) == 0)
return 0; return 0;
...@@ -108,7 +108,7 @@ int stoi(char *str) ...@@ -108,7 +108,7 @@ int stoi(char *str)
return sign*res; return sign*res;
} }
double atof(char* num) double atof(const char* num)
{ {
if (!num || !*num) if (!num || !*num)
return 0; return 0;
......
...@@ -7,7 +7,7 @@ void itoa(int n, char s[]); ...@@ -7,7 +7,7 @@ void itoa(int n, char s[]);
size_t strlen(const char* str); size_t strlen(const char* str);
int strcmp(const char* s1, const char* s2); int strcmp(const char* s1, const char* s2);
int strncmp(const char* s1, const char* s2, size_t n); int strncmp(const char* s1, const char* s2, size_t n);
int atoi(char *p); int atoi(const char *p);
int stoi(char* str); int stoi(const char* str);
double atof(char* num); double atof(const char* num);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment