mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-30 22:41:03 +00:00
parent
242604b3ef
commit
a59954da24
4 changed files with 20 additions and 2 deletions
11
fold.c
11
fold.c
|
@ -643,8 +643,14 @@ ast_expression *fold_op(fold_t *fold, const oper_info *info, ast_expression **op
|
|||
return NULL;
|
||||
|
||||
switch(info->operands) {
|
||||
case 3: if(!c) return NULL;
|
||||
case 2: if(!b) return NULL;
|
||||
case 3:
|
||||
if (!c)
|
||||
return NULL;
|
||||
GMQCC_FALLTHROUGH;
|
||||
case 2:
|
||||
if (!b)
|
||||
return NULL;
|
||||
GMQCC_FALLTHROUGH;
|
||||
case 1:
|
||||
if(!a) {
|
||||
compile_error(fold_ctx(fold), "internal error: fold_op no operands to fold\n");
|
||||
|
@ -790,6 +796,7 @@ static ast_expression *fold_superfluous(ast_expression *left, ast_expression *ri
|
|||
case INSTR_DIV_F:
|
||||
if (swapped)
|
||||
return NULL;
|
||||
GMQCC_FALLTHROUGH;
|
||||
case INSTR_MUL_F:
|
||||
if (fold_immvalue_float(load) == 1.0f) {
|
||||
++opts_optimizationcount[OPTIM_PEEPHOLE];
|
||||
|
|
5
gmqcc.h
5
gmqcc.h
|
@ -103,6 +103,11 @@ GMQCC_IND_STRING(GMQCC_VERSION_PATCH) \
|
|||
#if defined(__GNUC__) || defined(__CLANG__)
|
||||
# define GMQCC_WARN __attribute__((warn_unused_result))
|
||||
# define GMQCC_USED __attribute__((used))
|
||||
# if __GNUC__ >= 7
|
||||
# define GMQCC_FALLTHROUGH __attribute__((fallthrough))
|
||||
# else
|
||||
# define GMQCC_FALLTHROUGH
|
||||
# endif
|
||||
# define GMQCC_FUNCTION __func__
|
||||
#else
|
||||
# define GMQCC_WARN
|
||||
|
|
4
parser.c
4
parser.c
|
@ -694,6 +694,7 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
|
|||
|
||||
case opid2('|','|'):
|
||||
generated_op += 1; /* INSTR_OR */
|
||||
GMQCC_FALLTHROUGH;
|
||||
case opid2('&','&'):
|
||||
generated_op += INSTR_AND;
|
||||
if (!(out = fold_op(parser->fold, op, exprs))) {
|
||||
|
@ -823,10 +824,13 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
|
|||
|
||||
case opid1('>'):
|
||||
generated_op += 1; /* INSTR_GT */
|
||||
GMQCC_FALLTHROUGH;
|
||||
case opid1('<'):
|
||||
generated_op += 1; /* INSTR_LT */
|
||||
GMQCC_FALLTHROUGH;
|
||||
case opid2('>', '='):
|
||||
generated_op += 1; /* INSTR_GE */
|
||||
GMQCC_FALLTHROUGH;
|
||||
case opid2('<', '='):
|
||||
generated_op += INSTR_LE;
|
||||
if (NotSameType(TYPE_FLOAT)) {
|
||||
|
|
2
stat.c
2
stat.c
|
@ -429,8 +429,10 @@ GMQCC_INLINE size_t util_hthash(hash_table_t *ht, const char *key) {
|
|||
switch (len & 3) {
|
||||
case 3:
|
||||
k ^= tail[2] << 16;
|
||||
GMQCC_FALLTHROUGH;
|
||||
case 2:
|
||||
k ^= tail[1] << 8;
|
||||
GMQCC_FALLTHROUGH;
|
||||
case 1:
|
||||
k ^= tail[0];
|
||||
k *= mask1;
|
||||
|
|
Loading…
Reference in a new issue