ast_unary *prev = (ast_unary*)((ast_unary*)expr)->operand;
/* Handle for double negation */
- if ((((ast_unary*)expr)->op == VINSTR_NEG_V && op == VINSTR_NEG_V) ||
- (((ast_unary*)expr)->op == VINSTR_NEG_F && op == VINSTR_NEG_F)) {
+ if ((((ast_unary*)expr)->op == op))
prev = (ast_unary*)((ast_unary*)expr)->operand;
- }
if (ast_istype(prev, ast_unary)) {
ast_expression_delete((ast_expression*)self);
if (argc < 2) {
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
while (argc > 1) {
!strcmp(argv[1], "--help"))
{
usage();
- exit(0);
+ exit(EXIT_SUCCESS);
}
else if (!strcmp(argv[1], "-v")) {
++opts_v;
++opts_v;
else {
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
--argc;
!strcmp(argv[1], "--version"))
{
version();
- exit(0);
+ exit(EXIT_SUCCESS);
}
else if (!strcmp(argv[1], "-trace")) {
--argc;
++argv;
if (argc <= 1) {
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
vec_push(dis_list, argv[1]);
--argc;
++argv;
if (argc < 2) {
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
p.value = argv[1];
if (progsfile) {
fprintf(stderr, "only 1 program file may be specified\n");
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
progsfile = argv[1];
--argc;
{
fprintf(stderr, "unknown parameter: %s\n", argv[1]);
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (!progsfile) {
fprintf(stderr, "must specify a program to execute\n");
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
prog = prog_load(progsfile, noexec);
if (!prog) {
fprintf(stderr, "failed to load program '%s'\n", progsfile);
- exit(1);
+ exit(EXIT_FAILURE);
}
prog->builtins = qc_builtins;
if (opts_printfuns) {
for (i = 0; i < vec_size(prog->functions); ++i) {
int32_t a;
- printf("Function: %-16s taking %i parameters:(",
+ printf("Function: %-16s taking %u parameters:(",
prog_getstring(prog, prog->functions[i].name),
(unsigned int)prog->functions[i].nargs);
for (a = 0; a < prog->functions[i].nargs; ++a) {
}
int platform_vsnprintf(char *buffer, size_t bytes, const char *format, va_list arg) {
- vsnprintf_s(buffer, bytes, bytes, format, arg);
+ return vsnprintf_s(buffer, bytes, bytes, format, arg);
}
int platform_vsscanf(const char *str, const char *format, va_list va) {