Index: trunk/src/flag.c =================================================================== --- trunk/src/flag.c (revision 5801) +++ trunk/src/flag.c (revision 5802) @@ -68,3 +68,20 @@ } f->unknowns = NULL; } + +int pcb_flag_eq(pcb_flag_t *f1, pcb_flag_t *f2) +{ + if (f1->f != f2->f) + return 0; + + if (f1->q != f2->q) + return 0; + + if (f1->int_conn_grp != f2->int_conn_grp) + return 0; + + /* WARNING: ignore unknowns for now: the only place where we use this function, + undo.c, won't care */ + + return (memcmp(f1->t, &f2->t, sizeof(f1->t)) == 0); +} Index: trunk/src/flag.h =================================================================== --- trunk/src/flag.h (revision 5801) +++ trunk/src/flag.h (revision 5802) @@ -216,7 +216,8 @@ } \ } while(0) -#define PCB_FLAG_EQ(F1,F2) (memcmp (&F1, &F2, sizeof(pcb_flag_t)) == 0) +int pcb_flag_eq(pcb_flag_t *f1, pcb_flag_t *f2); +#define PCB_FLAG_EQ(F1,F2) pcb_flag_eq(&(F1), &(F2)) #define PCB_FLAG_THERM(L) (0xf << (4 *((L) % 2)))