const char *copied_desc;
obstack_grow0(&obst, name, strlen(name));
- copied_name = obstack_finish(&obst);
+ copied_name = (char*)obstack_finish(&obst);
obstack_grow0(&obst, desc, strlen(desc));
- copied_desc = obstack_finish(&obst);
+ copied_desc = (char*)obstack_finish(&obst);
memset(ent, 0, sizeof(*ent));
set_name(ent, copied_name);
size_t next = strspn(path + end, path_delim);
/* copy the part of the path into a buffer */
- char *buf = malloc((end+1) * sizeof(buf[0]));
+ char *buf = (char*)malloc((end+1) * sizeof(buf[0]));
strncpy(buf, path, end);
buf[end] = '\0';
break;
case lc_opt_type_string:
- strncpy(data, va_arg(args, const char *), length);
+ strncpy((char*)data, va_arg(args, const char *), length);
break;
case lc_opt_type_int:
res = snprintf(buf, n, "%s", *((int *) data) ? "true" : "false");
break;
case lc_opt_type_string:
- strncpy(buf, data, n);
+ strncpy(buf, (const char*)data, n);
res = n;
break;
case lc_opt_type_int:
if (s->cb(opt->name, s->type, s->value, s->length, value))
error = lc_opt_err_none;
break;
+ case lc_opt_type_invalid:
+ abort();
}
set_error(err, error, value);
int ret = 0;
lc_opt_err_info_t err;
- char *end, *buf, *eqsign;
+ const char *end, *eqsign;
if (n >= n_prefix && strncmp(opt_prefix, arg, n_prefix) == 0) {
arg = arg + n_prefix;
*/
if (arg[0] == '@') {
size_t n = strcspn(&arg[1], " \t\n");
- char *fname = alloca(n + 1);
+ char *fname = (char*)alloca(n + 1);
FILE *f;
strncpy(fname, &arg[1], n);
* Copy the part of the option into the buffer and add the
* finalizing zero.
*/
- buf = obstack_copy0(&obst, arg, end - arg);
+ char *buf = (char*)obstack_copy0(&obst, arg, end - arg);
/* Resolve the group inside the group */
grp = lc_opt_find_grp(grp, buf, &err);
if (!error) {
lc_opt_entry_t *opt;
+ char *buf;
/*
* Now, we are at the last option part:
* later.
*/
end = strchr(arg, '=');
- buf = obstack_copy0(&obst, arg, end ? end - arg : (int) strlen(arg));
+ buf = (char*)obstack_copy0(&obst, arg, end ? end - arg : (int) strlen(arg));
opt = lc_opt_find_opt(grp, buf, &err);
error = lc_opt_raise_error(&err, handler, ERR_STRING, arg);
{
char buf[256];
- lc_opt_entry_t *opt = arg->v_ptr;
+ lc_opt_entry_t *opt = (lc_opt_entry_t*)arg->v_ptr;
const char *s = buf;
size_t res = 0;