Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
58ba744e
Commit
58ba744e
authored
Dec 05, 2015
by
Matthias Braun
Browse files
Avoid unnecessary inclusion of strings.h
parent
4272639e
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/common/debugger.c
View file @
58ba744e
...
@@ -18,15 +18,13 @@
...
@@ -18,15 +18,13 @@
#include "debugger.h"
#include "debugger.h"
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <signal.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <strings.h>
#include <time.h>
#include <time.h>
#include <ctype.h>
#include "set.h"
#include "set.h"
#include "ident.h"
#include "ident.h"
#include "irhooks.h"
#include "irhooks.h"
...
@@ -843,6 +841,22 @@ static void get_text(void)
...
@@ -843,6 +841,22 @@ static void get_text(void)
lexer
.
len
=
len
;
lexer
.
len
=
len
;
}
}
/**
* Simple custom strncasecmp variant to avoid posix strings.h inclusion.
*/
static
bool
firm_strncaseequal
(
const
char
*
str0
,
const
char
*
str1
,
size_t
len
)
{
for
(
size_t
i
=
0
;
i
<
len
;
++
i
)
{
unsigned
char
const
c0
=
str0
[
i
];
unsigned
char
const
c1
=
str1
[
i
];
if
(
toupper
(
c0
)
!=
toupper
(
c1
))
return
false
;
if
(
c0
==
'\0'
)
break
;
}
return
true
;
}
/**
/**
* The lexer.
* The lexer.
*/
*/
...
@@ -868,7 +882,7 @@ static unsigned get_token(void)
...
@@ -868,7 +882,7 @@ static unsigned get_token(void)
--
len
;
--
len
;
}
}
for
(
size_t
i
=
ARRAY_SIZE
(
reserved
);
i
--
!=
0
;)
{
for
(
size_t
i
=
ARRAY_SIZE
(
reserved
);
i
--
!=
0
;)
{
if
(
strncase
cmp
(
tok_start
,
reserved
[
i
],
len
)
==
0
if
(
firm_
strncase
equal
(
tok_start
,
reserved
[
i
],
len
)
&&
reserved
[
i
][
len
]
==
'\0'
)
&&
reserved
[
i
][
len
]
==
'\0'
)
return
first_token
+
i
;
return
first_token
+
i
;
}
}
...
...
ir/tv/tv.c
View file @
58ba744e
...
@@ -21,7 +21,6 @@
...
@@ -21,7 +21,6 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <strings.h>
#include "bitfiddle.h"
#include "bitfiddle.h"
#include "hashptr.h"
#include "hashptr.h"
...
...
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