mirror of
https://github.com/void-linux/void-packages.git
synced 2025-10-04 01:25:13 +02:00
```sh git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" | while read template; do for p in ${template%/template}/patches/*; do sed -i ' \,^[+-][+-][+-] /dev/null,b /^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b s,^[*][*][*] ,&a/, /^--- /{ s,\(^--- \)\(./\)*,\1a/, s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1, s/[.-][Oo][Rr][Ii][Gg]$// s/[.]patched[.]\([^.]\)/.\1/ h } /^+++ -/{ g s/^--- a/+++ b/ b } s,\(^+++ \)\(./\)*,\1b/, ' "$p" done sed -i '/^patch_args=/d' $template done ```
35 lines
879 B
Diff
35 lines
879 B
Diff
From 6a5767cc5a6c8f88f8cc689c0916ddc0111308fe Mon Sep 17 00:00:00 2001
|
|
From: Bram Stolk <b.stolk@gmail.com>
|
|
Date: Fri, 30 Mar 2018 19:21:26 -0700
|
|
Subject: [PATCH] Fix issue #144 of division by zero when setting zero mass,
|
|
zero moment.
|
|
|
|
---
|
|
src/cpBody.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git src/cpBody.c src/cpBody.c
|
|
index a8e0797..8ad2bc9 100644
|
|
--- a/src/cpBody.c
|
|
+++ b/src/cpBody.c
|
|
@@ -258,7 +258,7 @@ cpBodySetMass(cpBody *body, cpFloat mass)
|
|
|
|
cpBodyActivate(body);
|
|
body->m = mass;
|
|
- body->m_inv = 1.0f/mass;
|
|
+ body->m_inv = mass == 0.0f ? INFINITY : 1.0f/mass;
|
|
cpAssertSaneBody(body);
|
|
}
|
|
|
|
@@ -275,7 +275,7 @@ cpBodySetMoment(cpBody *body, cpFloat moment)
|
|
|
|
cpBodyActivate(body);
|
|
body->i = moment;
|
|
- body->i_inv = 1.0f/moment;
|
|
+ body->i_inv = moment == 0.0f ? INFINITY : 1.0f/moment;
|
|
cpAssertSaneBody(body);
|
|
}
|
|
|
|
--
|
|
2.21.0
|
|
|