[Bf-committers] Compile warnings

Ton Roosendaal ton at blender.org
Thu Sep 15 19:57:23 CEST 2005


Hi,

There's a couple of compiler warnings in last week's commits. Like  
usage of not prototyped functions, unused vars, unitialized vars. Easy  
to fix, will commit it myself. However, there's issues in Font,  
Edgeslide and Imagepaint I like to note:

- Font stuff:
If a wchar_t is an unsigned short, then this line cannot work:

scr/editfont.c, line 1123
	cu->len= strlen(textbuf);

Since textbuf became wchar_t. Dunno the proper strlen version for this.

Then it looks like new code uses spaces instead of tabs. (interface.c,  
editfont.c). Should really be fixed! And follow code style of existing  
code.

The ui_do_but_CHARTAB() in interface.c is not a nice way to do it...  
this could be solved using existing button callbacks. Having editmode  
text code inside the core interface is not nice. Same goes for the  
drawing version of the button. Buttons should really serve more generic  
purposes. :)
I might check on that or help with it later.

Then there's six new globals, like G.selfont... is that really needed?

- EdgeSlide:
Johnny please check my commit-diff for editmesh_tools.c. The way  
variables are calculated are a bit confusing. My fixes are probably  
right, but check if the initialized values are correct!

- ImagePaint
The code added in headerimage.c is very messy. At least follow a bit  
the C convention as used in the rest of the file. Further I don't  
advise to use the old clever_numbut code anymore...
then there's a global array written with capitals (UVTEXTTOOL_DATA),  
and I really don't get why all these globals are needed in  
imagepaint.c...
In space.c you use calls from imagepaint.c without prototypes.

This could have used a good code review before added, and poking people  
who like to design button panels. Seems like much wanted functionality  
yes, but worth checking on a good integration to make it future proof.  
:)

-Ton-

------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list