[PATCH 1/2] Fix a warning about conversion to float

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vincent van Ravesteijn <vfr@xxxxxxx>

Below in the same function, val is correctly casted to a float. Do this also
for the initialization of x.

Signed-off-by: Vincent van Ravesteijn <vfr@xxxxxxx>
---
 bisect.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bisect.c b/bisect.c
index 6e186e2..4aeb402 100644
--- a/bisect.c
+++ b/bisect.c
@@ -536,7 +536,7 @@ static int get_prn(int count) {
  */
 static int sqrti(int val)
 {
-	float d, x = val;
+	float d, x = (float)val;
 
 	if (val == 0)
 		return 0;
@@ -550,6 +550,7 @@ static int sqrti(int val)
 	return (int)x;
 }
 
+
 static struct commit_list *skip_away(struct commit_list *list, int count)
 {
 	struct commit_list *cur, *previous;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]