From: Michael Beck Date: Fri, 27 Jun 2003 14:12:53 +0000 (+0000) Subject: Fixed the modes_are_equal function(), added comments X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=1e0f315902f61dfe80bfcf46bb408e718dd1b590;p=libfirm Fixed the modes_are_equal function(), added comments [r1414] --- diff --git a/ir/ir/irmode.c b/ir/ir/irmode.c index 1ebfddbc1..68335ebe2 100644 --- a/ir/ir/irmode.c +++ b/ir/ir/irmode.c @@ -51,7 +51,7 @@ static int num_modes; INLINE static int modes_are_equal(const ir_mode *m, const ir_mode *n) { if (m == n) return 1; - if(!bcmp( m + offsetof(ir_mode,sort) , n + offsetof(ir_mode,sort), offsetof(ir_mode,min)-offsetof(ir_mode,min))) return 1; + if (0 == memcmp(&m->sort, &n->sort, offsetof(ir_mode,min) - offsetof(ir_mode,sort))) return 1; return 0; } diff --git a/ir/ir/irmode_t.h b/ir/ir/irmode_t.h index 6cd07b406..c19686646 100644 --- a/ir/ir/irmode_t.h +++ b/ir/ir/irmode_t.h @@ -16,6 +16,9 @@ struct ir_mode { firm_kind kind; /**< distinguishes this node from others */ modecode code; /**< unambiguous identifier of a mode */ ident *name; /**< Name ident of this mode */ + + /* ----------------------------------------------------------------------- */ + /* On changing this struct you have to valuate the mode_are_equal function!*/ mode_sort sort; /**< coarse classification of this mode: int, float, reference ... (see irmode.h) */ @@ -24,6 +27,7 @@ struct ir_mode { int align; /**< byte alignment */ unsigned sign:1; /**< signedness of this mode */ + /* ----------------------------------------------------------------------- */ tarval *min; tarval *max; tarval *null; @@ -32,4 +36,4 @@ struct ir_mode { const void *tv_priv; /**< tarval module will save private data here */ }; -#endif +#endif /* _IRMODE_T_H_ */