Compare Record Bytes
Default comparision order
- Declare macro min()
-
Macro definition
- Segment Source
-
52: /* Undefine, to avoid warning about redefinition on some systems. */
53: #undef min
54: #define min(a, b) ((a) < (b) ? (a) : (b))
55:
- Compare record bytes
-
Code insertion
- Segment Source
-
1153: diff = memcmp (texta, textb, min (lena, lenb));
- Compare record bytes
-
Code insertion
- Segment Source
-
1184: /* If the keys all compare equal (or no keys were specified)
1185: fall through to the default byte-by-byte comparison. */
1186: tmpa = a->length, tmpb = b->length;
1187: mini = min (tmpa, tmpb);
1188: if (mini == 0)
1189: diff = tmpa - tmpb;
1190: else
1191: {
1192: char *ap = a->text, *bp = b->text;
1193:
1194: diff = UCHAR (*ap) - UCHAR (*bp);
1195: if (diff == 0)
1196: {
1197: diff = memcmp (ap, bp, mini);
1198: if (diff == 0)
1199: diff = tmpa - tmpb;
1200: }
1201: }
1202: