diff options
author | wtc%netscape.com <devnull@localhost> | 1999-04-01 04:16:12 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1999-04-01 04:16:12 +0000 |
commit | 7a66e563e1ee7b8664ec3b1e2c2c66e442de3d48 (patch) | |
tree | 8c009cc1832b95ba6b8c754e20b9ce1fe8350739 | |
parent | 31db9de72369384f30be518f359e1142c6058d4f (diff) | |
download | nspr-hg-7a66e563e1ee7b8664ec3b1e2c2c66e442de3d48.tar.gz |
Bugzilla bug #4464: cast enum PRThreadPriority to PRIntn before
doing comparisons so that enum PRThreadPriority is treated as a
signed type. Thanks to Jeremy Lea <reg@shale.csir.co.za> for
reporting this bug.
-rw-r--r-- | pr/src/threads/combined/pruthr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pr/src/threads/combined/pruthr.c b/pr/src/threads/combined/pruthr.c index d279d791..870bec00 100644 --- a/pr/src/threads/combined/pruthr.c +++ b/pr/src/threads/combined/pruthr.c @@ -1547,9 +1547,9 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(PRThread *thread, First, pin down the priority. Not all compilers catch passing out of range enum here. If we let bad values thru, priority queues won't work. */ - if (newPri > PR_PRIORITY_LAST) { + if ((PRIntn)newPri > (PRIntn)PR_PRIORITY_LAST) { newPri = PR_PRIORITY_LAST; - } else if (newPri < PR_PRIORITY_FIRST) { + } else if ((PRIntn)newPri < (PRIntn)PR_PRIORITY_FIRST) { newPri = PR_PRIORITY_FIRST; } |