Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
28633c72
authored
Nov 10, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed const correctness
parent
97402ab3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
src/string.c
src/string.h
src/string.c
View file @
28633c72
...
@@ -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
(
c
onst
c
har
*
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
(
c
onst
c
har
*
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
(
c
onst
c
har
*
num
)
{
{
if
(
!
num
||
!*
num
)
if
(
!
num
||
!*
num
)
return
0
;
return
0
;
...
...
src/string.h
View file @
28633c72
...
@@ -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
(
c
onst
c
har
*
p
);
int
stoi
(
char
*
str
);
int
stoi
(
c
onst
c
har
*
str
);
double
atof
(
char
*
num
);
double
atof
(
c
onst
c
har
*
num
);
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment