Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] instring/outstring

Date2006-05-30 14:25
FromMichael Gogins
SubjectRe: [Cs-dev] instring/outstring
I agree with Matt about not putting text after '\0' in strings. It's not what I would call "expected behavior."

Regards,
Mike

-----Original Message-----
>From: matt ingalls 
>Sent: May 30, 2006 3:36 AM
>To: Developer discussions 
>Subject: Re: [Cs-dev] instring/outstring
>
>
>On May 29, 2006, at 12:04 PM, Istvan Varga wrote:
>
>> On Monday 29 May 2006 20:46, matt ingalls wrote:
>>
>>> well if you are that concerned about conflicts
>>> maybe using the "magic number" would be better
>>> then using a $ anyway?
>>>
>>> let's just keep my code as is and devote
>>> time to something less trivial.
>>
>> I did not replace your code yet: the other version is #ifdef-ed
>> out at this time. However, as you are already using $ for invalue,
>> removing any $ from the orchestra specified channel name is needed
>> because otherwise memory corruption would occur when the host tries
>
>OK -- in the future i would appreciate it if you just mention to me  
>about any
>concerns you may have in my code so i can change it myself,
>rather than just going in and fixing it 20 minutes after i have  
>checked it in.
>
>And putting FIXME all over it is just flat out rude, even if you
>think you are helping.
>
>> to write a string when in fact the orchestra expects a MYFLT.
>> I only suggested using the $ for outvalue as well for consistency,
>> and having the string value after the '\0' character of the channel
>> name is easier to parse, at least in C/C++, and slightly less
>> confusing to old hosts that are not aware of string values.
>
>perhaps, although doing a strstr() is about as easy.
>plus, using '\0' doesn't let you do string functions like strcpy()
>before parsing, and you will not be able to see the entire pair
>automatically in a debugger.  also for some reason putting text after a
>'\0' just seems too weird to me.
>
>-m
>
>
>
>
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel





_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net