File: garray_getfloat.patch

package info (click to toggle)
pd-creb 0.10.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,728 kB
  • sloc: ansic: 5,424; cpp: 1,197; makefile: 138; sh: 25
file content (92 lines) | stat: -rw-r--r-- 2,663 bytes parent folder | download | duplicates (2)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Description: use garray_getfloatwords()
 garray_getfloatarray() doesn't work on 64bit systems
Author: IOhannes m zmölnig
Origin: Debian
Forwarded: no
Last-Update: 2024-08-04
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- pd-creb.orig/modules/statwav~.c
+++ pd-creb/modules/statwav~.c
@@ -30,7 +30,7 @@
 {
     t_object x_obj;
     int x_npoints;
-    t_float *x_vec;
+    t_word *x_vec;
     t_symbol *x_arrayname;
     t_float x_f;
 } t_statwav_tilde;
@@ -53,7 +53,8 @@
     int n = (int)(w[4]);
     t_float maxindex;
     int imaxindex;
-    t_float *buf = x->x_vec, *fp;
+    t_word *buf = x->x_vec;
+    t_float *fp;
     int i;
 
     maxindex = x->x_npoints;
@@ -83,10 +84,10 @@
       ic = (index+1) % imaxindex;
       id = (index+2) % imaxindex;
 
-      a = buf[ia];
-      b = buf[ib];
-      c = buf[ic];
-      d = buf[id];
+      a = buf[ia].w_float;
+      b = buf[ib].w_float;
+      c = buf[ic].w_float;
+      d = buf[id].w_float;
       /* if (!i && !(count++ & 1023))
 	 post("fp = %lx,  shit = %lx,  b = %f",  fp, buf->b_shit,  b); */
       cminusb = c-b;
@@ -116,7 +117,7 @@
             pd_error(x, "statwav~: %s: no such array", x->x_arrayname->s_name);
         x->x_vec = 0;
     }
-    else if (!garray_getfloatarray(a, &x->x_npoints, &x->x_vec))
+    else if (!garray_getfloatwords(a, &x->x_npoints, &x->x_vec))
     {
         pd_error(x,"%s: bad template for statwav~", x->x_arrayname->s_name);
         x->x_vec = 0;
--- pd-creb.orig/modules/tabreadmix~.c
+++ pd-creb/modules/tabreadmix~.c
@@ -30,7 +30,7 @@
 {
     t_object x_obj;
     int x_npoints;
-    t_float *x_vec;
+    t_word *x_vec;
     t_symbol *x_arrayname;
     t_float x_f;
 
@@ -85,7 +85,7 @@
     t_float *out = (t_float *)(w[3]);
     int n = (int)(w[4]);    
     int maxxindex;
-    t_float *buf = x->x_vec;
+    t_word *buf = x->x_vec;
     int i;
     t_float currgain, prevgain;
     t_float c,s;
@@ -115,7 +115,8 @@
 
 	    /* mix and write */
 	    newpos = (int)(*pos++);
-	    *out++ = currgain * buf[(int)x->x_currpos] + prevgain * buf[(int)x->x_prevpos];	    
+	    *out++ = currgain * buf[(int)x->x_currpos].w_float
+	      + prevgain * buf[(int)x->x_prevpos].w_float;
 	    x->x_currpos += x->x_posinc;
 	    x->x_prevpos += x->x_posinc;
 	    
@@ -246,7 +247,7 @@
             pd_error(x,"tabreadmix~: %s: no such array", x->x_arrayname->s_name);
         x->x_vec = 0;
     }
-    else if (!garray_getfloatarray(a, &x->x_npoints, &x->x_vec))
+    else if (!garray_getfloatwords(a, &x->x_npoints, &x->x_vec))
     {
         pd_error(x,"%s: bad template for tabreadmix~", x->x_arrayname->s_name);
         x->x_vec = 0;