projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
handle Block_entity like other node attributes
[libfirm]
/
ir
/
libcore
/
lc_opts.c
diff --git
a/ir/libcore/lc_opts.c
b/ir/libcore/lc_opts.c
index
b7b0e30
..
665398a
100644
(file)
--- a/
ir/libcore/lc_opts.c
+++ b/
ir/libcore/lc_opts.c
@@
-28,6
+28,7
@@
#include "lc_opts_enum.h"
#include "hashptr.h"
#include "lc_printf.h"
#include "lc_opts_enum.h"
#include "hashptr.h"
#include "lc_printf.h"
+#include "util.h"
#include "xmalloc.h"
#include "obst.h"
#include "xmalloc.h"
#include "obst.h"
@@
-335,7
+336,7
@@
static char *strtolower(char *buf, size_t n, const char *str)
{
unsigned i;
for (i = 0; i < n; ++i)
{
unsigned i;
for (i = 0; i < n; ++i)
- buf[i] = tolower(str[i]);
+ buf[i] = tolower(
(unsigned char)
str[i]);
return buf;
}
return buf;
}
@@
-354,17
+355,17
@@
int lc_opt_std_cb(const char *name, lc_opt_type_t type, void *data, size_t lengt
case lc_opt_type_bit:
integer = va_arg(args, int);
if (integer)
case lc_opt_type_bit:
integer = va_arg(args, int);
if (integer)
- *(
(int *) data)
|= length;
+ *(
unsigned*)data
|= length;
else
else
- *(
(int *) data)
&= ~length;
+ *(
unsigned*)data
&= ~length;
break;
case lc_opt_type_negbit:
integer = va_arg(args, int);
if (integer)
break;
case lc_opt_type_negbit:
integer = va_arg(args, int);
if (integer)
- *(
(int *) data)
&= ~length;
+ *(
unsigned*)data
&= ~length;
else
else
- *(
(int *) data)
|= length;
+ *(
unsigned*)data
|= length;
break;
case lc_opt_type_boolean:
break;
case lc_opt_type_boolean:
@@
-504,7
+505,7
@@
int lc_opt_occurs(lc_opt_entry_t *opt, const char *value, lc_opt_err_info_t *err
case lc_opt_type_bit:
case lc_opt_type_negbit:
strtolower(buf, sizeof(buf), value);
case lc_opt_type_bit:
case lc_opt_type_negbit:
strtolower(buf, sizeof(buf), value);
- for (i = 0; i <
LC_ARR
SIZE(bool_strings); ++i) {
+ for (i = 0; i <
ARRAY_
SIZE(bool_strings); ++i) {
if (strcmp(buf, bool_strings[i].str) == 0) {
val->integer = bool_strings[i].val;
error = lc_opt_err_none;
if (strcmp(buf, bool_strings[i].str) == 0) {
val->integer = bool_strings[i].val;
error = lc_opt_err_none;