diff --git a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h index ac8b7fbc5d..5689faecd3 100644 --- a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h +++ b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h @@ -181,7 +181,7 @@ namespace VSTHelpers : "~/SDKs/vstsdk2.4"); } - static void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) + static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) { fixMissingVSTValues (exporter); writePluginCharacteristicsFile (projectSaver); @@ -202,7 +202,7 @@ namespace VSTHelpers exporter.extraSearchPaths.add (juceWrapperFolder.toUnixStyle()); } - static void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) + static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) { fixMissingVSTValues (exporter); 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); @@ -358,7 +358,7 @@ namespace RTASHelpers addExtraSearchPaths (exporter); } - static void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) + static inline void createPropertyEditors (ProjectExporter& exporter, PropertyListBuilder& props) { if (exporter.isXcode() || exporter.isVisualStudio()) { @@ -373,7 +373,7 @@ namespace RTASHelpers //============================================================================== namespace AUHelpers { - static void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) + static inline void prepareExporter (ProjectExporter& exporter, ProjectSaver& projectSaver) { writePluginCharacteristicsFile (projectSaver); diff --git a/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp b/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp index 13d4a6ad51..cadd90bfcb 100644 --- a/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp +++ b/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp @@ -122,7 +122,7 @@ namespace FileHelpers || path.startsWithIgnoreCase ("smb:"); } - static String appendPath (const String& path, const String& subpath) + String appendPath (const String& path, const String& subpath) { if (isAbsolutePath (subpath)) return subpath.replaceCharacter ('\\', '/'); diff --git a/modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c b/modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c index 1a1828750a..0264c179f0 100644 --- a/modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c +++ b/modules/juce_audio_formats/codecs/flac/libFLAC/bitreader.c @@ -129,7 +129,7 @@ static const unsigned char byte_to_unary_table[] = { #endif #ifndef FLaC__INLINE -#define FLaC__INLINE +#define FLaC__INLINE inline #endif /* WATCHOUT: assembly routines rely on the order in which these fields are declared */ diff --git a/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h b/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h index e84035fa54..b9d44b09e0 100644 --- a/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h +++ b/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h @@ -94,7 +94,7 @@ typedef ogg_int16_t vorbis_fpu_control; static inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){ ogg_int16_t ret; - ogg_int16_t temp; + ogg_int16_t temp = 0; __asm__ __volatile__("fnstcw %0\n\t" "movw %0,%%dx\n\t" "andw $62463,%%dx\n\t" diff --git a/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/psy.c b/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/psy.c index 0dac94c600..a60f88fabb 100644 --- a/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/psy.c +++ b/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/psy.c @@ -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){ memset(i,0,sizeof(*i)); _ogg_free(i); diff --git a/modules/juce_audio_formats/codecs/oggvorbis/ogg.h b/modules/juce_audio_formats/codecs/oggvorbis/ogg.h index 5e7113f8a2..d9bd13e35c 100644 --- a/modules/juce_audio_formats/codecs/oggvorbis/ogg.h +++ b/modules/juce_audio_formats/codecs/oggvorbis/ogg.h @@ -42,7 +42,7 @@ typedef struct { } 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>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL); x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL); diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h index 89daf3cba6..ea339cb8c5 100644 --- a/modules/juce_core/native/juce_osx_ObjCHelpers.h +++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h @@ -33,22 +33,22 @@ namespace { //============================================================================== - String nsStringToJuce (NSString* s) + static inline String nsStringToJuce (NSString* s) { return CharPointer_UTF8 ([s UTF8String]); } - NSString* juceStringToNS (const String& s) + static inline NSString* juceStringToNS (const String& s) { 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]; } - NSString* nsEmptyString() noexcept + static inline NSString* nsEmptyString() noexcept { return [NSString string]; } diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 417fee8bc5..9b2123e21c 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -281,10 +281,8 @@ namespace return value == -1 ? getResultForErrno() : Result::ok(); } - int getFD (void* handle) noexcept - { - return (int) (pointer_sized_int) handle; - } + int getFD (void* handle) noexcept { return (int) (pointer_sized_int) handle; } + void* fdToVoidPointer (int fd) noexcept { return (void*) (pointer_sized_int) fd; } } bool File::isDirectory() const @@ -420,7 +418,7 @@ void FileInputStream::openHandle() const int f = open (file.getFullPathName().toUTF8(), O_RDONLY, 00644); if (f != -1) - fileHandle = (void*) f; + fileHandle = fdToVoidPointer (f); else status = getResultForErrno(); } @@ -465,7 +463,7 @@ void FileOutputStream::openHandle() if (currentPosition >= 0) { - fileHandle = (void*) f; + fileHandle = fdToVoidPointer (f); } else { @@ -483,7 +481,7 @@ void FileOutputStream::openHandle() const int f = open (file.getFullPathName().toUTF8(), O_RDWR + O_CREAT, 00644); if (f != -1) - fileHandle = (void*) f; + fileHandle = fdToVoidPointer (f); else status = getResultForErrno(); } diff --git a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp index fdd7094fa8..6771d0a9d7 100644 --- a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp @@ -148,6 +148,7 @@ namespace JPEGHelpers } //============================================================================== + #if ! JUCE_USING_COREIMAGE_LOADER static void dummyCallback1 (j_decompress_ptr) {} static void jpegSkip (j_decompress_ptr decompStruct, long num) @@ -162,6 +163,7 @@ namespace JPEGHelpers { return 0; } + #endif //============================================================================== const int jpegBufferSize = 512; @@ -226,13 +228,13 @@ bool JPEGImageFormat::canUnderstand (InputStream& in) return false; } -#if (JUCE_MAC || JUCE_IOS) && USE_COREGRAPHICS_RENDERING && JUCE_USE_COREIMAGE_LOADER +#if JUCE_USING_COREIMAGE_LOADER Image juce_loadWithCoreImage (InputStream& input); #endif 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); #else using namespace jpeglibNamespace; diff --git a/modules/juce_graphics/image_formats/juce_PNGLoader.cpp b/modules/juce_graphics/image_formats/juce_PNGLoader.cpp index 848cddf3d5..950f1122fa 100644 --- a/modules/juce_graphics/image_formats/juce_PNGLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_PNGLoader.cpp @@ -100,14 +100,15 @@ namespace PNGHelpers { using namespace pnglibNamespace; - static void JUCE_CDECL readCallback (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 (png_get_io_ptr (png))->read (data, (int) length); + static_cast (png_get_io_ptr (png))->write (data, (int) length); } - static void JUCE_CDECL writeDataCallback (png_structp png, png_bytep data, png_size_t length) + #if ! JUCE_USING_COREIMAGE_LOADER + static void JUCE_CDECL readCallback (png_structp png, png_bytep data, png_size_t length) { - static_cast (png_get_io_ptr (png))->write (data, (int) length); + static_cast (png_get_io_ptr (png))->read (data, (int) length); } struct PNGErrorStruct {}; @@ -116,6 +117,7 @@ namespace PNGHelpers { throw PNGErrorStruct(); } + #endif } //============================================================================== @@ -135,13 +137,13 @@ bool PNGImageFormat::canUnderstand (InputStream& in) && 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); #endif 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); #else using namespace pnglibNamespace; diff --git a/modules/juce_graphics/image_formats/pnglib/png.c b/modules/juce_graphics/image_formats/pnglib/png.c index 108de4e9d4..c80e98d0c3 100644 --- a/modules/juce_graphics/image_formats/pnglib/png.c +++ b/modules/juce_graphics/image_formats/pnglib/png.c @@ -690,9 +690,8 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime) #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ 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\ Copyright (c) 1998-2007 Glenn Randers-Pehrson\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. */ 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 */ - png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */ return ((png_charp) PNG_LIBPNG_VER_STRING); } 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 */ - png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */ return ((png_charp) PNG_LIBPNG_VER_STRING); } 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 */ - png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */ return ((png_charp) PNG_HEADER_VERSION_STRING #ifndef PNG_READ_SUPPORTED " (NO READ SUPPORT)" diff --git a/modules/juce_graphics/image_formats/pnglib/pngerror.c b/modules/juce_graphics/image_formats/pnglib/pngerror.c index 70336bd85b..782a6f70bb 100644 --- a/modules/juce_graphics/image_formats/pnglib/pngerror.c +++ b/modules/juce_graphics/image_formats/pnglib/pngerror.c @@ -253,7 +253,7 @@ png_default_error(png_structp, png_const_charp error_message) PNG_ABORT(); #endif #ifdef PNG_NO_CONSOLE_IO - error_message = error_message; /* make compiler happy */ + (void) error_message; /* make compiler happy */ #endif } diff --git a/modules/juce_graphics/image_formats/pnglib/pngget.c b/modules/juce_graphics/image_formats/pnglib/pngget.c index 36be6a6cec..0bf989ea58 100644 --- a/modules/juce_graphics/image_formats/pnglib/pngget.c +++ b/modules/juce_graphics/image_formats/pnglib/pngget.c @@ -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 */ 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 */ - flag_select=flag_select; return 0L; } /* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */ /* this function was added to libpng 1.2.0 */ 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 */ - flag_select=flag_select; *compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ return 0L; } diff --git a/modules/juce_graphics/image_formats/pnglib/pngpread.c b/modules/juce_graphics/image_formats/pnglib/pngpread.c index 5e84c4a9a3..b21b8d69c5 100644 --- a/modules/juce_graphics/image_formats/pnglib/pngpread.c +++ b/modules/juce_graphics/image_formats/pnglib/pngpread.c @@ -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)) { 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 @@ -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)) { 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 @@ -1479,7 +1479,7 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 #endif 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) diff --git a/modules/juce_graphics/image_formats/pnglib/pngread.c b/modules/juce_graphics/image_formats/pnglib/pngread.c index 707561aee9..cd93a0b7e7 100644 --- a/modules/juce_graphics/image_formats/pnglib/pngread.c +++ b/modules/juce_graphics/image_formats/pnglib/pngread.c @@ -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 */ png_read_end(png_ptr, info_ptr); - transforms = transforms; /* quiet compiler warnings */ - params = params; + (void) transforms; /* quiet compiler warnings */ + (void) params; } #endif /* PNG_INFO_IMAGE_SUPPORTED */ diff --git a/modules/juce_graphics/image_formats/pnglib/pngrutil.c b/modules/juce_graphics/image_formats/pnglib/pngrutil.c index 6a705a4a6f..b6440ae0dc 100644 --- a/modules/juce_graphics/image_formats/pnglib/pngrutil.c +++ b/modules/juce_graphics/image_formats/pnglib/pngrutil.c @@ -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); - 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) @@ -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); #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 } diff --git a/modules/juce_graphics/image_formats/pnglib/pngwrite.c b/modules/juce_graphics/image_formats/pnglib/pngwrite.c index 8f9b537a50..5ab5bbccc6 100644 --- a/modules/juce_graphics/image_formats/pnglib/pngwrite.c +++ b/modules/juce_graphics/image_formats/pnglib/pngwrite.c @@ -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 */ png_write_end(png_ptr, info_ptr); - transforms = transforms; /* quiet compiler warnings */ - params = params; + (void) transforms; /* quiet compiler warnings */ + (void) params; } #endif #endif /* PNG_WRITE_SUPPORTED */ diff --git a/modules/juce_graphics/juce_graphics.cpp b/modules/juce_graphics/juce_graphics.cpp index 77fe2e9302..7daa340bd4 100644 --- a/modules/juce_graphics/juce_graphics.cpp +++ b/modules/juce_graphics/juce_graphics.cpp @@ -63,6 +63,12 @@ #undef SIZEOF #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 { diff --git a/modules/juce_gui_basics/buttons/juce_Button.h b/modules/juce_gui_basics/buttons/juce_Button.h index 973f9d637d..6edffa8763 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.h +++ b/modules/juce_gui_basics/buttons/juce_Button.h @@ -435,31 +435,33 @@ protected: /** @internal */ void handleCommandMessage (int commandId); /** @internal */ - void mouseEnter (const MouseEvent& e); + void mouseEnter (const MouseEvent&); /** @internal */ - void mouseExit (const MouseEvent& e); + void mouseExit (const MouseEvent&); /** @internal */ - void mouseDown (const MouseEvent& e); + void mouseDown (const MouseEvent&); /** @internal */ - void mouseDrag (const MouseEvent& e); + void mouseDrag (const MouseEvent&); /** @internal */ - void mouseUp (const MouseEvent& e); + void mouseUp (const MouseEvent&); /** @internal */ - bool keyPressed (const KeyPress& key); + bool keyPressed (const KeyPress&); /** @internal */ - bool keyPressed (const KeyPress& key, Component* originatingComponent); + bool keyPressed (const KeyPress&, Component*); /** @internal */ - bool keyStateChanged (bool isKeyDown, Component* originatingComponent); + bool keyStateChanged (bool isKeyDown, Component*); /** @internal */ - void paint (Graphics& g); + using Component::keyStateChanged; + /** @internal */ + void paint (Graphics&); /** @internal */ void parentHierarchyChanged(); /** @internal */ void visibilityChanged(); /** @internal */ - void focusGained (FocusChangeType cause); + void focusGained (FocusChangeType); /** @internal */ - void focusLost (FocusChangeType cause); + void focusLost (FocusChangeType); /** @internal */ void enablementChanged(); /** @internal */ @@ -467,7 +469,7 @@ protected: /** @internal */ void applicationCommandListChanged(); /** @internal */ - void valueChanged (Value& value); + void valueChanged (Value&); private: //============================================================================== diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h index 1926b6d377..4eb09332e6 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h @@ -317,6 +317,7 @@ public: JUCE_DEPRECATED (void setContentComponent (Component* newContentComponent, bool deleteOldOne = true, bool resizeToFit = false)); + using TopLevelWindow::addToDesktop; protected: //==============================================================================