summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0b106f6)
I'm not entirely sure that using memcmp() is any more defined by the C
standard, but at least Clang doesn't complain about it. While I'm
here, tree234 doesn't require that comparison functions return
precisely +1 or -1, so we can use the return value of memcmp()
directly.
git-svn-id: svn://svn.tartarus.org/sgt/putty@9636
cda61777-01e9-0310-a592-
d414129be87e
* Failing that, compare on the other two fields, just so that
* we don't get unwanted equality.
*/
* Failing that, compare on the other two fields, just so that
* we don't get unwanted equality.
*/
+#if defined(__LCC__) || defined(__clang__)
/* lcc won't let us compare function pointers. Legal, but annoying. */
/* lcc won't let us compare function pointers. Legal, but annoying. */
- {
- int c = memcmp(&a->fn, &b->fn, sizeof(a->fn));
- if (c < 0)
- return -1;
- else if (c > 0)
- return +1;
- }
+ return memcmp(&a->fn, &b->fn, sizeof(a->fn));
#else
if (a->fn < b->fn)
return -1;
#else
if (a->fn < b->fn)
return -1;