| I compared the sources in Csound.tar.gz distributed in the csound
package as version csound4.23f12, with the current version of the
sources in the csound directory in the csound module of the csound CVS
repository. I noticed what appears to be significant differences in
dumpf.c, otran.c, and widgets.cpp. Here is what I found.
John
$ diff -ur cvs/csound/csound proj/csound4_23f12
diff -ur cvs/csound/csound/dumpf.c proj/csound4_23f12/dumpf.c
--- cvs/csound/csound/dumpf.c 2004-07-18 10:17:54.000000000 -0400
+++ proj/csound4_23f12/dumpf.c 2004-03-04 13:16:32.000000000 -0500
@@ -33,27 +33,23 @@
void kdmpset(KDUMP *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundoname[1024];
- if (p->STRARG == NULL) strcpy(soundoname,unquote(currevent->strarg));
- else strcpy(soundoname,unquote(p->STRARG)); /* unquote it, else use */
-
- if ((p->fdch.fd = openout(soundoname,1)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundoname);
- initerror(errmsg);
- return;
- }
- fdrecord(&p->fdch);
- if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
- initerror(Str(X_1335,"unknown format request"));
- return;
- }
- if (p->format == 2 || p->format == 3) {
- initerror(Str(X_587,"alaw and ulaw not implemented here"));
- return;
- }
- if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
+ if ((p->fdch.fd = openout(p->STRARG, 1)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
+ initerror(errmsg);
+ return;
+ }
+ fdrecord(&p->fdch);
+ if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
+ initerror(Str(X_1335,"unknown format request"));
+ return;
+ }
+ if (p->format == 2 || p->format == 3) {
+ initerror(Str(X_587,"alaw and ulaw not implemented here"));
+ return;
+ }
+ if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
p->timcount = 1;
- p->countdown = p->timcount;
+ p->countdown = p->timcount;
}
else initerror(Str(X_1009,"need quoted filename"));
}
@@ -61,27 +57,23 @@
void kdmp2set(KDUMP2 *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundoname[1024];
- if (p->STRARG == NULL) strcpy(soundoname,unquote(currevent->strarg));
- else strcpy(soundoname,unquote(p->STRARG)); /* unquote it, else use */
-
- if ((p->fdch.fd = openout(soundoname,1)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundoname);
- initerror(errmsg);
- return;
- }
- fdrecord(&p->fdch);
- if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
- initerror(Str(X_1335,"unknown format request"));
- return;
- }
- if (p->format == 2 || p->format == 3) {
- initerror(Str(X_587,"alaw and ulaw not implemented here"));
- return;
- }
- if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
- p->timcount = 1;
- p->countdown = p->timcount;
+ if ((p->fdch.fd = openout(p->STRARG, 1)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
+ initerror(errmsg);
+ return;
+ }
+ fdrecord(&p->fdch);
+ if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
+ initerror(Str(X_1335,"unknown format request"));
+ return;
+ }
+ if (p->format == 2 || p->format == 3) {
+ initerror(Str(X_587,"alaw and ulaw not implemented here"));
+ return;
+ }
+ if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
+ p->timcount = 1;
+ p->countdown = p->timcount;
}
else initerror(Str(X_1009,"need quoted filename"));
}
@@ -89,27 +81,23 @@
void kdmp3set(KDUMP3 *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundoname[1024];
- if (p->STRARG == NULL) strcpy(soundoname,unquote(currevent->strarg));
- else strcpy(soundoname,unquote(p->STRARG)); /* unquote it, else use */
-
- if ((p->fdch.fd = openout(soundoname,1)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundoname);
- initerror(errmsg);
- return;
- }
- fdrecord(&p->fdch);
- if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
- initerror(Str(X_1335,"unknown format request"));
- return;
- }
- if (p->format == 2 || p->format == 3) {
- initerror(Str(X_587,"alaw and ulaw not implemented here"));
- return;
- }
- if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
- p->timcount = 1;
- p->countdown = p->timcount;
+ if ((p->fdch.fd = openout(p->STRARG, 1)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
+ initerror(errmsg);
+ return;
+ }
+ fdrecord(&p->fdch);
+ if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
+ initerror(Str(X_1335,"unknown format request"));
+ return;
+ }
+ if (p->format == 2 || p->format == 3) {
+ initerror(Str(X_587,"alaw and ulaw not implemented here"));
+ return;
+ }
+ if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
+ p->timcount = 1;
+ p->countdown = p->timcount;
}
else initerror(Str(X_1009,"need quoted filename"));
}
@@ -117,27 +105,23 @@
void kdmp4set(KDUMP4 *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundoname[1024];
- if (p->STRARG == NULL) strcpy(soundoname,unquote(currevent->strarg));
- else strcpy(soundoname,unquote(p->STRARG)); /* unquote it, else use */
-
- if ((p->fdch.fd = openout(soundoname,1)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundoname);
- initerror(errmsg);
- return;
- }
- fdrecord(&p->fdch);
- if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
- initerror(Str(X_1335,"unknown format request"));
- return;
- }
- if (p->format == 2 || p->format == 3) {
- initerror(Str(X_587,"alaw and ulaw not implemented here"));
- return;
- }
- if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
- p->timcount = 1;
- p->countdown = p->timcount;
+ if ((p->fdch.fd = openout(p->STRARG, 1)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
+ initerror(errmsg);
+ return;
+ }
+ fdrecord(&p->fdch);
+ if ((p->format = (int)*p->iformat) < 1 || p->format > 8) {
+ initerror(Str(X_1335,"unknown format request"));
+ return;
+ }
+ if (p->format == 2 || p->format == 3) {
+ initerror(Str(X_587,"alaw and ulaw not implemented here"));
+ return;
+ }
+ if ((p->timcount = (long)(*p->iprd * ekr)) <= 0)
+ p->timcount = 1;
+ p->countdown = p->timcount;
}
else initerror(Str(X_1009,"need quoted filename"));
}
@@ -271,11 +255,8 @@
void krdset(KREAD *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundiname[1024];
- if (p->STRARG == NULL) strcpy(soundiname,unquote(currevent->strarg));
- else strcpy(soundiname,unquote(p->STRARG)); /* unquote it, else use */
- if ((p->fdch.fd = openin(soundiname)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundiname);
+ if ((p->fdch.fd = openin(p->STRARG)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
initerror(errmsg);
return;
}
@@ -302,11 +283,8 @@
void krd2set(KREAD2 *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundiname[1024];
- if (p->STRARG == NULL) strcpy(soundiname,unquote(currevent->strarg));
- else strcpy(soundiname,unquote(p->STRARG)); /* unquote it, else use */
- if ((p->fdch.fd = openin(soundiname)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundiname);
+ if ((p->fdch.fd = openin(p->STRARG)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
initerror(errmsg);
return;
}
@@ -333,11 +311,8 @@
void krd3set(KREAD3 *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundiname[1024];
- if (p->STRARG == NULL) strcpy(soundiname,unquote(currevent->strarg));
- else strcpy(soundiname,unquote(p->STRARG)); /* unquote it, else use */
- if ((p->fdch.fd = openin(soundiname)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundiname);
+ if ((p->fdch.fd = openin(p->STRARG)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
initerror(errmsg);
return;
}
@@ -364,11 +339,8 @@
void krd4set(KREAD4 *p)
{
if (*p->ifilcod == sstrcod) { /* open in curdir or pathname */
- char soundiname[1024];
- if (p->STRARG == NULL) strcpy(soundiname,unquote(currevent->strarg));
- else strcpy(soundiname,unquote(p->STRARG)); /* unquote it, else use */
- if ((p->fdch.fd = openin(soundiname)) < 0) {
- sprintf(errmsg,Str(X_210,"Cannot open %s"), soundiname);
+ if ((p->fdch.fd = openin(p->STRARG)) < 0) {
+ sprintf(errmsg,Str(X_210,"Cannot open %s"), retfilnam);
initerror(errmsg);
return;
}
diff -ur cvs/csound/csound/otran.c proj/csound4_23f12/otran.c
--- cvs/csound/csound/otran.c 2004-07-09 09:34:44.000000000 -0400
+++ proj/csound4_23f12/otran.c 2003-11-29 13:33:21.000000000 -0500
@@ -248,12 +248,6 @@
displop4 = getopnum("specdisp");
rdorchfile(); /* go read orch file */
- if (pool == NULL) {
- pool = (MYFLT *)mmalloc((long)NCONSTS * sizeof(MYFLT));
- *pool = (MYFLT)SSTRCOD;
- poolcount = 1;
- nconsts = NCONSTS;
- }
while ((tp = getoptxt(&init)) != NULL) { /* then for each opcode: */
unsigned int threads=0;
int opnum = tp->opnum;
@@ -837,6 +831,12 @@
MYFLT *fp;
char *str = s;
+ if (pool == NULL) {
+ pool = (MYFLT *)mmalloc((long)NCONSTS * sizeof(MYFLT));
+ *pool = (MYFLT)SSTRCOD;
+ poolcount = 1;
+ nconsts = NCONSTS;
+ }
if (sizeof(MYFLT)==4) {
if (sscanf(s,"%f",&newval) != 1) goto flerror;
}
diff -ur cvs/csound/csound/widgets.cpp proj/csound4_23f12/widgets.cpp
--- cvs/csound/csound/widgets.cpp 2004-07-04 17:39:13.000000000 -0400
+++ proj/csound4_23f12/widgets.cpp 2003-11-30 12:27:04.000000000 -0500
@@ -1,27 +1,3 @@
-/*
- widgets.cpp:
-
- Copyright (C) 2002 Gabriel Maldonado
-
- This file is part of Csound.
-
- The Csound Library is free software; you can redistribute it
- and/or modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- Csound is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with Csound; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA
-*/
-
-#include "autoheader.h"
#ifdef _WIN32
# pragma warning(disable: 4117 4804)
#endif
@@ -29,7 +5,10 @@
#include
#include
#if defined(WIN32)
-# include
+# include
+# include
+# include
+extern int "C" errno;
#endif /* defined(WIN32) */
#if defined(LINUX)
# include
@@ -68,11 +47,7 @@
#include
#include
-
#include
-#if defined _WIN32 || defined __CYGWIN__
-#include
-#endif
#include
using namespace std ;
@@ -107,7 +82,7 @@
// ---- IV - Aug 23 2002 ---- included file: Fl_linux_stubs.cpp
/*
- * $Id: widgets.cpp,v 1.8 2004/07/04 21:39:13 ramsdell Exp $
+ * $Id: Fl_linux_stubs.cpp,v 0.0 2001/05/17 00:17:22 nicb Exp $
*
* this is a file used in the linux distribution to be able to use
* the DirectCsound 5.1 widget code by Gabriel Maldonado on linux
@@ -153,7 +128,7 @@
#include
-char * /* IV - Sep 8 2002 */
+static char * /* IV - Sep 8 2002 */
itoa(int value, char *buffer, int radix)
{
const char *r10 = "%d";
@@ -412,9 +387,9 @@
{
float x1,y1,x2,y2,rds,cx,cy,ca,sa;
- rds = side / 2.0f;
- cx = ox + side / 2.0f;
- cy = oy + side / 2.0f;
+ rds = side / 2;
+ cx = ox + side / 2;
+ cy = oy + side / 2;
if (!(_type & DOTLOG_3)) {
if (_scaleticks == 0) return;
double a_step = (10.0*3.14159/6.0) / _scaleticks;
@@ -470,16 +445,16 @@
float rds,cur,cx,cy;
double angle;
- rds = (side - 20.0f) / 2.0f;
- cur = _percent * rds / 2.0f;
- cx = ox + side / 2.0f;
- cy = oy + side / 2.0f;
+ rds = (side - 20) / 2.0;
+ cur = _percent * rds / 2;
+ cx = ox + side / 2;
+ cy = oy + side / 2;
angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1;
fl_push_matrix();
fl_scale(1,1);
fl_translate(cx,cy);
fl_rotate(-angle);
- fl_translate(0,rds-cur-2.0f);
+ fl_translate(0,rds-cur-2.0);
if (_type 1.0f) _percent = 1.0f;
@@ -1303,7 +1278,7 @@
break;
case EXP_:
range = fld.max - fld.min;
- base = ::pow(fld.max / fld.min, 1/range);
+ base = pow(fld.max / fld.min, 1/range);
((Fl_Positioner*) o)->xvalue(log(val/fld.min) / log(base)) ;
break;
default:
@@ -1319,7 +1294,7 @@
break;
case EXP_:
range = fld.max2 - fld.min2;
- base = ::pow(fld.max2 / fld.min2, 1/range);
+ base = pow(fld.max2 / fld.min2, 1/range);
((Fl_Positioner*) o)->yvalue(log(val/fld.min2) / log(base)) ;
break;
default:
@@ -1363,7 +1338,7 @@
break;
case EXP_:
range = p->slider_data[j].max - p->slider_data[j].min;
- base = ::pow(p->slider_data[j].max / p->slider_data[j].min, 1/range);
+ base = pow(p->slider_data[j].max / p->slider_data[j].min, 1/range);
((Fl_Valuator*) grup->child(j))->
value(log(val/p->slider_data[j].min) / log(base)) ;
break;
@@ -1384,7 +1359,7 @@
break;
case EXP_:
range = fld.max - fld.min;
- base = ::pow(fld.max / fld.min, 1/range);
+ base = pow(fld.max / fld.min, 1/range);
((Fl_Valuator*) o)->value(log(val/fld.min) / log(base)) ;
break;
default:
@@ -1473,7 +1448,7 @@
extern "C" void save_snap(FLSAVESNAPS* p)
{
-#ifdef WIN32
+#ifdef WIN32
int id = MessageBox( NULL,
"Saving could overwrite the old file.\n"
"Are you sure to save?",
@@ -1667,7 +1642,7 @@
for (j=0; j< ss; j++) {
snapshots[j].fields.erase(snapshots[j].fields.begin(),
snapshots[j].fields.end());
- snapshots.resize(snapshots.size() + 1);
+ snapshots.resize(snapshots.size()+1);
}
if (isActivatedKeyb) {
delete oKeyb;
@@ -1819,7 +1794,7 @@
static void fl_callbackExponentialSlider(Fl_Valuator* w, void *a)
{
FLSLIDER *p = ((FLSLIDER*) a);
- displ(*p->kout = p->min * ::pow (p->base, w->value()), *p->idisp);
+ displ(*p->kout = p->min * pow (p->base, w->value()), *p->idisp);
}
@@ -1854,7 +1829,7 @@
static void fl_callbackExponentialSliderBank(Fl_Valuator* w, void *a)
{
SLDBK_ELEMENT* p = (SLDBK_ELEMENT*) a;
- *p->out = p->min * ::pow (p->base, w->value());
+ *p->out = p->min * pow (p->base, w->value());
}
@@ -1888,7 +1863,7 @@
val = j->xvalue();
break;
case EXP_:
- val = *p->iminx * ::pow (p->basex, j->xvalue());
+ val = *p->iminx * pow (p->basex, j->xvalue());
break;
default:
if (iexpx > 0) { //interpolated
@@ -1908,7 +1883,7 @@
val = j->yvalue();
break;
case EXP_:
- val = *p->iminy * ::pow (p->basey, j->yvalue());
+ val = *p->iminy * pow (p->basey, j->yvalue());
break;
default:
if (iexpy > 0) { //interpolated
@@ -1937,7 +1912,7 @@
static void fl_callbackExponentialRoller(Fl_Valuator* w, void *a)
{
FLROLLER *p = ((FLROLLER*) a);
- displ(*p->kout = ((FLROLLER*) a)->min * ::pow (p->base, w->value()), *p->idisp);
+ displ(*p->kout = ((FLROLLER*) a)->min * pow (p->base, w->value()), *p->idisp);
}
@@ -1970,7 +1945,7 @@
static void fl_callbackExponentialKnob(Fl_Valuator* w, void *a)
{
FLKNOB *p = ((FLKNOB*) a);
- displ( *p->kout = ((FLKNOB*) a)->min * ::pow (p->base, w->value()), *p->idisp);
+ displ( *p->kout = ((FLKNOB*) a)->min * pow (p->base, w->value()), *p->idisp);
}
@@ -2334,7 +2309,7 @@
break;
case EXP_: //exponential
range = v.max-v.min;
- base = ::pow(v.max / v.min, 1/range);
+ base = pow(v.max / v.min, 1/range);
val = (log(val/v.min) / log(base)) ;
break;
default:
@@ -2715,7 +2690,7 @@
initerror("FLslider: zero is illegal in exponential operations");
range = max - min;
o->range(0,range);
- p->base = ::pow((max / min), 1/range);
+ p->base = pow((max / min), 1/range);
o->callback((Fl_Callback*)fl_callbackExponentialSlider,(void *) p);
break;
default:
@@ -2885,13 +2860,13 @@
initerror("FLsliderBank: zero is illegal in exponential operations");
range = max - min;
o->range(0,range);
- p->slider_data[j].base = ::pow((max / min), 1/range);
+ p->slider_data[j].base = pow((max / min), 1/range);
o->callback((Fl_Callback*)fl_callbackExponentialSliderBank,
(void *) &(p->slider_data[j]));
{
val = outable[j];
MYFLT range = max-min;
- MYFLT base = ::pow(max / min, 1/range);
+ MYFLT base = pow(max / min, 1/range);
val = (log(val/min) / log(base)) ;
}
break;
@@ -2972,7 +2947,7 @@
initerror("FLjoy X axe: zero is illegal in exponential operations");
MYFLT range = *p->imaxx - *p->iminx;
o->xbounds(0,range);
- p->basex = ::pow((*p->imaxx / *p->iminx), 1/range);
+ p->basex = pow((*p->imaxx / *p->iminx), 1/range);
} break;
default:
{
@@ -3000,7 +2975,7 @@
initerror("FLjoy X axe: zero is illegal in exponential operations");
MYFLT range = *p->imaxy - *p->iminy;
o->ybounds(0,range);
- p->basey = ::pow((*p->imaxy / *p->iminy), 1/range);
+ p->basey = pow((*p->imaxy / *p->iminy), 1/range);
} break;
default:
{
@@ -3093,7 +3068,7 @@
initerror("FLknob: zero is illegal in exponential operations");
MYFLT range = max - min;
o->range(0,range);
- p->base = ::pow((max / min), 1/range);
+ p->base = pow((max / min), 1/range);
o->callback((Fl_Callback*)fl_callbackExponentialKnob,(void *) p);
} break;
default:
@@ -3361,7 +3336,7 @@
initerror("FLslider: zero is illegal in exponential operations");
MYFLT range = max - min;
o->range(0,range);
- p->base = ::pow((max / min), 1/range);
+ p->base = pow((max / min), 1/range);
o->callback((Fl_Callback*)fl_callbackExponentialRoller,(void *) p);
}
break;
@@ -3374,7 +3349,7 @@
p->tablen = ftp->flen;
}
else return;
- o->range(0,0.99999999);
+ o->range(0,.99999999);
if (iexp > 0) //interpolated
o->callback((Fl_Callback*)fl_callbackInterpTableRoller,(void *) p);
else // non-interpolated |