diff options
author | Debian Multimedia Maintainers <debian-multimedia@lists.debian.org> | 2022-09-04 14:01:33 +0200 |
---|---|---|
committer | IOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org> | 2022-09-04 14:01:33 +0200 |
commit | b1c0fb52c38c5bf41d673dc48be06ecd46e1bb6c (patch) | |
tree | fdac42342dc0ff5c73c0b4feae62b2a82745754c | |
parent | 5d9e62bb9660701e9ae8461e40f275193345948a (diff) |
64bit safe array-accessarchive/debian/1.5.5-4
Forwarded: no
Last-Update: 2018-09-30
Last-Update: 2018-09-30
Gbp-Pq: Name array64.patch
-rw-r--r-- | arbran.c | 26 | ||||
-rw-r--r-- | score.c | 8 | ||||
-rw-r--r-- | subst.c | 16 |
3 files changed, 25 insertions, 25 deletions
@@ -56,14 +56,14 @@ static void rand_arbran_pdfscale(t_rand_arbran *x) t_garray *bx = x->x_bufx, *bp = x->x_bufp; t_float a = 0; t_int k = 0; - t_float *tx, *tp; + t_word *tx, *tp; int ix, ip; - if (!garray_getfloatarray(bx, &ix, &tx)) + if (!garray_getfloatwords(bx, &ix, &tx)) { post("arbran: couldn't read from array!"); return; } - if (!garray_getfloatarray(bp, &ip, &tp)) + if (!garray_getfloatwords(bp, &ip, &tp)) { post("arbran: couldn't read from array!"); return; @@ -71,11 +71,11 @@ static void rand_arbran_pdfscale(t_rand_arbran *x) for(k = 1; k < ix; k++) { - a += (tx[k]-tx[k-1])*(tp[k]+tp[k-1])/2.0; + a += (tx[k].w_float-tx[k-1].w_float)*(tp[k].w_float+tp[k-1].w_float)/2.0; } for(k = 0; k < ix; k++) { - tp[k] = tp[k]/a; + tp[k].w_float = tp[k].w_float/a; } garray_redraw(x->x_bufp); } @@ -85,14 +85,14 @@ static void rand_arbran_bang(t_rand_arbran *x) t_garray *bx = x->x_bufx, *bp = x->x_bufp; t_float a, u, a0, slope, b, d, r; t_int k = 0; - t_float *tx, *tp; + t_word *tx, *tp; int ix, ip; - if (!garray_getfloatarray(bx, &ix, &tx)) + if (!garray_getfloatwords(bx, &ix, &tx)) { post("arbran: couldn't read from array!"); return; } - if (!garray_getfloatarray(bp, &ip, &tp)) + if (!garray_getfloatwords(bp, &ip, &tp)) { post("arbran: couldn't read from array!"); return; @@ -103,20 +103,20 @@ static void rand_arbran_bang(t_rand_arbran *x) u = fran(); while(u > a) { - a0 = (tx[k+1]-tx[k])*(tp[k+1]+tp[k])/2.0; + a0 = (tx[k+1].w_float-tx[k].w_float)*(tp[k+1].w_float+tp[k].w_float)/2.0; a += a0; k++; } k--; - slope = (tp[k+1]-tp[k])/(tx[k+1]-tx[k]); + slope = (tp[k+1].w_float-tp[k].w_float)/(tx[k+1].w_float-tx[k].w_float); if(slope == 0) { - r = (u-a+a0)/tp[k]+tx[k]; + r = (u-a+a0)/tp[k].w_float+tx[k].w_float; } else { - b=tp[k]/slope-tx[k]; - d=b*b+tx[k]*tx[k]+2*b*tx[k]+2*(u-a+a0)/slope; + b=tp[k].w_float/slope-tx[k].w_float; + d=b*b+tx[k].w_float*tx[k].w_float+2*b*tx[k].w_float+2*(u-a+a0)/slope; if(slope > 0) r=-b+sqrt(d); else @@ -72,7 +72,7 @@ static void score_float(t_score *x, t_floatarg f) t_int velo = x->x_velo; /* get the velocity */ t_garray *b = x->x_buf; /* make local copy of array */ - float *tab; /* we'll store notes in here */ + t_word *tab; /* we'll store notes in here */ int items; int i, j, n, check; @@ -86,7 +86,7 @@ static void score_float(t_score *x, t_floatarg f) x->x_error = 1; goto output; } - if (!garray_getfloatarray(b, &items, &tab)) + if (!garray_getfloatwords(b, &items, &tab)) { post("score: couldn't read from array!"); x->x_error = 1; @@ -111,7 +111,7 @@ static void score_float(t_score *x, t_floatarg f) for (i = x->x_index + 1; i < (x->x_index + x->x_skipindex + 1); i++) { // post("%d: %d -> %d", i, x->x_alloctable[n], (t_int)tab[i]); - if(x->x_alloctable[n] == (t_int)tab[i]) + if(x->x_alloctable[n] == (int)tab[i].w_float) { if(i - x->x_index != 1) post("score: skipped %d notes!", i - x->x_index - 1); x->x_alloctable[n] = -1; /* delete note, we've matched it! */ @@ -127,7 +127,7 @@ static void score_float(t_score *x, t_floatarg f) for (j = 0; j < MAX_NOTES; j++) /* check with every note from our alloctable */ { - if (x->x_alloctable[check] == (t_int)tab[i]) /* this one would fit */ + if (x->x_alloctable[check] == (int)tab[i].w_float) /* this one would fit */ { /* check the time restrictions */ if (clock_gettimesince(x->x_starttime[check]) < x->x_skiptime) @@ -148,7 +148,7 @@ static int subst_calc(t_subst *x, int n) t_atom newrow[MAXSIZE]; t_garray *A = x->x_buf; int npoints; - t_float *vec; + t_word *vec; if(x->x_length <= 1) { @@ -224,7 +224,7 @@ static int subst_calc(t_subst *x, int n) // write to array if(x->x_array)if (!(A = (t_garray *)pd_findbyclass(x->x_array, garray_class))) error("subst: %s: no such array", x->x_array->s_name); - else if (!garray_getfloatarray(A, &npoints, &vec)) + else if (!garray_getfloatwords(A, &npoints, &vec)) error("subst: %s: bad template ", x->x_array->s_name); else { @@ -234,7 +234,7 @@ static int subst_calc(t_subst *x, int n) { while(npoints--) { - *vec++ = atom_getfloat(x->x_row + i); + vec[i].w_float = atom_getfloat(x->x_row + i); i++; } } @@ -243,10 +243,10 @@ static int subst_calc(t_subst *x, int n) npoints -= l; while (l--) { - *vec++ = atom_getfloat(x->x_row + i); + vec[i].w_float = atom_getfloat(x->x_row + i); i++; } - while (npoints--) *vec++ = 0; + while (npoints--) { vec[i].w_float = 0; i++; } } garray_redraw(A); } @@ -298,7 +298,7 @@ void subst_set(t_subst *x, t_symbol *s) static void subst_load(t_subst *x, t_symbol *s) { t_garray *b; /* make local copy of array */ - t_float *tab; /* the content itselfe */ + t_word *tab; /* the content itselfe */ int items, i; if ((b = (t_garray *)pd_findbyclass(s, garray_class))) @@ -310,14 +310,14 @@ static void subst_load(t_subst *x, t_symbol *s) } // read from our array - if (!garray_getfloatarray(b, &items, &tab)) + if (!garray_getfloatwords(b, &items, &tab)) { post("subst: couldn't read from array!"); return; } for(i = 0; i < items; i++) { - SETFLOAT(x->x_row + i, tab[i]); // copy array into x->x_row + SETFLOAT(x->x_row + i, tab[i].w_float); // copy array into x->x_row } x->x_length = items; post("subst: loaded %d values from array \"%s\"", items, s->s_name); |