Fix bug in Perl implementation of Doc_Equals Detected by a GCC 5.2 warning.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/56e7c206 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/56e7c206 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/56e7c206 Branch: refs/heads/master Commit: 56e7c206191862822c1a111af4959283069702d1 Parents: 04bd80f Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Thu Mar 24 12:06:24 2016 +0100 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Thu Mar 24 12:52:32 2016 +0100 ---------------------------------------------------------------------- perl/xs/Lucy/Document/Doc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/56e7c206/perl/xs/Lucy/Document/Doc.c ---------------------------------------------------------------------- diff --git a/perl/xs/Lucy/Document/Doc.c b/perl/xs/Lucy/Document/Doc.c index a45f758..902df23 100644 --- a/perl/xs/Lucy/Document/Doc.c +++ b/perl/xs/Lucy/Document/Doc.c @@ -228,7 +228,7 @@ LUCY_Doc_Equals_IMP(lucy_Doc *self, cfish_Obj *other) { lucy_DocIVARS *const ivars = lucy_Doc_IVARS(self); lucy_DocIVARS *const ovars = lucy_Doc_IVARS((lucy_Doc*)other); - if (!ivars->doc_id == ovars->doc_id) { return false; } + if (!!ivars->doc_id ^ !!ovars->doc_id) { return false; } if (!!ivars->fields ^ !!ovars->fields) { return false; } // Verify fields. Don't allow any deep data structures.