From da1d0ee1bd8718cc5c10a010f1980bec7083d3fc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 11:48:29 +0100 Subject: [PATCH] fix the comparison return value --- ext/spl/spl_heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index b9f404ab113..b421c03757a 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -160,7 +160,7 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* exception or call failure */ return 0; } - return lval > 0 ? 1 : -1; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } @@ -184,7 +184,7 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* exception or call failure */ return 0; } - return lval > 0 ? 1 : -1; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } @@ -215,7 +215,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { / /* exception or call failure */ return 0; } - return lval > 0 ? 1 : -1; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } }