]> Nishi Git Mirror - gwion.git/commitdiff
:shirt: do some linting
authorfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 20 Dec 2018 12:45:04 +0000 (13:45 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 20 Dec 2018 12:45:04 +0000 (13:45 +0100)
src/parse/check.c
src/parse/operator.c
src/parse/scan1.c

index 699455e83e58931a02e9b043a8568ea1c8b82e34..b958d979640659ca3201870366877eff088e5535 100644 (file)
@@ -520,7 +520,7 @@ ANN2(1,2,4) static Type check_exp_call_template(const Env env, const Exp restric
   const Func func = get_template_func(env, &tmp_func, base, value);
   if(base->exp_type == ae_exp_call)
     base->d.exp_call.m_func = func;
-  else if(base->exp_type == ae_exp_binary)
+  else // if(base->exp_type == ae_exp_binary)
     base->d.exp_binary.func = func;
   return func ? func->def->ret_type : NULL;
 }
@@ -857,8 +857,8 @@ ANN static m_bool check_stmt_case(const Env env, const Stmt_Exp stmt) { GWDEBUG_
     return GW_OK;
   if(!GET_FLAG(v, const))
     ERR_B(stmt->val->pos, "'%s' is not constant.", v->name)
-    if(!GET_FLAG(v, builtin) && !GET_FLAG(v, enum))
-      vector_add(&env->sw->exp, (vtype)stmt->val);
+  if(!GET_FLAG(v, builtin) && !GET_FLAG(v, enum))
+    vector_add(&env->sw->exp, (vtype)stmt->val);
   return GW_OK;
 }
 
index 028fd52c4c4d826a728f417b4f0eafc2b1163726..b7c4d878cb3a6665dc42900a46f31463fddbccb5 100644 (file)
@@ -171,7 +171,7 @@ ANN m_bool operator_set_func(const struct Op_Import* opi) {
   return GW_OK;
 }
 
-ANN static m_bool  handle_instr(const Emitter emit, const M_Operator* mo) {
+ANN static m_bool handle_instr(const Emitter emit, const M_Operator* mo) {
   if(mo->func) {
     const Instr instr = emit_add_instr(emit, RegPushImm);
     *(Func*)instr->ptr = mo->func;
index e8d288dbb0928a5f07a2f022705d744a6121f761..a22e3f60d5fa51c31813cd46afabebac6ec1b4de 100644 (file)
@@ -238,9 +238,7 @@ ANN static inline m_bool scan1_stmt_union_array(const Array_Sub array) { GWDEBUG
 ANN m_bool scan1_stmt_union(const Env env, const Stmt_Union stmt) { GWDEBUG_EXE
   Decl_List l = stmt->l;
   const m_uint scope = union_push(env, stmt);
-  if(stmt->xid)
-    UNSET_FLAG(stmt, private);
-  else if(stmt->type_xid)
+  if(stmt->xid || stmt->type_xid)
     UNSET_FLAG(stmt, private);
   do {
     const Exp_Decl decl = l->self->d.exp_decl;