Support mythical ones' complement machines.

This commit is contained in:
Stefan Krah 2012-04-18 17:57:56 +02:00
parent 140893cbaa
commit 6369f77d20
1 changed files with 1 additions and 1 deletions

View File

@ -1340,7 +1340,7 @@ mpd_qget_ssize(const mpd_t *a, uint32_t *status)
if (u <= MPD_SSIZE_MAX) {
return isneg ? -((mpd_ssize_t)u) : (mpd_ssize_t)u;
}
else if (isneg && u-1 == MPD_SSIZE_MAX) {
else if (isneg && u+(MPD_SSIZE_MIN+MPD_SSIZE_MAX) == MPD_SSIZE_MAX) {
return MPD_SSIZE_MIN;
}