Thursday, June 11, 2009

Baby Steps

So Pjotr recommended that I back up, and try to use SWIG on tiny bits of the code. At the same time, I realized that having a 35K-line .i file was insane, when "based" off a 300-line .h file (especially when about half of those 300 lines are comments). Xin has been making his own .i files, so I decided that I'd have a go at that.

And then, looking through SWIG docs, I find that that's not even necessary for some very simple .h files. There's a -module option that lets you go directly off of the .h file. So...can't hurt to try it. Here are the results, by header file (in utils). In the cases where it compiled sans error, I just left it blank:

AttributesTools
ApplicationTools
 ApplicationTools.h:96: Warning(454): Setting a pointer/reference variable may leak memory.
 ApplicationTools.h:100: Warning(454): Setting a pointer/reference variable may leak memory.
 ApplicationTools.h:104: Warning(454): Setting a pointer/reference variable may leak memory.
BppString
 BppString.h:57: Warning(401): Nothing known about base class 'string'. Ignored.
 BppString.h:57: Warning(401): Nothing known about base class 'Clonable'. Ignored.
BppVector
Clonable
ColorManager
 
ColorManager.h:109: Warning(401): Nothing known about base class 'ColorManager<>'. Ignored.
 ColorManager.h:109: Warning(401): Maybe you forgot to instantiate 'ColorManager<>' using %template.
ColorSet
ColorTools
DefaultColorSet
 DefaultColorSet.h:54: Warning(401): Nothing known about base class 'AbstractColorSet'. Ignored.
DvipsColorSet
 DvipsColorSet.h:55: Warning(401): Nothing known about base class 'AbstractColorSet'. Ignored.
Exceptions
 Exceptions.h:59: Warning(401): Nothing known about base class 'exception'. Ignored.
FileTools
Font
 Font.h:55: Warning(401): Nothing known about base class 'Clonable'. Ignored.
FontManager
 FontManager.h:107: Warning(401): Nothing known about base class 'FontManager<>'. Ignored.
 FontManager.h:107: Warning(401): Maybe you forgot to instantiate 'FontManager<>' using %template.
 FontManager.h:164: Warning(401): Nothing known about base class 'FontManager<>'. Ignored.
 FontManager.h:164: Warning(401): Maybe you forgot to instantiate 'FontManager<>' using %template.
GraphicDevice
IOFormat
KeyvalTools
 KeyvalTools.h:56: Warning(401): Nothing known about base class 'Exception'. Ignored.
MapTools
MolscriptColorSet
 MolscriptColorSet.h:53: Warning(401): Nothing known about base class 'AbstractColorSet'. Ignored.
Number
 Number.h:75: Warning(362): operator= ignored
PGFGraphicDevice
 PGFGraphicDevice.h:58: Warning(401): Nothing known about base class 'GraphicDevice'. Ignored.
RColorSet
 RColorSet.h:53: Warning(401): Nothing known about base class 'AbstractColorSet'. Ignored.
RGBColor
 RGBColor.h:117: Warning(389): operator[] ignored (consider using %extend)
 RGBColor.h:128: Warning(389): operator[] ignored (consider using %extend)
 RGBColor.h:60: Warning(401): Nothing known about base class 'Clonable'. Ignored.
StringTokenizer
SVGGraphicDevice
 SVGGraphicDevice.h:58: Warning(401): Nothing known about base class 'GraphicDevice'. Ignored.
TextTools
XFigGraphicDevice
 XFigGraphicDevice.h:60: Warning(401): Nothing known about base class 'GraphicDevice'. Ignored.

Everything compiled--this were all warnings. Many of them are just inheritance problems. Some are for other classes in utils (e.g. GraphicDevice, Clonable), and others are for standard C++ classes (e.g. string, exception). This should be easy to fix.

What I'm more worried about is the template stuff. Also strange are errors about the [] and = operators. For the former, it talks about using the %template directive in SWIG. That's a good place to start looking.

Finally, I feel like I'm moving forward again.

No comments:

Post a Comment