Csound Csound-dev Csound-tekno Search About

Re: b (ignore first)

Date1999-01-16 19:34
FromMichael Gogins
SubjectRe: b (ignore first)
Please guys, don't use macros if at all possible. Use functions, use enums,
don't use macros except to keep you from #including the same header file
twice.

-----Original Message-----
From: Gabriel Maldonado 
To: jpff@maths.bath.ac.uk 
Cc: Csound Mailing List 
Date: Saturday, January 16, 1999 3:25 AM
Subject: Re: b (ignore first)


>Dear Jpff,
>two questions about new score opcodes:
>
>1) Another nice thing to do is to implement nested repeats.
>I will be very happy if you will implement such feature.
>
>
>
>2) When I use the debug mode with MSVC, the compiler displays a lot of
error messages when
>using macros:
>
>memory check error at 0x00851C88 = 0x30, should be 0xFD
>
>I noticed that these messages are generated by a free() call, in particular
by:
>
>mfree(str->body);
>
>in file SREAD.C
>
>These errors doesnt appear in release compilation. Have you any idea?
>
>Gab

Date1999-01-17 11:07
FromNicola Bernardini
SubjectRe: b (ignore first)
On Sat, 16 Jan 1999, Michael Gogins wrote:

> Please guys, don't use macros if at all possible. Use functions, use enums,
> don't use macros except to keep you from #including the same header file
> twice.

I fully second the motion, even though I just had to convert an inline
function into a macro to re-install in the unofficial linux distribution
a mod that was removed in pitchbend handling (needed to check pointer
validity). Macros are extremely weak and lead to hard-to-find bugs...

Nicola

------------------------------------------------------------------------
Nicola Bernardini
E-mail: nicb@axnet.it
 
Re graphics: A picture is worth 10K words -- but only those to describe
the picture.  Hardly any sets of 10K words can be adequately described
with pictures.