}
if (opt->flags & VSH_OFLAG_REQ_OPT) {
if (opt->flags & VSH_OFLAG_REQ)
- *opts_required |= 1 << i;
+ *opts_required |= 1ULL << i;
else
optional = true;
continue;
}
- *opts_need_arg |= 1 << i;
+ *opts_need_arg |= 1ULL << i;
if (opt->flags & VSH_OFLAG_REQ) {
if (optional && opt->type != VSH_OT_ARGV)
return -1; /* mandatory options must be listed first */
- *opts_required |= 1 << i;
+ *opts_required |= 1ULL << i;
} else {
optional = true;
}
}
continue;
}
- if ((*opts_seen & (1 << i)) && opt->type != VSH_OT_ARGV) {
+ if ((*opts_seen & (1ULL << i)) && opt->type != VSH_OT_ARGV) {
vshError(ctl, _("option --%s already seen"), name);
goto cleanup;
}
- *opts_seen |= 1 << i;
+ *opts_seen |= 1ULL << i;
*opt_index = i;
ret = opt;
goto cleanup;
i = ffsl(*opts_need_arg) - 1;
opt = &cmd->opts[i];
if (opt->type != VSH_OT_ARGV)
- *opts_need_arg &= ~(1 << i);
- *opts_seen |= 1 << i;
+ *opts_need_arg &= ~(1ULL << i);
+ *opts_seen |= 1ULL << i;
return opt;
}
return 0;
for (i = 0; def->opts[i].name; i++) {
- if (opts_required & (1 << i)) {
+ if (opts_required & (1ULL << i)) {
const vshCmdOptDef *opt = &def->opts[i];
vshError(ctl,
goto syntaxError;
}
if (opt->type != VSH_OT_ARGV)
- opts_need_arg &= ~(1 << opt_index);
+ opts_need_arg &= ~(1ULL << opt_index);
} else {
tkdata = NULL;
if (optstr) {