Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 1 | From 6ef69a26126ee4e69a25392fd456b8a66c51dffd Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 15 Nov 2016 02:46:55 +0000 |
| 4 | Subject: [PATCH] Fix errors found by clang |
| 5 | |
| 6 | Fixes errors like |
| 7 | |
| 8 | ../../git/src/hash.cpp:282:19: error: ordered comparison between pointer and zero ('const unsigned char *' and 'int') |
| 9 | if(fdht->base>0){ |
| 10 | ~~~~~~~~~~^~ |
| 11 | |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- |
| 14 | src/hash.cpp | 2 +- |
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/src/hash.cpp b/src/hash.cpp |
| 18 | index 4216157..52f419b 100644 |
| 19 | --- a/src/hash.cpp |
| 20 | +++ b/src/hash.cpp |
| 21 | @@ -279,7 +279,7 @@ void file_data_hasher_t::hash() |
| 22 | MAP_FILE| |
| 23 | #endif |
| 24 | MAP_SHARED,fd,0); |
| 25 | - if(fdht->base>0){ |
| 26 | + if(fdht->base != (void *) -1){ |
| 27 | /* mmap is successful, so set the bounds. |
| 28 | * if it is not successful, we default to reading the fd |
| 29 | */ |
| 30 | -- |
| 31 | 1.9.1 |
| 32 | |