public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH 2/2] Fix some errors which cause unnecessary rebases
Date: Fri, 09 Feb 2018 12:01:00 -0000	[thread overview]
Message-ID: <20180209115941.512448-3-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20180209115941.512448-1-jon.turney@dronecode.org.uk>

Also add some parentheses for clarity
---
 rebase.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rebase.c b/rebase.c
index 0aad1b2..1c8fe7a 100644
--- a/rebase.c
+++ b/rebase.c
@@ -750,8 +750,8 @@ merge_image_info ()
 	    }
 	  /* However, if the DLL got bigger and doesn't fit into its slot
 	     anymore, rebase this DLL from scratch. */
-	  if (i + 1 < img_info_rebase_start
-	      && cur_base + slot_size + offset >= img_info_list[i + 1].base)
+	  if ((i + 1 < img_info_rebase_start)
+	      && (cur_base + slot_size + offset > img_info_list[i + 1].base))
 	    {
 	      img_info_list[i].base = 0;
 	      if (verbose)
@@ -759,8 +759,8 @@ merge_image_info ()
 	    }
 	  /* Does the previous DLL reach into the address space of this
 	     DLL?  This happens if the previous DLL is not rebaseable. */
-	  else if (i > 0 && cur_base < img_info_list[i - 1].base
-				       + img_info_list[i + 1].slot_size)
+	  else if ((i > 0) && (cur_base < img_info_list[i - 1].base
+			       + img_info_list[i - 1].slot_size))
 	    {
 	      img_info_list[i].base = 0;
 	      if (verbose)
@@ -768,8 +768,8 @@ merge_image_info ()
 	    }
 	  /* Does the file match the base address requirements?  If not,
 	     rebase from scratch. */
-	  else if ((down_flag && cur_base + slot_size + offset >= image_base)
-		   || (!down_flag && cur_base < image_base))
+	  else if ((down_flag && (cur_base + slot_size + offset > image_base))
+		   || (!down_flag && (cur_base < image_base)))
 	    {
 	      img_info_list[i].base = 0;
 	      if (verbose)
-- 
2.16.1

  parent reply	other threads:[~2018-02-09 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 12:00 [PATCH rebase 0/2] Avoid unncessary rebases Jon Turney
2018-02-09 12:01 ` [PATCH 1/2] Make verbose give a reason why a rebase is needed Jon Turney
2018-02-09 20:02   ` Corinna Vinschen
2018-02-09 12:01 ` Jon Turney [this message]
2018-02-09 19:52   ` [PATCH 2/2] Fix some errors which cause unnecessary rebases Corinna Vinschen
2018-02-13 12:48 ` [PATCH rebase 0/2] Avoid unncessary rebases Jon Turney
2018-02-13 18:32   ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180209115941.512448-3-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).