[Bf-python] Re: Vector convenienve patch [committed]

Yann Vernier yann at algonet.se
Sun Jan 23 21:22:13 CET 2005


On Sun, Jan 23, 2005 at 12:34:47PM -0500, Stephen Swaney wrote:
> On Sun, Jan 23, 2005 at 06:10:44PM +0100, Yann Vernier wrote:
> > On Tue, Jan 04, 2005 at 09:35:51AM +0100, Yann Vernier wrote:
> > > After getting errors countless times from the Mathutils.Vector
> > > constructor function, I got a bit fed up and decided to make it less
> > > picky. After all, there's no reason for it not to accept tuples, or
> > > vectors for that matter. I modified it to accept either a sequence of
> > > 2-4 float-compatible arguments or a sequence containing that. This also
> > > removes a memory leak present in the old version, where the interface
> > > for newVectorObject was misunderstood.
> > 
> > python/api2_2x/Mathutils.c revision 1.6 now has this change checked in.
> 
> source/blender/python/api2_2x/Mathutils.c: In function `M_Mathutils_Vector':
> source/blender/python/api2_2x/Mathutils.c:281: warning: ISO C89 forbids mixed declarations and code
> 
> This will break on irix and some microsoft platforms.
> 
> Apologies for not getting this committed earlier.  I got distracted
> messing with gcc.  By default gcc runs in C89 + GNU extensions mode.
> This allows c++ comments and mixed code and declarations.  Most of our
> platforms can handle the c++ comments with appropriate flags, but they
> still choke on the mixed code and declarations.
I see. It's easy enough to move them apart, I'm not sure why I didn't in
the first place. Just checked that in.

> I suggest using the -pedantic flag when compiling with gcc.  This will
> complain over and over about the c++ comments but you can grep for
> 'mixed declarations' in the compiler output log.
Well, I just tried enabling -pedantic only to find that this makes other
parts of Blender fail to build. I'll just stick in in the SConscript
file for the Python section, I guess.



More information about the Bf-python mailing list