Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/games/xu4 Don't use abs on unsigned types.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c1c346d29e24
branches:  trunk
changeset: 437602:c1c346d29e24
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Aug 27 12:33:19 2020 +0000

description:
Don't use abs on unsigned types.

diffstat:

 games/xu4/distinfo                  |   3 ++-
 games/xu4/patches/patch-src_map.cpp |  23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r c323e18c503c -r c1c346d29e24 games/xu4/distinfo
--- a/games/xu4/distinfo        Thu Aug 27 12:32:48 2020 +0000
+++ b/games/xu4/distinfo        Thu Aug 27 12:33:19 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2015/11/03 20:57:10 agc Exp $
+$NetBSD: distinfo,v 1.6 2020/08/27 12:33:19 joerg Exp $
 
 SHA1 (xu4-1.0beta3.tar.gz) = baf1bbdc18088096ae11ea31aa497532b7e7124c
 RMD160 (xu4-1.0beta3.tar.gz) = f758fea4bc3034b19122651cfb725a88e0684960
@@ -19,6 +19,7 @@
 SHA1 (patch-src_intro.cpp) = 5330d1bedb8e79750468d9463a016b041b7aa496
 SHA1 (patch-src_item.cpp) = 667498d2c8fcf4c2c35da0d9189d68c9b6a9baf5
 SHA1 (patch-src_lzw_u6decode.cpp) = 1dbf1cb0f24ad9d083f4a7fe666f1503c9647ab6
+SHA1 (patch-src_map.cpp) = 052bccf08c87f64057d20acca65e15a95488867d
 SHA1 (patch-src_menuitem_cpp) = 400943827ddd59a9cff547765e87b30590569cb2
 SHA1 (patch-src_moongate.cpp) = b9edda01c2d405ac94082280a62e8169be66ba85
 SHA1 (patch-src_person.cpp) = b93703514429257ae4665ab7242c5dc1ead18c3c
diff -r c323e18c503c -r c1c346d29e24 games/xu4/patches/patch-src_map.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/xu4/patches/patch-src_map.cpp       Thu Aug 27 12:33:19 2020 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_map.cpp,v 1.1 2020/08/27 12:33:19 joerg Exp $
+
+--- src/map.cpp.orig   2020-08-26 12:02:32.310434861 +0000
++++ src/map.cpp
+@@ -115,14 +115,14 @@ int MapCoords::getRelativeDirection(cons
+     if (map && map->border_behavior == Map::BORDER_WRAP) {
+         MapCoords me = *this;            
+         
+-        if (abs(me.x - c.x) > abs(me.x + map->width - c.x))
++        if (abs(me.x - c.x) > abs(me.x + int(map->width - c.x)))
+             me.x += map->width;
+-        else if (abs(me.x - c.x) > abs(me.x - map->width - c.x))
++        else if (abs(me.x - c.x) > abs(int(me.x - map->width) - c.x))
+             me.x -= map->width;
+ 
+-        if (abs(me.y - c.y) > abs(me.y + map->width - c.y))
++        if (abs(me.y - c.y) > abs(me.y + int(map->width - c.y)))
+             me.y += map->height;
+-        else if (abs(me.y - c.y) > abs(me.y - map->width - c.y))
++        else if (abs(me.y - c.y) > abs(int(me.y - map->width) - c.y))
+             me.y -= map->height;
+ 
+         dx = me.x - c.x;



Home | Main Index | Thread Index | Old Index