Csound Csound-dev Csound-tekno Search About

[Cs-dev] oddity in Top/csound.c

Date2014-06-12 09:07
Fromjohn ffitch
Subject[Cs-dev] oddity in Top/csound.c
Lines 1812-1816 read

    if(csound->scorestr != NULL &&
       csound->scorestr->body != NULL)
      corfile_rewind(csound->scorestr);

    csound->scorestr = corfile_create_w();

Surely if it does the rewind route it will be overwritten by the
create.  Is there an "else" missing?

==John ffitch

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-06-12 10:22
FromVictor Lazzarini
SubjectRe: [Cs-dev] oddity in Top/csound.c
It does look like it’s missing an else. 
I noticed also that csound->scorestr is freed in one of the branches below but not in the other:

    if(csound->scstr == NULL && (csound->engineStatus & CS_STATE_COMP) == 0) {
      scsortstr(csound, csound->scorestr);
      O->playscore = csound->scstr;
    }
    else {
      char *sc = scsortstr(csound, csound->scorestr);
      csoundInputMessageInternal(csound, (const char *) sc);
      free(sc);
      corfile_rm(&(csound->scorestr));
    }

========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 12 Jun 2014, at 09:07, john ffitch  wrote:

> Lines 1812-1816 read
> 
>    if(csound->scorestr != NULL &&
>       csound->scorestr->body != NULL)
>      corfile_rewind(csound->scorestr);
> 
>    csound->scorestr = corfile_create_w();
> 
> Surely if it does the rewind route it will be overwritten by the
> create.  Is there an "else" missing?
> 
> ==John ffitch
> 
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net