mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Clang, like LCC, objects to using '<' and '>' on function pointers.
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. [originally from svn r9636]
This commit is contained in:
parent
e27ce2017e
commit
538090ede4
10
timing.c
10
timing.c
@ -60,15 +60,9 @@ static int compare_timers(void *av, void *bv)
|
|||||||
* Failing that, compare on the other two fields, just so that
|
* Failing that, compare on the other two fields, just so that
|
||||||
* we don't get unwanted equality.
|
* we don't get unwanted equality.
|
||||||
*/
|
*/
|
||||||
#ifdef __LCC__
|
#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. */
|
||||||
{
|
return memcmp(&a->fn, &b->fn, sizeof(a->fn));
|
||||||
int c = memcmp(&a->fn, &b->fn, sizeof(a->fn));
|
|
||||||
if (c < 0)
|
|
||||||
return -1;
|
|
||||||
else if (c > 0)
|
|
||||||
return +1;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if (a->fn < b->fn)
|
if (a->fn < b->fn)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user