1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Cleaned up a few warnings generated by clang -Wall.

This commit is contained in:
jules 2012-05-09 10:01:56 +01:00
parent 0930af3820
commit d4deecb2f2
20 changed files with 69 additions and 64 deletions

View file

@ -181,7 +181,7 @@ namespace VSTHelpers
: "~/SDKs/vstsdk2.4"); : "~/SDKs/vstsdk2.4");
} }
static void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
{ {
fixMissingVSTValues (exporter); fixMissingVSTValues (exporter);
writePluginCharacteristicsFile (projectSaver); writePluginCharacteristicsFile (projectSaver);
@ -202,7 +202,7 @@ namespace VSTHelpers
exporter.extraSearchPaths.add (juceWrapperFolder.toUnixStyle()); exporter.extraSearchPaths.add (juceWrapperFolder.toUnixStyle());
} }
static void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props)
{ {
fixMissingVSTValues (exporter); fixMissingVSTValues (exporter);
createVSTPathEditor (exporter, props); createVSTPathEditor (exporter, props);
@ -309,7 +309,7 @@ namespace RTASHelpers
} }
} }
static void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver, const File& moduleFolder) static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver, const File& moduleFolder)
{ {
fixMissingRTASValues (exporter); fixMissingRTASValues (exporter);
@ -358,7 +358,7 @@ namespace RTASHelpers
addExtraSearchPaths (exporter); addExtraSearchPaths (exporter);
} }
static void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props)
{ {
if (exporter.isXcode() || exporter.isVisualStudio()) if (exporter.isXcode() || exporter.isVisualStudio())
{ {
@ -373,7 +373,7 @@ namespace RTASHelpers
//============================================================================== //==============================================================================
namespace AUHelpers namespace AUHelpers
{ {
static void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver)
{ {
writePluginCharacteristicsFile (projectSaver); writePluginCharacteristicsFile (projectSaver);

View file

@ -122,7 +122,7 @@ namespace FileHelpers
|| path.startsWithIgnoreCase ("smb:"); || path.startsWithIgnoreCase ("smb:");
} }
static String appendPath (const String& path, const String& subpath) String appendPath (const String& path, const String& subpath)
{ {
if (isAbsolutePath (subpath)) if (isAbsolutePath (subpath))
return subpath.replaceCharacter ('\\', '/'); return subpath.replaceCharacter ('\\', '/');

View file

@ -129,7 +129,7 @@ static const unsigned char byte_to_unary_table[] = {
#endif #endif
#ifndef FLaC__INLINE #ifndef FLaC__INLINE
#define FLaC__INLINE #define FLaC__INLINE inline
#endif #endif
/* WATCHOUT: assembly routines rely on the order in which these fields are declared */ /* WATCHOUT: assembly routines rely on the order in which these fields are declared */

View file

@ -94,7 +94,7 @@ typedef ogg_int16_t vorbis_fpu_control;
static inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){ static inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
ogg_int16_t ret; ogg_int16_t ret;
ogg_int16_t temp; ogg_int16_t temp = 0;
__asm__ __volatile__("fnstcw %0\n\t" __asm__ __volatile__("fnstcw %0\n\t"
"movw %0,%%dx\n\t" "movw %0,%%dx\n\t"
"andw $62463,%%dx\n\t" "andw $62463,%%dx\n\t"

View file

@ -52,7 +52,7 @@ void _vp_global_free(vorbis_look_psy_global *look){
} }
} }
static void _vi_gpsy_free(vorbis_info_psy_global *i){ static inline void _vi_gpsy_free(vorbis_info_psy_global *i){
if(i){ if(i){
memset(i,0,sizeof(*i)); memset(i,0,sizeof(*i));
_ogg_free(i); _ogg_free(i);

View file

@ -42,7 +42,7 @@ typedef struct {
} ogg_page; } ogg_page;
static ogg_uint32_t ogg_bitreverse(ogg_uint32_t x){ static inline ogg_uint32_t ogg_bitreverse(ogg_uint32_t x){
x= ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL); x= ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL);
x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL); x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL);
x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL); x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL);

View file

@ -33,22 +33,22 @@
namespace namespace
{ {
//============================================================================== //==============================================================================
String nsStringToJuce (NSString* s) static inline String nsStringToJuce (NSString* s)
{ {
return CharPointer_UTF8 ([s UTF8String]); return CharPointer_UTF8 ([s UTF8String]);
} }
NSString* juceStringToNS (const String& s) static inline NSString* juceStringToNS (const String& s)
{ {
return [NSString stringWithUTF8String: s.toUTF8()]; return [NSString stringWithUTF8String: s.toUTF8()];
} }
NSString* nsStringLiteral (const char* const s) noexcept static inline NSString* nsStringLiteral (const char* const s) noexcept
{ {
return [NSString stringWithUTF8String: s]; return [NSString stringWithUTF8String: s];
} }
NSString* nsEmptyString() noexcept static inline NSString* nsEmptyString() noexcept
{ {
return [NSString string]; return [NSString string];
} }

View file

@ -281,10 +281,8 @@ namespace
return value == -1 ? getResultForErrno() : Result::ok(); return value == -1 ? getResultForErrno() : Result::ok();
} }
int getFD (void* handle) noexcept int getFD (void* handle) noexcept { return (int) (pointer_sized_int) handle; }
{ void* fdToVoidPointer (int fd) noexcept { return (void*) (pointer_sized_int) fd; }
return (int) (pointer_sized_int) handle;
}
} }
bool File::isDirectory() const bool File::isDirectory() const
@ -420,7 +418,7 @@ void FileInputStream::openHandle()
const int f = open (file.getFullPathName().toUTF8(), O_RDONLY, 00644); const int f = open (file.getFullPathName().toUTF8(), O_RDONLY, 00644);
if (f != -1) if (f != -1)
fileHandle = (void*) f; fileHandle = fdToVoidPointer (f);
else else
status = getResultForErrno(); status = getResultForErrno();
} }
@ -465,7 +463,7 @@ void FileOutputStream::openHandle()
if (currentPosition >= 0) if (currentPosition >= 0)
{ {
fileHandle = (void*) f; fileHandle = fdToVoidPointer (f);
} }
else else
{ {
@ -483,7 +481,7 @@ void FileOutputStream::openHandle()
const int f = open (file.getFullPathName().toUTF8(), O_RDWR + O_CREAT, 00644); const int f = open (file.getFullPathName().toUTF8(), O_RDWR + O_CREAT, 00644);
if (f != -1) if (f != -1)
fileHandle = (void*) f; fileHandle = fdToVoidPointer (f);
else else
status = getResultForErrno(); status = getResultForErrno();
} }

View file

@ -148,6 +148,7 @@ namespace JPEGHelpers
} }
//============================================================================== //==============================================================================
#if ! JUCE_USING_COREIMAGE_LOADER
static void dummyCallback1 (j_decompress_ptr) {} static void dummyCallback1 (j_decompress_ptr) {}
static void jpegSkip (j_decompress_ptr decompStruct, long num) static void jpegSkip (j_decompress_ptr decompStruct, long num)
@ -162,6 +163,7 @@ namespace JPEGHelpers
{ {
return 0; return 0;
} }
#endif
//============================================================================== //==============================================================================
const int jpegBufferSize = 512; const int jpegBufferSize = 512;
@ -226,13 +228,13 @@ bool JPEGImageFormat::canUnderstand (InputStream& in)
return false; return false;
} }
#if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER #if JUCE_USING_COREIMAGE_LOADER
Image juce_loadWithCoreImage (InputStream& input); Image juce_loadWithCoreImage (InputStream& input);
#endif #endif
Image JPEGImageFormat::decodeImage (InputStream& in) Image JPEGImageFormat::decodeImage (InputStream& in)
{ {
#if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER #if JUCE_USING_COREIMAGE_LOADER
return juce_loadWithCoreImage (in); return juce_loadWithCoreImage (in);
#else #else
using namespace jpeglibNamespace; using namespace jpeglibNamespace;

View file

@ -100,22 +100,24 @@ namespace PNGHelpers
{ {
using namespace pnglibNamespace; using namespace pnglibNamespace;
static void JUCE_CDECL readCallback (png_structp png, png_bytep data, png_size_t length)
{
static_cast<InputStream*> (png_get_io_ptr (png))->read (data, (int) length);
}
static void JUCE_CDECL writeDataCallback (png_structp png, png_bytep data, png_size_t length) static void JUCE_CDECL writeDataCallback (png_structp png, png_bytep data, png_size_t length)
{ {
static_cast<OutputStream*> (png_get_io_ptr (png))->write (data, (int) length); static_cast<OutputStream*> (png_get_io_ptr (png))->write (data, (int) length);
} }
#if ! JUCE_USING_COREIMAGE_LOADER
static void JUCE_CDECL readCallback (png_structp png, png_bytep data, png_size_t length)
{
static_cast<InputStream*> (png_get_io_ptr (png))->read (data, (int) length);
}
struct PNGErrorStruct {}; struct PNGErrorStruct {};
static void JUCE_CDECL errorCallback (png_structp, png_const_charp) static void JUCE_CDECL errorCallback (png_structp, png_const_charp)
{ {
throw PNGErrorStruct(); throw PNGErrorStruct();
} }
#endif
} }
//============================================================================== //==============================================================================
@ -135,13 +137,13 @@ bool PNGImageFormat::canUnderstand (InputStream& in)
&& header[3] == 'G'; && header[3] == 'G';
} }
#if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER #if JUCE_USING_COREIMAGE_LOADER
Image juce_loadWithCoreImage (InputStream& input); Image juce_loadWithCoreImage (InputStream& input);
#endif #endif
Image PNGImageFormat::decodeImage (InputStream& in) Image PNGImageFormat::decodeImage (InputStream& in)
{ {
#if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER #if JUCE_USING_COREIMAGE_LOADER
return juce_loadWithCoreImage (in); return juce_loadWithCoreImage (in);
#else #else
using namespace pnglibNamespace; using namespace pnglibNamespace;

View file

@ -690,9 +690,8 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
png_charp PNGAPI png_charp PNGAPI
png_get_copyright(png_structp png_ptr) png_get_copyright(png_structp)
{ {
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
return ((png_charp) "\n libpng version 1.2.21 - October 4, 2007\n\ return ((png_charp) "\n libpng version 1.2.21 - October 4, 2007\n\
Copyright (c) 1998-2007 Glenn Randers-Pehrson\n\ Copyright (c) 1998-2007 Glenn Randers-Pehrson\n\
Copyright (c) 1996-1997 Andreas Dilger\n\ Copyright (c) 1996-1997 Andreas Dilger\n\
@ -708,26 +707,23 @@ png_get_copyright(png_structp png_ptr)
* it is guaranteed that png.c uses the correct version of png.h. * it is guaranteed that png.c uses the correct version of png.h.
*/ */
png_charp PNGAPI png_charp PNGAPI
png_get_libpng_ver(png_structp png_ptr) png_get_libpng_ver(png_structp)
{ {
/* Version of *.c files used when building libpng */ /* Version of *.c files used when building libpng */
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
return ((png_charp) PNG_LIBPNG_VER_STRING); return ((png_charp) PNG_LIBPNG_VER_STRING);
} }
png_charp PNGAPI png_charp PNGAPI
png_get_header_ver(png_structp png_ptr) png_get_header_ver(png_structp)
{ {
/* Version of *.h files used when building libpng */ /* Version of *.h files used when building libpng */
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
return ((png_charp) PNG_LIBPNG_VER_STRING); return ((png_charp) PNG_LIBPNG_VER_STRING);
} }
png_charp PNGAPI png_charp PNGAPI
png_get_header_version(png_structp png_ptr) png_get_header_version(png_structp)
{ {
/* Returns longer string containing both version and date */ /* Returns longer string containing both version and date */
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
return ((png_charp) PNG_HEADER_VERSION_STRING return ((png_charp) PNG_HEADER_VERSION_STRING
#ifndef PNG_READ_SUPPORTED #ifndef PNG_READ_SUPPORTED
" (NO READ SUPPORT)" " (NO READ SUPPORT)"

View file

@ -253,7 +253,7 @@ png_default_error(png_structp, png_const_charp error_message)
PNG_ABORT(); PNG_ABORT();
#endif #endif
#ifdef PNG_NO_CONSOLE_IO #ifdef PNG_NO_CONSOLE_IO
error_message = error_message; /* make compiler happy */ (void) error_message; /* make compiler happy */
#endif #endif
} }

View file

@ -847,20 +847,18 @@ png_get_asm_flags (png_structp png_ptr)
/* this function was added to libpng 1.2.0 and should exist by default */ /* this function was added to libpng 1.2.0 and should exist by default */
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_asm_flagmask (int flag_select) png_get_asm_flagmask (int)
{ {
/* obsolete, to be removed from libpng-1.4.0 */ /* obsolete, to be removed from libpng-1.4.0 */
flag_select=flag_select;
return 0L; return 0L;
} }
/* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */ /* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */
/* this function was added to libpng 1.2.0 */ /* this function was added to libpng 1.2.0 */
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_mmx_flagmask (int flag_select, int *compilerID) png_get_mmx_flagmask (int, int *compilerID)
{ {
/* obsolete, to be removed from libpng-1.4.0 */ /* obsolete, to be removed from libpng-1.4.0 */
flag_select=flag_select;
*compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ *compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */
return 0L; return 0L;
} }

View file

@ -1060,7 +1060,7 @@ png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{ {
png_error(png_ptr, "Out of place tEXt"); png_error(png_ptr, "Out of place tEXt");
info_ptr = info_ptr; /* to quiet some compiler warnings */ (void) info_ptr; /* to quiet some compiler warnings */
} }
#ifdef PNG_MAX_MALLOC_64K #ifdef PNG_MAX_MALLOC_64K
@ -1156,7 +1156,7 @@ png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{ {
png_error(png_ptr, "Out of place zTXt"); png_error(png_ptr, "Out of place zTXt");
info_ptr = info_ptr; /* to quiet some compiler warnings */ (void) info_ptr; /* to quiet some compiler warnings */
} }
#ifdef PNG_MAX_MALLOC_64K #ifdef PNG_MAX_MALLOC_64K
@ -1479,7 +1479,7 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
#endif #endif
png_chunk_error(png_ptr, "unknown critical chunk"); png_chunk_error(png_ptr, "unknown critical chunk");
info_ptr = info_ptr; /* to quiet some compiler warnings */ (void) info_ptr; /* to quiet some compiler warnings */
} }
#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)

View file

@ -1463,8 +1463,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
/* read rest of file, and get additional chunks in info_ptr - REQUIRED */ /* read rest of file, and get additional chunks in info_ptr - REQUIRED */
png_read_end(png_ptr, info_ptr); png_read_end(png_ptr, info_ptr);
transforms = transforms; /* quiet compiler warnings */ (void) transforms; /* quiet compiler warnings */
params = params; (void) params;
} }
#endif /* PNG_INFO_IMAGE_SUPPORTED */ #endif /* PNG_INFO_IMAGE_SUPPORTED */

View file

@ -571,7 +571,7 @@ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
} }
png_crc_finish(png_ptr, length); png_crc_finish(png_ptr, length);
info_ptr =info_ptr; /* quiet compiler warnings about unused info_ptr */ (void) info_ptr; /* quiet compiler warnings about unused info_ptr */
} }
#if defined(PNG_READ_gAMA_SUPPORTED) #if defined(PNG_READ_gAMA_SUPPORTED)
@ -2260,7 +2260,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_crc_finish(png_ptr, skip); png_crc_finish(png_ptr, skip);
#if !defined(PNG_READ_USER_CHUNKS_SUPPORTED) #if !defined(PNG_READ_USER_CHUNKS_SUPPORTED)
info_ptr = info_ptr; /* quiet compiler warnings about unused info_ptr */ (void) info_ptr; /* quiet compiler warnings about unused info_ptr */
#endif #endif
} }

View file

@ -1507,8 +1507,8 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
/* It is REQUIRED to call this to finish writing the rest of the file */ /* It is REQUIRED to call this to finish writing the rest of the file */
png_write_end(png_ptr, info_ptr); png_write_end(png_ptr, info_ptr);
transforms = transforms; /* quiet compiler warnings */ (void) transforms; /* quiet compiler warnings */
params = params; (void) params;
} }
#endif #endif
#endif /* PNG_WRITE_SUPPORTED */ #endif /* PNG_WRITE_SUPPORTED */

View file

@ -63,6 +63,12 @@
#undef SIZEOF #undef SIZEOF
#endif #endif
#if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER
#define JUCE_USING_COREIMAGE_LOADER 1
#else
#define JUCE_USING_COREIMAGE_LOADER 0
#endif
//============================================================================== //==============================================================================
namespace juce namespace juce
{ {

View file

@ -435,31 +435,33 @@ protected:
/** @internal */ /** @internal */
void handleCommandMessage (int commandId); void handleCommandMessage (int commandId);
/** @internal */ /** @internal */
void mouseEnter (const MouseEvent& e); void mouseEnter (const MouseEvent&);
/** @internal */ /** @internal */
void mouseExit (const MouseEvent& e); void mouseExit (const MouseEvent&);
/** @internal */ /** @internal */
void mouseDown (const MouseEvent& e); void mouseDown (const MouseEvent&);
/** @internal */ /** @internal */
void mouseDrag (const MouseEvent& e); void mouseDrag (const MouseEvent&);
/** @internal */ /** @internal */
void mouseUp (const MouseEvent& e); void mouseUp (const MouseEvent&);
/** @internal */ /** @internal */
bool keyPressed (const KeyPress& key); bool keyPressed (const KeyPress&);
/** @internal */ /** @internal */
bool keyPressed (const KeyPress& key, Component* originatingComponent); bool keyPressed (const KeyPress&, Component*);
/** @internal */ /** @internal */
bool keyStateChanged (bool isKeyDown, Component* originatingComponent); bool keyStateChanged (bool isKeyDown, Component*);
/** @internal */ /** @internal */
void paint (Graphics& g); using Component::keyStateChanged;
/** @internal */
void paint (Graphics&);
/** @internal */ /** @internal */
void parentHierarchyChanged(); void parentHierarchyChanged();
/** @internal */ /** @internal */
void visibilityChanged(); void visibilityChanged();
/** @internal */ /** @internal */
void focusGained (FocusChangeType cause); void focusGained (FocusChangeType);
/** @internal */ /** @internal */
void focusLost (FocusChangeType cause); void focusLost (FocusChangeType);
/** @internal */ /** @internal */
void enablementChanged(); void enablementChanged();
/** @internal */ /** @internal */
@ -467,7 +469,7 @@ protected:
/** @internal */ /** @internal */
void applicationCommandListChanged(); void applicationCommandListChanged();
/** @internal */ /** @internal */
void valueChanged (Value& value); void valueChanged (Value&);
private: private:
//============================================================================== //==============================================================================

View file

@ -317,6 +317,7 @@ public:
JUCE_DEPRECATED (void setContentComponent (Component* newContentComponent, JUCE_DEPRECATED (void setContentComponent (Component* newContentComponent,
bool deleteOldOne = true, bool deleteOldOne = true,
bool resizeToFit = false)); bool resizeToFit = false));
using TopLevelWindow::addToDesktop;
protected: protected:
//============================================================================== //==============================================================================