Skip to content

Commit

Permalink
fixed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vlazzarini committed Dec 14, 2017
1 parent cdc54a4 commit b46e8d3
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Engine/cs_new_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ taskID dag_end_task(CSOUND *csound, taskID i)
{ /* ATOMIC_SWAP */
do {
to_notify = ATOMIC_READ(task_watch[i]);
} while (!ATOMIC_CAS_PTR(&task_watch[i],to_notify,&DoNotRead));
} while (!ATOMIC_CAS_PTR(&task_watch[i],to_notify, (struct _watchList *) &DoNotRead));
} //to_notify = ATOMIC_SWAP(task_watch[i], &DoNotRead);
//printf("Ending task %d\n", i);
next = to_notify;
Expand Down
3 changes: 2 additions & 1 deletion Engine/cs_par_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ int barrier_destroy(barrier_t *b)
/* when barrier is passed, all threads except one return 0 */
int barrier_wait(barrier_t *b)
{
int ret, it;
int ret;
unsigned int it;

pthread_mutex_lock(&b->mut);
b->count++;
Expand Down
4 changes: 3 additions & 1 deletion Engine/cs_par_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static inline void csp_locks_unlock(CSOUND * csound, int global_index)
/* csound->global_var_lock_cache[global_index]->name); */
}

#if 0
static struct global_var_lock_t *global_var_lock_alloc(CSOUND *csound,
char *name, int index)
{
Expand All @@ -98,6 +99,8 @@ static struct global_var_lock_t *global_var_lock_alloc(CSOUND *csound,
return ret;
}



static struct global_var_lock_t
*global_var_lock_find(CSOUND *csound, char *name)
{
Expand Down Expand Up @@ -131,7 +134,6 @@ static struct global_var_lock_t
}
}

#if 0
static TREE *csp_locks_insert(CSOUND *csound, TREE *root)
{
csound->Message(csound,
Expand Down
2 changes: 2 additions & 0 deletions Engine/csound_orc.lex
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,13 @@ FNAME [a-zA-Z0-9/:.+-_]+

%%

/* currently unused
static inline int isNameChar(int c, int pos)
{
c = (int) ((unsigned char) c);
return (isalpha(c) || (pos && (c == '_' || isdigit(c))));
}
*/

ORCTOKEN *new_token(CSOUND *csound, int type)
{
Expand Down
6 changes: 3 additions & 3 deletions Engine/csound_orc_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,13 @@ void addGlobalVariable(CSOUND *csound,

void* find_or_add_constant(CSOUND* csound, CS_HASH_TABLE* constantsPool,
const char* name, MYFLT value) {
void* retVal = cs_hash_table_get(csound, constantsPool, name);
void* retVal = cs_hash_table_get(csound, constantsPool, (char *) name);
if (retVal == NULL) {
CS_VAR_MEM *memValue = csound->Calloc(csound, sizeof(CS_VAR_MEM));
memValue->varType = (CS_TYPE*)&CS_VAR_TYPE_C;
memValue->value = value;
cs_hash_table_put(csound, constantsPool, name, memValue);
retVal = cs_hash_table_get(csound, constantsPool, name);
cs_hash_table_put(csound, constantsPool, (char *) name, memValue);
retVal = cs_hash_table_get(csound, constantsPool, (char *) name);
}
return retVal;
}
Expand Down
2 changes: 2 additions & 0 deletions Engine/sread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,7 @@ static void flushlin(CSOUND *csound)
STA(lincnt)++;
}

/* unused at the moment
static inline int check_preproc_name(CSOUND *csound, const char *name)
{
int i;
Expand All @@ -1602,6 +1603,7 @@ static inline int check_preproc_name(CSOUND *csound, const char *name)
}
return 1;
}
*/

static int sget1(CSOUND *csound) /* get first non-white, non-comment char */
{
Expand Down
2 changes: 1 addition & 1 deletion Opcodes/paulstretch.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void compute_block(CSOUND *csound, PAULSTRETCH *p)
// TODO - Double check this is equivalent to non-windows complex definition
_Fcomplex ph = { cos(x), sin(x) };
#else
complex ph = cos(x) + I*sin(x);
complex double ph = cos(x) + I*sin(x);
#endif
tmp[i] = mag * (MYFLT)crealf(ph);
tmp[i + 1] = mag * (MYFLT)cimagf(ph);
Expand Down
1 change: 1 addition & 0 deletions Top/csound.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ static const CSOUND cenviron_ = {
0, /* alloc_queue_items */
0, /* alloc_queue_wp */
0, /* alloc_spinlock */
NULL, /* init_event */
NULL, /* message string callback */
NULL, /* message_string */
0, /* message_string_queue_items */
Expand Down
3 changes: 2 additions & 1 deletion Top/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ PUBLIC int csoundDestroyBarrier(void *barrier)
PUBLIC int csoundWaitBarrier(void *barrier)
{
#if !defined(HAVE_PTHREAD_BARRIER_INIT)
int ret, it;
int ret;
unsigned int it;
barrier_t *b = (barrier_t *)barrier;
pthread_mutex_lock(&b->mut);
b->count++;
Expand Down
2 changes: 2 additions & 0 deletions frontends/beats/beats.l
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ int yyline = 0;
extern int pnum;
%}

%option nounput

INTGR [0-9]+
FLOAT [[0-9]+\.([0-9]*)?
WHITE [ \t+]
Expand Down
2 changes: 1 addition & 1 deletion tests/c/csound_debugger_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void test_bkpt_instrument(void)
int count = 0;
static void brkpt_cb5(CSOUND *csound, debug_bkpt_info_t *bkpt_info, void *userdata)
{
debug_opcode_t *debug_opcode = bkpt_info->currentOpcode;
//debug_opcode_t *debug_opcode = bkpt_info->currentOpcode;
count++;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/c/csound_message_buffer_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void test_create_buffer(void)
int argc = 2;
const char *argv[] = {"csound", "-v"};
csoundCreateMessageBuffer(csound, 0);
int result = csoundCompile(csound, argc, argv);
csoundCompile(csound, argc, argv);

int cnt = csoundGetMessageCnt(csound);
CU_ASSERT(cnt > 0);
Expand All @@ -42,7 +42,7 @@ void test_buffer_run(void)
csoundSetGlobalEnv("OPCODE6DIR64", "../../");
CSOUND *csound = csoundCreate(0);
csoundCreateMessageBuffer(csound, 0);
int result = csoundCompileOrc(csound, "instr 1\n"
csoundCompileOrc(csound, "instr 1\n"
"asig oscil 0.1, 440\n"
"out asig\n"
"endin\n");
Expand Down
2 changes: 1 addition & 1 deletion tests/c/engine_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void test_udp_server(void)
csoundSetOption(csound,"-odac");
csoundSetOption(csound,"--port=12345");
/*result =*/(void) csoundStart(csound);
sleep(1);
csoundSleep(1000);
/* delete Csound instance */
csoundStop(csound);
csoundDestroy(csound);
Expand Down
5 changes: 3 additions & 2 deletions util/atsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ static inline unsigned int ppp2(int num);
static inline double amp2db(double amp);
static inline double db2amp(double db);
static inline double amp2db_spl(double amp);
static inline double db2amp_spl(double db_spl);
// static inline double db2amp_spl(double db_spl);

/* optimize_sound
* ==============
Expand Down Expand Up @@ -2453,11 +2453,12 @@ static inline double amp2db_spl(double amp)
return (amp2db(amp) + ATSA_MAX_DB_SPL);
}

/* unused at the moment
static inline double db2amp_spl(double db_spl)
{
return (db2amp(db_spl - ATSA_MAX_DB_SPL));
}

*/
/* ppp2
* ====
* returns the closest power of two
Expand Down
1 change: 1 addition & 0 deletions util/srconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ static int srconv(CSOUND *csound, int argc, char **argv)
return -1;
}
#else
#include <unistd.h>
static int srconv(CSOUND *csound, int argc, char **argv)
{
csound->Message(csound, Str("Do not use srconv but the src_conv program\n"));
Expand Down
4 changes: 2 additions & 2 deletions util1/scot/scot.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ void readinstsec(Inst *inst,
}
else if (!strncmp(s, "timesignature", c)) {
efindword(s);
if ((sscanf(s, "%lu/%lu", &timesig->num, &timesig->denom) != 2) ||
(&timesig->denom == 0)) {
if ((sscanf(s, "%lu/%lu", &timesig->num, &timesig->denom) != 2) /*||
(&timesig->denom == 0) */) {
scoterror(Str("Invalid time signature"));
timesig->num = 0;
timesig->denom = 1;
Expand Down

0 comments on commit b46e8d3

Please sign in to comment.