Skip to content

Commit

Permalink
working on #1707
Browse files Browse the repository at this point in the history
  • Loading branch information
vlazzarini committed Apr 30, 2023
1 parent c12f8e1 commit 4124c35
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
22 changes: 12 additions & 10 deletions Engine/csound_orc_semantics.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,18 +694,19 @@ int check_array_arg(char* found, char* required) {
return (*f == *r);
}

int check_in_arg(char* found, char* required) {
int check_in_arg(char* found, char* req) {
char* t;
int i;
char required[64];

if(required[0] == 'K' && found[0] == 'k'){
return 1;
}

if (UNLIKELY(found == NULL || required == NULL)) {
if (UNLIKELY(found == NULL || req == NULL)) {
return 0;
}

if(*req != 'K')
strcpy(required,req);
else strcpy(required, "k");

if (strcmp(found, required) == 0) {
return 1;
}
Expand Down Expand Up @@ -851,16 +852,17 @@ inline static int is_out_var_arg(char arg) {
int check_out_arg(char* found, char* required) {
char* t;
int i;


if (UNLIKELY(found == NULL || required == NULL)) {
return 0;
}


if(required[0] == 'K' && found[0] == 'k'){
return 1;
}

if (UNLIKELY(found == NULL || required == NULL)) {
return 0;
}


// constants not allowed in out args
if (strcmp(found, "c") == 0) {
Expand Down
7 changes: 3 additions & 4 deletions Engine/insert.c
Original file line number Diff line number Diff line change
Expand Up @@ -1643,15 +1643,14 @@ int xoutset(CSOUND *csound, XOUT *p)
current = inm->out_arg_pool->head;

for (i = 0; i < inm->outchns; i++) {
void* in = (void*)p->args[i];
void* in = (void*) p->args[i];
void* out = (void*)bufs[i];
tmp[i] = in;
// DO NOT COPY K or A vars
// Fsigs need to be copied for initialization purposes.
if ((csoundGetTypeForArg(in) != &CS_VAR_TYPE_K &&
/*csoundGetTypeForArg(in) != &CS_VAR_TYPE_F &&*/
csoundGetTypeForArg(in) != &CS_VAR_TYPE_A) || inm->outtypes[i] == 'K')
if (inm->outtypes_cpy[i] != 'k' && csoundGetTypeForArg(in) != &CS_VAR_TYPE_A)
current->varType->copyValue(csound, out, in);
// printf("%c \n", inm->outtypes_cpy[i]);
current = current->next;
}

Expand Down
1 change: 1 addition & 0 deletions Engine/symbtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ static int parse_opcode_args(CSOUND *csound, OENTRY *opc)
}
in_args = splitArgs(csound, intypes);
out_args = splitArgs(csound, inm->outtypes);
inm->outtypes_cpy = cs_strdup(csound, inm->outtypes);


if (UNLIKELY(in_args == NULL)) {
Expand Down
1 change: 1 addition & 0 deletions include/csoundCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ typedef struct NAME__ {
CS_VAR_POOL* in_arg_pool;
INSTRTXT *ip;
struct opcodinfo *prv;
char *outtypes_cpy;
} OPCODINFO;

/**
Expand Down

0 comments on commit 4124c35

Please sign in to comment.