Permalink
Browse files

fixing further warnings

  • Loading branch information...
vlazzarini committed Dec 15, 2017
1 parent c171b36 commit 7bad3e3801e219860d91b1845f42c87812fc1d89
@@ -108,6 +108,7 @@ static unsigned int cs_name_hash(char *s)
PUBLIC void* cs_hash_table_get(CSOUND* csound,
CS_HASH_TABLE* hashTable, char* key) {
IGN(csound);
unsigned int index;
CS_HASH_TABLE_ITEM* item;
@@ -132,6 +133,7 @@ PUBLIC char* cs_hash_table_get_key(CSOUND* csound,
CS_HASH_TABLE* hashTable, char* key) {
unsigned int index;
CS_HASH_TABLE_ITEM* item;
IGN(csound);
if (key == NULL) {
return NULL;
@@ -1212,7 +1212,7 @@ void cs_init_omacros(CSOUND *csound, PRE_PARM *qq, NAMES *nn)
if (p == NULL)
p = s + strlen(s);
if (csound->oparms->msglevel & 7)
csound->Message(csound, Str("Macro definition for %*s\n"), p - s, s);
csound->Message(csound, Str("Macro definition for %*s\n"), (int) (p - s), s);
s = strchr(s, ':') + 1; /* skip arg bit */
if (UNLIKELY(s == NULL || s >= p)) {
csound->Die(csound, Str("Invalid macro name for --omacro"));
@@ -1329,7 +1329,7 @@ void cs_init_smacros(CSOUND *csound, PRS_PARM *qq, NAMES *nn)
if (p == NULL)
p = s + strlen(s);
if (UNLIKELY(csound->oparms->msglevel & 7))
csound->Message(csound, Str("Macro definition for %*s\n"), p - s, s);
csound->Message(csound, Str("Macro definition for %*s\n"), (int) (p - s), s);
s = strchr(s, ':') + 1; /* skip arg bit */
if (UNLIKELY(s == NULL || s >= p)) {
csound->Die(csound, Str("Invalid macro name for --smacro"));
@@ -30,16 +30,19 @@
/* MEMORY COPYING FUNCTIONS */
void myflt_copy_value(void* csound, void* dest, void* src) {
IGN(csound);
MYFLT* f1 = (MYFLT*)dest;
MYFLT* f2 = (MYFLT*)src;
*f1 = *f2;
}
void asig_copy_value(void* csound, void* dest, void* src) {
IGN(csound);
memcpy(dest, src, sizeof(MYFLT) * ((CSOUND*)csound)->ksmps);
}
void wsig_copy_value(void* csound, void* dest, void* src) {
IGN(csound);
memcpy(dest, src, sizeof(SPECDAT));
//TODO - check if this needs to copy SPECDAT's DOWNDAT member and AUXCH
}
@@ -166,6 +169,7 @@ void arrayInitMemory(void *csound, CS_VARIABLE* var, MYFLT* memblock) {
}
void varInitMemoryString(void *csound, CS_VARIABLE* var, MYFLT* memblock) {
IGN(var);
STRINGDAT *str = (STRINGDAT *)memblock;
CSOUND* cs = (CSOUND*)csound;
str->data = (char *) cs->Calloc(csound, 8);
@@ -174,6 +178,7 @@ void varInitMemoryString(void *csound, CS_VARIABLE* var, MYFLT* memblock) {
}
void varInitMemoryFsig(void *csound, CS_VARIABLE* var, MYFLT* memblock) {
IGN(var);
PVSDAT *fsig = (PVSDAT *)memblock;
IGN(csound);
memset(fsig, 0, sizeof(PVSDAT)); /* VL: clear memory for now */
@@ -94,9 +94,9 @@ OENTRY opcodlst_1[] = {
/* IV - Sep 8 2002 - added entries for user defined opcodes, xin, xout */
/* and setksmps */
{ "##userOpcode", S(UOPCODE),0, 7, "", "", useropcdset, useropcd, useropcd },
{ "##userOpcode", S(UOPCODE),0, 7, "", "", useropcdset, useropcd, useropcd, NULL },
/* IV - Sep 10 2002: removed perf time routines of xin and xout */
{ "xin", S(XIN_MAX),0, 1, "****************", "", xinset, NULL, NULL },
{ "xin", S(XIN_MAX),0, 1, "****************", "", xinset, NULL, NULL, NULL },
/* { "xin.64", S(XIN_HIGH),0, 1,
"****************************************************************", "",
xinset, NULL, NULL },
@@ -106,7 +106,7 @@ OENTRY opcodlst_1[] = {
"****************************************************************"
"****************************************************************", "",
xinset, NULL, NULL },*/
{ "xout", S(XOUT_MAX),0, 1, "", "*", xoutset, NULL, NULL },
{ "xout", S(XOUT_MAX),0, 1, "", "*", xoutset, NULL, NULL, NULL },
{ "setksmps", S(SETKSMPS),0, 1, "", "i", setksmpsset, NULL, NULL },
{ "ctrlinit",S(CTLINIT),0,1, "", "im", ctrlinit, NULL, NULL, NULL},
{ "massign",S(MASSIGN), 0,1, "", "iip",massign_p, NULL, NULL, NULL},
@@ -68,7 +68,7 @@ void readxfil(CSOUND *csound, EXTRACT_STATICS* extractStatics,
extractStatics->offsect = 999; extractStatics->offbeat = FL(0.0);
// while (fscanf(xfp, s) != EOF) {
// while (fscanf(xfp, "%.81s", s) != EOF) {
while (fscanf(xfp, "%.100s", s) > 0) {
while (fscanf(xfp, "%100s", s) > 0) {
// while (fgets(s, 82, xfp) > 0) {
char *c = s;
int i;
@@ -352,7 +352,7 @@ int insert(CSOUND *csound, int insno, EVTBLK *newevtp)
#ifdef BETA
if (UNLIKELY(O->odebug))
csound->Message(csound, "In insert: %d %lf %lf\n",
__LINE__, ip->p3, ip->offtim); /* *********** */
__LINE__, ip->p3.value, ip->offtim); /* *********** */
#endif
if (ip->p3.value > FL(0.0) && ip->offtim > 0.0) { /* if still finite time, */
double p2 = (double) ip->p2.value + csound->timeOffs;
@@ -704,7 +704,7 @@ static void schedofftim(CSOUND *csound, INSDS *ip)
}
#ifdef BETA
if (UNLIKELY(csound->oparms->odebug))
csound->Message(csound,"schedofftim: %lf %lf\n", ip->offtim,
csound->Message(csound,"schedofftim: %lf %lf %lf\n", ip->offtim,
(csound->icurTime + (0.505 * csound->ksmps))/csound->esr,
csound->ekr*((csound->icurTime +
(0.505 * csound->ksmps))/csound->esr));
@@ -2092,6 +2092,7 @@ int useropcd2(CSOUND *csound, UOPCODE *p)
int findLabelMemOffset(CSOUND* csound, INSTRTXT* ip, char* labelName) {
OPTXT* optxt = (OPTXT*) ip;
int offset = 0;
IGN(csound);
while ((optxt = optxt->nxtop) != NULL) {
TEXT* t = &optxt->t;
@@ -675,7 +675,7 @@ SNDMEMFILE *csoundLoadSoundFile(CSOUND *csound, const char *fileName, void *sfi)
}
p->data[p->nFrames] = 0.0f;
csound->FileClose(csound, fd);
csound->Message(csound, Str("File '%s' (sr = %d Hz, %d channel(s), %d "
csound->Message(csound, Str("File '%s' (sr = %d Hz, %d channel(s), %lld "
"sample frames) loaded into memory\n"),
p->fullName, (int) sfinfo->samplerate,
(int) sfinfo->channels,
@@ -249,6 +249,7 @@ static int getscochar(CSOUND *csound, int expand)
{
/* Read a score character, expanding macros if flag set */
int c;
IGN(expand);
#ifdef never
/* top: */
/* c = corfile_getc(STA(str)->cf); */
@@ -788,6 +789,7 @@ static void init_smacros(CSOUND *csound, NAMES *nn)
void sread_initstr(CSOUND *csound, CORFIL *sco)
{
/* sread_alloc_globals(csound); */
IGN(sco);
STA(inputs) = (IN_STACK*) csound->Malloc(csound, 20 * sizeof(IN_STACK));
STA(input_size) = 20;
STA(input_cnt) = 0;
@@ -232,7 +232,7 @@ void add_graph(CSOUND *csound, WINDAT *wdptr)
for (m = 0; m < NUMOFWINDOWS; m++) { // If text the same use slot
if (ST(menu) != NULL) {
if (ST(menu)[m].text != NULL && wdptr->caption != NULL){
if (ST(menu)[m].text != NULL && strlen(wdptr->caption) == 0){
if(strcmp(wdptr->caption, ST(menu)[m].text) == 0) {
replacing = 1;
goto replace;
@@ -572,7 +572,7 @@ void sfopenin(CSOUND *csound) /* init for continuous soundin */
STA(inbufsiz)); /* alloc inbuf space */
if (STA(pipdevout) == 2)
csound->Message(csound,
Str("reading %d sample blks of %d-bit floats from %s \n"),
Str("reading %d sample blks of %lu-bit floats from %s \n"),
O->inbufsamps * O->sfsampsize, sizeof(MYFLT)*8, sfname);
else {
csound->Message(csound,
@@ -868,7 +868,7 @@ void sfopenout(CSOUND *csound) /* init for sound out */
STA(outbufp) = STA(outbuf) = csound->Malloc(csound, STA(outbufsiz));
if (STA(pipdevout) == 2)
csound->Message(csound,
Str("writing %d sample blks of %d-bit floats to %s \n"),
Str("writing %d sample blks of %lu-bit floats to %s \n"),
O->outbufsamps, sizeof(MYFLT)*8, STA(sfoutname));
else {
csound->Message(csound, Str("writing %d-byte blks of %s to %s"),
@@ -942,7 +942,7 @@ void sfcloseout(CSOUND *csound)
report:
if (STA(pipdevout) == 2) {
csound->Message(csound,
Str("%d %d sample blks of %d-bit floats written to %s\n"),
Str("%d %d sample blks of %lu-bit floats written to %s\n"),
csound->nrecs, O->outbufsamps,
sizeof(MYFLT)*8, STA(sfoutname));
}
@@ -154,6 +154,7 @@ static int alloc_event(CSOUND *csound, unsigned long kcnt, unsigned char *data,
int st, int d1, int d2)
{
midiEvent_t *tmp;
IGN(data);
/* expand array if necessary */
if (MF(nEvents) >= MF(maxEvents)) {
MF(maxEvents) += (MF(maxEvents) >> 3);
@@ -165,7 +165,7 @@ static int start_portmidi(CSOUND *csound)
csoundUnLock();
#endif
if (UNLIKELY(errMsg != NULL)) {
csound->ErrorMsg(csound, Str(errMsg));
csound->ErrorMsg(csound, "%s", Str(errMsg));
return -1;
}
//#if !defined(WIN32)
@@ -277,7 +277,7 @@ int AuHAL_open(CSOUND *csound, const csRtAudioParams * parm,
0, NULL, sizeof(AudioDeviceID), &dev);
}
else csound->Warning(csound, Str("requested device %d out of range"),
else csound->Warning(csound, Str("requested device %d (%s) out of range"),
devnum, devinfo[CoreAudioDev].name);
}
}
@@ -1942,7 +1942,6 @@ class CsoundFLWindow : public Fl_Double_Window {
}
virtual int handle(int evt)
{
CSOUND* csound = csound_; //gab
switch (evt) {
case FL_FOCUS:
Fl::focus(this);
@@ -3298,8 +3297,8 @@ extern "C" {
{
int i = (int)*((MYFLT*)p->itext);
char* text;
if (i<0 || i>csound->GetStrsmax(csound)) text = "???";
else if ((text=csound->GetStrsets(csound,i))==NULL) text = "???";
if (i<0 || i>csound->GetStrsmax(csound)) text = (char *) "???";
else if ((text=csound->GetStrsets(csound,i))==NULL) text = (char *) "???";
return fl_box_(csound, p, text);
}
@@ -3322,8 +3321,8 @@ extern "C" {
char *text ;
ADDR_SET_VALUE v = widgetGlobals->AddrSetValue[(int) *p->ihandle];
Fl_Widget *o = (Fl_Widget *) v.WidgAddress;
if (i<0 || i>csound->GetStrsmax(csound)) text = "???";
else if ((text=csound->GetStrsets(csound,i))==NULL) text = "???";
if (i<0 || i>csound->GetStrsmax(csound)) text = (char *) "???";
else if ((text=csound->GetStrsets(csound,i))==NULL) text = (char *) "???";
o->label(text);
return OK;
}
@@ -5351,7 +5350,7 @@ extern "C" {
Str("FLsldBnkSet: invalid table number"));
}
// *startInd, *startSlid, *numSlid
if (UNLIKELY( ftp->flen < startInd + numslid)) {
if (UNLIKELY( (int) ftp->flen < startInd + numslid)) {
return csound->InitError(csound,
Str("FLslidBnkSet: table too short!"));
}
@@ -5420,7 +5419,7 @@ extern "C" {
Str("FLsldBnkSet: invalid table number"));
}
// *startInd, *startSlid, *numSlid
if (UNLIKELY( ftp->flen < startInd + numslid)) {
if (UNLIKELY((int) ftp->flen < startInd + numslid)) {
return csound->InitError(csound,
Str("FLslidBnkSet: table too short!"));
}
@@ -5500,7 +5499,7 @@ extern "C" {
Str("FLsldBnkSetk: invalid table number"));
}
// *startInd, *startSlid, *numSlid
if (UNLIKELY( ftp->flen < p->startind + p->numslid)) {
if (UNLIKELY( (int) ftp->flen < p->startind + p->numslid)) {
return csound->InitError(csound,
Str("FLslidBnkSetk: table too short!"));
}
@@ -5593,7 +5592,7 @@ extern "C" {
Str("FLslidBnkSetk: invalid table number"));
}
// *startInd, *startSlid, *numSlid
if (UNLIKELY( ftp->flen < p->startind + p->numslid)) {
if (UNLIKELY( (int) ftp->flen < p->startind + p->numslid)) {
return csound->InitError(csound,
Str("FLslidBnkSetk: table too short!"));
}
@@ -5620,8 +5619,7 @@ extern "C" {
static int fl_slider_bank_setVal_k(CSOUND *csound, FLSLDBNK_SETK *p)
{
WIDGET_GLOBALS *widgetGlobals =
(WIDGET_GLOBALS *) csound->QueryGlobalVariable(csound, "WIDGET_GLOBALS");
if (*p->kflag) {
FLSLIDERBANK *q = p->q;
MYFLT *table=p->table;
@@ -473,7 +473,7 @@ class Fl_Spin : public Fl_Valuator {
class Fl_Value_Input_Spin : public Fl_Valuator {
private:
CSOUND * csound;
int ix, iy, drag, indrag, sldrag;
int ix, iy, drag;
int delta, deltadir;
char soft_;
uchar mouseobj;
@@ -165,7 +165,7 @@ struct ADDR_SET_VALUE { /*: ADDR*/
void *new_WidgAddress, void *new_opcode, int grp = 0) :
exponential(new_exponential),min(new_min), max(new_max),
WidgAddress(new_WidgAddress),opcode(new_opcode),
widg_type(FL_WIDG), group(grp), joy(FL_JOY) {}
widg_type(FL_WIDG), joy(FL_JOY), group(grp) {}
ADDR_SET_VALUE()
{
exponential=LIN_;
@@ -29,6 +29,7 @@
int xyinset(CSOUND *csound, XYIN *p)
{
// This is not the way to do it; set _QQ in interlocks
IGN(p);
return csound->InitError(csound,
Str("xyin opcode has been deprecated in Csound6."));
}
Oops, something went wrong.

0 comments on commit 7bad3e3

Please sign in to comment.