Minor compilations fixes for svn version


#1

Hi Jules,

Running valgrind on my code, I noticed it complained about mismatched “new” alloc / “free” deallocation in XBitmapImage. Replacing the new by juce_malloc caused it to still complain in the call to XDestroyImage because there was a pointer in the XImage structure which was not initialised during construction. The following change fixes those two issues:

--- build/linux/platform_specific_code/juce_linux_Windowing.cpp (revision 422)
+++ build/linux/platform_specific_code/juce_linux_Windowing.cpp (working copy)
@@ -524,7 +524,8 @@
             if (format_ == ARGB && clearImage)
                 zeromem (imageData, h * lineStride);

-            xImage = new XImage();
+            xImage = (XImage*)juce_malloc(sizeof(XImage));
+            memset(xImage, 0, sizeof(XImage));

             xImage->width = w;
             xImage->height = h;

Another very small compilation bug that I encountered is that the compiler complains about “memset” not be declared while compiling juce_AudioFilterStreamer.cpp (there is a call to zeromem). an #include fixed it.

I should also add that “g+±4.3 -Wall -W” is issuing a lot of warnings similar to this one:

src/juce_appframework/gui/components/layout/juce_TabbedComponent.h:75: warning: type qualifiers ignored on function return type

(all functions returning a const value generate such a warning)

(btw is this the correct place for doing these kind of small bug-reports ?)


#2

Nice one, thanks for those. I think the cstring.h should actually go into juce_StandardHeaders.h