Fixed the modes_are_equal function(), added comments
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 27 Jun 2003 14:12:53 +0000 (14:12 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 27 Jun 2003 14:12:53 +0000 (14:12 +0000)
[r1414]

ir/ir/irmode.c
ir/ir/irmode_t.h

index 1ebfddb..68335eb 100644 (file)
@@ -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;
 }
index 6cd07b4..c196866 100644 (file)
@@ -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_ */