summaryrefslogtreecommitdiff
path: root/Ports/timidity/patches/0001-Calculate-Newton-coefficients-on-the-fly.patch
blob: 3b2db116f8019274747d64c852252b09397d7f25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jelle Raaijmakers <jelle@gmta.nl>
Date: Thu, 1 Sep 2022 13:47:34 +0200
Subject: [PATCH] Calculate Newton coefficients on the fly

Since we are cross-compiling, we do not get a binary we can run on the
host that is able to generate `newton_table.c`, so fall back to the old
way of generating the table.
---
 timidity/Makefile.in | 2 --
 timidity/resample.c  | 5 +----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/timidity/Makefile.in b/timidity/Makefile.in
index e4ee43c..a93105e 100644
--- a/timidity/Makefile.in
+++ b/timidity/Makefile.in
@@ -1956,8 +1956,6 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am
 version.$(OBJEXT): version.c ../configure
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(CFLAGS) -c $(srcdir)/version.c
 
-resample.c: newton_table.c
-
 @VCPP_TRUE@newton_table.c: calcnewt$(EXEEXT)
 @VCPP_TRUE@	./calcnewt $@
 
diff --git a/timidity/resample.c b/timidity/resample.c
index cd6b8e6..a878526 100644
--- a/timidity/resample.c
+++ b/timidity/resample.c
@@ -46,7 +46,6 @@
 
 /* for start/end of samples */
 static float newt_coeffs[58][58] = {
-#include "newton_table.c"
 };
 
 int sample_bounds_min, sample_bounds_max; /* min/max bounds for sample data */
@@ -468,7 +467,6 @@ void free_gauss_table(void)
 	gauss_table[0] = NULL;
 }
 
-#if 0 /* NOT USED */
 /* the was calculated statically in newton_table.c */
 static void initialize_newton_coeffs(void)
 {
@@ -499,12 +497,11 @@ static void initialize_newton_coeffs(void)
     	for (j = 0, sign = pow(-1, i); j <= i; j++, sign *= -1)
     	    newt_coeffs[i][j] *= sign;
 }
-#endif /* NOT USED */
 
 /* initialize the coefficients of the current resampling algorithm */
 void initialize_resampler_coeffs(void)
 {
-    /* initialize_newton_coeffs(); */
+    initialize_newton_coeffs();
     initialize_gauss_table(gauss_n);
     /* we don't have to initialize newton table any more */