From f6395d4cda534b0968f11140a9e223fee02af712 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 31 Mar 2015 11:44:10 +0100 Subject: [PATCH] Raised the warnings level in the introjucer, and fixed a few warnings that were thrown up by this. --- extras/Introjucer/Builds/Linux/Makefile | 4 +-- extras/Introjucer/Introjucer.jucer | 2 +- .../Wizards/jucer_NewProjectWizardComponent.h | 10 +++--- .../jucer_TemplateThumbnailsComponent.h | 16 +++++----- .../juce_audio_basics/effects/juce_Reverb.h | 2 +- .../juce_core/files/juce_FileInputStream.cpp | 2 +- .../juce_core/files/juce_FileOutputStream.cpp | 8 ++--- modules/juce_core/memory/juce_ByteOrder.h | 2 +- modules/juce_core/memory/juce_MemoryBlock.cpp | 2 +- .../juce_core/native/juce_linux_Network.cpp | 6 ++-- modules/juce_core/network/juce_IPAddress.cpp | 2 +- .../juce_core/text/juce_CharPointer_UTF8.h | 2 +- .../text/juce_CharacterFunctions.cpp | 16 +++++----- modules/juce_core/zip/zlib/trees.c | 32 +++++++++---------- .../juce_graphics/colour/juce_PixelFormats.h | 10 +++--- .../native/juce_RenderingHelpers.h | 11 ++++--- .../native/juce_freetype_Fonts.cpp | 4 +-- .../native/juce_linux_Windowing.cpp | 24 +++++++------- 18 files changed, 78 insertions(+), 77 deletions(-) diff --git a/extras/Introjucer/Builds/Linux/Makefile b/extras/Introjucer/Builds/Linux/Makefile index 3f16f22215..7f8ba85e75 100644 --- a/extras/Introjucer/Builds/Linux/Makefile +++ b/extras/Introjucer/Builds/Linux/Makefile @@ -19,7 +19,7 @@ ifeq ($(CONFIG),Debug) endif CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=3.1.1" -D "JUCE_APP_VERSION_HEX=0x30101" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules - CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 -std=gnu++0x + CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 -std=gnu++0x -Wreorder -Wuninitialized -Wunused-parameter -Wstrict-aliasing -Wshadow -Wsign-compare CXXFLAGS += $(CFLAGS) LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt @@ -39,7 +39,7 @@ ifeq ($(CONFIG),Release) endif CPPFLAGS := $(DEPFLAGS) -std=c++11 -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -D "JUCE_APP_VERSION=3.1.1" -D "JUCE_APP_VERSION_HEX=0x30101" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules - CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3 -std=gnu++0x + CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3 -std=gnu++0x -Wreorder -Wuninitialized -Wunused-parameter -Wstrict-aliasing -Wshadow -Wsign-compare CXXFLAGS += $(CFLAGS) LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -ldl -lfreetype -lpthread -lrt diff --git a/extras/Introjucer/Introjucer.jucer b/extras/Introjucer/Introjucer.jucer index 6e334ec88f..a6f64e59a8 100644 --- a/extras/Introjucer/Introjucer.jucer +++ b/extras/Introjucer/Introjucer.jucer @@ -69,7 +69,7 @@ + extraCompilerFlags="-std=gnu++0x -Wreorder -Wuninitialized -Wunused-parameter -Wstrict-aliasing -Wshadow -Wsign-compare"> diff --git a/extras/Introjucer/Source/Wizards/jucer_NewProjectWizardComponent.h b/extras/Introjucer/Source/Wizards/jucer_NewProjectWizardComponent.h index e9edc2c3a2..cd96575f96 100644 --- a/extras/Introjucer/Source/Wizards/jucer_NewProjectWizardComponent.h +++ b/extras/Introjucer/Source/Wizards/jucer_NewProjectWizardComponent.h @@ -55,14 +55,14 @@ public: void resized() override { - Rectangle bounds = getLocalBounds(); + Rectangle r = getLocalBounds(); - modulesLabel.setBounds (bounds.removeFromLeft (110)); + modulesLabel.setBounds (r.removeFromLeft (110)); - openFolderButton.setBounds (bounds.removeFromRight (40)); - bounds.removeFromRight (5); + openFolderButton.setBounds (r.removeFromRight (40)); + r.removeFromRight (5); - currentPathBox.setBounds (bounds); + currentPathBox.setBounds (r); } static bool selectJuceFolder (File& result) diff --git a/extras/Introjucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h b/extras/Introjucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h index d4de897678..3f20d90cfc 100644 --- a/extras/Introjucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h +++ b/extras/Introjucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h @@ -55,34 +55,34 @@ public: void paintButton (Graphics& g, bool isMouseOverButton, bool /*isButtonDown*/) override { - const Rectangle bounds (getLocalBounds().toFloat()); + const Rectangle r (getLocalBounds().toFloat()); const Colour buttonColour (0xfff29300); if (isMouseOverButton) { if (getStyle() == ImageFitted) { - hoverBackground->drawWithin (g, bounds, RectanglePlacement::centred, 1.0); - thumb->drawWithin (g, bounds, RectanglePlacement::centred, 1.0); + hoverBackground->drawWithin (g, r, RectanglePlacement::centred, 1.0); + thumb->drawWithin (g, r, RectanglePlacement::centred, 1.0); } else { g.setColour (buttonColour.withAlpha (0.3f)); - g.fillRoundedRectangle (bounds.reduced (2.0f, 2.0f), 10.0f); + g.fillRoundedRectangle (r.reduced (2.0f, 2.0f), 10.0f); g.setColour (buttonColour); - g.drawRoundedRectangle (bounds.reduced (2.0f, 2.0f), 10.0f, 2.0f); + g.drawRoundedRectangle (r.reduced (2.0f, 2.0f), 10.0f, 2.0f); } } else { if (getStyle() == ImageFitted) { - thumb->drawWithin (g, bounds, RectanglePlacement::centred, 1.0); + thumb->drawWithin (g, r, RectanglePlacement::centred, 1.0); } else { g.setColour (buttonColour); - g.drawRoundedRectangle (bounds.reduced (2.0f, 2.0f), 10.0f, 2.0f); + g.drawRoundedRectangle (r.reduced (2.0f, 2.0f), 10.0f, 2.0f); } } @@ -95,7 +95,7 @@ public: } else { - textTarget = RectanglePlacement (RectanglePlacement::centred).appliedTo (thumb->getDrawableBounds(), bounds); + textTarget = RectanglePlacement (RectanglePlacement::centred).appliedTo (thumb->getDrawableBounds(), r); textTarget = textTarget.removeFromBottom (textTarget.getHeight() * 0.3f); } diff --git a/modules/juce_audio_basics/effects/juce_Reverb.h b/modules/juce_audio_basics/effects/juce_Reverb.h index c0b7596ec8..6af4acc2ae 100644 --- a/modules/juce_audio_basics/effects/juce_Reverb.h +++ b/modules/juce_audio_basics/effects/juce_Reverb.h @@ -333,7 +333,7 @@ private: if (countdown <= 0) currentValue = target; else - step = (target - currentValue) / countdown; + step = (target - currentValue) / (float) countdown; } } diff --git a/modules/juce_core/files/juce_FileInputStream.cpp b/modules/juce_core/files/juce_FileInputStream.cpp index 801ccfaaf2..58f53b84d9 100644 --- a/modules/juce_core/files/juce_FileInputStream.cpp +++ b/modules/juce_core/files/juce_FileInputStream.cpp @@ -57,7 +57,7 @@ int FileInputStream::read (void* buffer, int bytesToRead) jassert (buffer != nullptr && bytesToRead >= 0); const size_t num = readInternal (buffer, (size_t) bytesToRead); - currentPosition += num; + currentPosition += (int64) num; return (int) num; } diff --git a/modules/juce_core/files/juce_FileOutputStream.cpp b/modules/juce_core/files/juce_FileOutputStream.cpp index 961a8d19e8..3ffc3bd839 100644 --- a/modules/juce_core/files/juce_FileOutputStream.cpp +++ b/modules/juce_core/files/juce_FileOutputStream.cpp @@ -90,7 +90,7 @@ bool FileOutputStream::write (const void* const src, const size_t numBytes) { memcpy (buffer + bytesInBuffer, src, numBytes); bytesInBuffer += numBytes; - currentPosition += numBytes; + currentPosition += (int64) numBytes; } else { @@ -101,7 +101,7 @@ bool FileOutputStream::write (const void* const src, const size_t numBytes) { memcpy (buffer + bytesInBuffer, src, numBytes); bytesInBuffer += numBytes; - currentPosition += numBytes; + currentPosition += (int64) numBytes; } else { @@ -110,7 +110,7 @@ bool FileOutputStream::write (const void* const src, const size_t numBytes) if (bytesWritten < 0) return false; - currentPosition += bytesWritten; + currentPosition += (int64) bytesWritten; return bytesWritten == (ssize_t) numBytes; } } @@ -126,7 +126,7 @@ bool FileOutputStream::writeRepeatedByte (uint8 byte, size_t numBytes) { memset (buffer + bytesInBuffer, byte, numBytes); bytesInBuffer += numBytes; - currentPosition += numBytes; + currentPosition += (int64) numBytes; return true; } diff --git a/modules/juce_core/memory/juce_ByteOrder.h b/modules/juce_core/memory/juce_ByteOrder.h index fcd56bce25..cd17927b7b 100644 --- a/modules/juce_core/memory/juce_ByteOrder.h +++ b/modules/juce_core/memory/juce_ByteOrder.h @@ -153,7 +153,7 @@ inline uint64 ByteOrder::swap (uint64 value) noexcept #elif JUCE_USE_MSVC_INTRINSICS return _byteswap_uint64 (value); #else - return (((int64) swap ((uint32) value)) << 32) | swap ((uint32) (value >> 32)); + return (((uint64) swap ((uint32) value)) << 32) | swap ((uint32) (value >> 32)); #endif } diff --git a/modules/juce_core/memory/juce_MemoryBlock.cpp b/modules/juce_core/memory/juce_MemoryBlock.cpp index 6097c7e7e5..b258c3129f 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.cpp +++ b/modules/juce_core/memory/juce_MemoryBlock.cpp @@ -259,7 +259,7 @@ void MemoryBlock::copyTo (void* const dst, int offset, size_t num) const noexcep if ((size_t) offset + num > size) { - const size_t newNum = size - (size_t) offset; + const size_t newNum = (size_t) size - (size_t) offset; zeromem (d + newNum, num - newNum); num = newNum; } diff --git a/modules/juce_core/native/juce_linux_Network.cpp b/modules/juce_core/native/juce_linux_Network.cpp index d077668592..2cf31277d7 100644 --- a/modules/juce_core/native/juce_linux_Network.cpp +++ b/modules/juce_core/native/juce_linux_Network.cpp @@ -182,7 +182,7 @@ private: } int createConnection (URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, - const int numRedirectsToFollow) + const int numRedirects) { closeSocket (false); @@ -279,7 +279,7 @@ private: String location (findHeaderItem (headerLines, "Location:")); - if (++levelsOfRedirection <= numRedirectsToFollow + if (++levelsOfRedirection <= numRedirects && status >= 300 && status < 400 && location.isNotEmpty() && location != address) { @@ -295,7 +295,7 @@ private: } address = location; - return createConnection (progressCallback, progressCallbackContext, numRedirectsToFollow); + return createConnection (progressCallback, progressCallbackContext, numRedirects); } return status; diff --git a/modules/juce_core/network/juce_IPAddress.cpp b/modules/juce_core/network/juce_IPAddress.cpp index 6c4d087712..5560a49b0c 100644 --- a/modules/juce_core/network/juce_IPAddress.cpp +++ b/modules/juce_core/network/juce_IPAddress.cpp @@ -126,7 +126,7 @@ static void findIPAddresses (int sock, Array& result) cfg.ifc_buf += IFNAMSIZ + cfg.ifc_req->ifr_addr.sa_len; } #else - for (size_t i = 0; i < cfg.ifc_len / sizeof (struct ifreq); ++i) + for (size_t i = 0; i < (size_t) cfg.ifc_len / (size_t) sizeof (struct ifreq); ++i) { const ifreq& item = cfg.ifc_req[i]; diff --git a/modules/juce_core/text/juce_CharPointer_UTF8.h b/modules/juce_core/text/juce_CharPointer_UTF8.h index f6e156e147..6cc5ebf4f3 100644 --- a/modules/juce_core/text/juce_CharPointer_UTF8.h +++ b/modules/juce_core/text/juce_CharPointer_UTF8.h @@ -511,7 +511,7 @@ public: if (byte < 0) { - uint8 bit = 0x40; + int bit = 0x40; int numExtraValues = 0; while ((byte & bit) != 0) diff --git a/modules/juce_core/text/juce_CharacterFunctions.cpp b/modules/juce_core/text/juce_CharacterFunctions.cpp index 11eaa188b6..b339405941 100644 --- a/modules/juce_core/text/juce_CharacterFunctions.cpp +++ b/modules/juce_core/text/juce_CharacterFunctions.cpp @@ -34,18 +34,18 @@ juce_wchar CharacterFunctions::toUpperCase (const juce_wchar character) noexcept { - return towupper ((wchar_t) character); + return (juce_wchar) towupper ((wint_t) character); } juce_wchar CharacterFunctions::toLowerCase (const juce_wchar character) noexcept { - return towlower ((wchar_t) character); + return (juce_wchar) towlower ((wint_t) character); } bool CharacterFunctions::isUpperCase (const juce_wchar character) noexcept { #if JUCE_WINDOWS - return iswupper ((wchar_t) character) != 0; + return iswupper ((wint_t) character) != 0; #else return toLowerCase (character) != character; #endif @@ -54,7 +54,7 @@ bool CharacterFunctions::isUpperCase (const juce_wchar character) noexcept bool CharacterFunctions::isLowerCase (const juce_wchar character) noexcept { #if JUCE_WINDOWS - return iswlower ((wchar_t) character) != 0; + return iswlower ((wint_t) character) != 0; #else return toUpperCase (character) != character; #endif @@ -72,7 +72,7 @@ bool CharacterFunctions::isWhitespace (const char character) noexcept bool CharacterFunctions::isWhitespace (const juce_wchar character) noexcept { - return iswspace ((wchar_t) character) != 0; + return iswspace ((wint_t) character) != 0; } bool CharacterFunctions::isDigit (const char character) noexcept @@ -82,7 +82,7 @@ bool CharacterFunctions::isDigit (const char character) noexcept bool CharacterFunctions::isDigit (const juce_wchar character) noexcept { - return iswdigit ((wchar_t) character) != 0; + return iswdigit ((wint_t) character) != 0; } bool CharacterFunctions::isLetter (const char character) noexcept @@ -93,7 +93,7 @@ bool CharacterFunctions::isLetter (const char character) noexcept bool CharacterFunctions::isLetter (const juce_wchar character) noexcept { - return iswalpha ((wchar_t) character) != 0; + return iswalpha ((wint_t) character) != 0; } bool CharacterFunctions::isLetterOrDigit (const char character) noexcept @@ -105,7 +105,7 @@ bool CharacterFunctions::isLetterOrDigit (const char character) noexcept bool CharacterFunctions::isLetterOrDigit (const juce_wchar character) noexcept { - return iswalnum ((wchar_t) character) != 0; + return iswalnum ((wint_t) character) != 0; } int CharacterFunctions::getHexDigitValue (const juce_wchar digit) noexcept diff --git a/modules/juce_core/zip/zlib/trees.c b/modules/juce_core/zip/zlib/trees.c index 36a124d7b6..463bfc26e0 100644 --- a/modules/juce_core/zip/zlib/trees.c +++ b/modules/juce_core/zip/zlib/trees.c @@ -571,7 +571,7 @@ local void gen_codes (ct_data *tree, /* the tree to decorate */ ushf *bl_count) /* number of codes at each bit length */ { ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - ush code = 0; /* running code value */ + ush code_ = 0; /* running code value */ int bits; /* bit index */ int n; /* code index */ @@ -579,12 +579,12 @@ local void gen_codes (ct_data *tree, /* the tree to decorate */ * without bit reversal. */ for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits-1]) << 1; + next_code[bits] = code_ = (code_ + bl_count[bits-1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. */ - Assert (code + bl_count[MAX_BITS]-1 == (1<last_lit != 0) do { @@ -1066,21 +1066,21 @@ local void compress_block (deflate_state *s, Tracecv(isgraph(lc), (stderr," '%c' ", lc)); } else { /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ - extra = extra_lbits[code]; + code_ = _length_code[lc]; + send_code(s, code_+LITERALS+1, ltree); /* send the length code */ + extra = extra_lbits[code_]; if (extra != 0) { - lc -= base_length[code]; + lc -= base_length[code_]; send_bits(s, lc, extra); /* send the extra length bits */ } dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - Assert (code < D_CODES, "bad d_code"); + code_ = d_code(dist); + Assert (code_ < D_CODES, "bad d_code"); - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; + send_code(s, code_, dtree); /* send the distance code */ + extra = extra_dbits[code_]; if (extra != 0) { - dist -= base_dist[code]; + dist -= base_dist[code_]; send_bits(s, dist, extra); /* send the extra distance bits */ } } /* literal or match pair ? */ @@ -1120,12 +1120,12 @@ local void set_data_type (deflate_state *s) * method would use a table) * IN assertion: 1 <= len <= 15 */ -local unsigned bi_reverse (unsigned code, int len) +local unsigned bi_reverse (unsigned code_, int len) { register unsigned res = 0; do { - res |= code & 1; - code >>= 1, res <<= 1; + res |= code_ & 1; + code_ >>= 1, res <<= 1; } while (--len > 0); return res >> 1; } diff --git a/modules/juce_graphics/colour/juce_PixelFormats.h b/modules/juce_graphics/colour/juce_PixelFormats.h index 2715cb2edf..f3c9c91de1 100644 --- a/modules/juce_graphics/colour/juce_PixelFormats.h +++ b/modules/juce_graphics/colour/juce_PixelFormats.h @@ -107,7 +107,7 @@ public: template forcedinline void blend (const Pixel& src) noexcept { - const uint32 alpha = 0x100 - src.getAlpha(); + const uint32 alpha = (uint32) (0x100 - src.getAlpha()); uint32 rb = src.getRB() + maskPixelComponents (getRB() * alpha); uint32 ag = src.getAG() + maskPixelComponents (getAG() * alpha); argb = clampPixelComponents (rb) + (clampPixelComponents (ag) << 8); @@ -234,9 +234,9 @@ public: } else { - components.b = (uint8) jmin ((uint32) 0xff, (components.b * 0xff) / alpha); - components.g = (uint8) jmin ((uint32) 0xff, (components.g * 0xff) / alpha); - components.r = (uint8) jmin ((uint32) 0xff, (components.r * 0xff) / alpha); + components.b = (uint8) jmin ((uint32) 0xffu, (components.b * 0xffu) / alpha); + components.g = (uint8) jmin ((uint32) 0xffu, (components.g * 0xffu) / alpha); + components.r = (uint8) jmin ((uint32) 0xffu, (components.r * 0xffu) / alpha); } } } @@ -350,7 +350,7 @@ public: template forcedinline void blend (const Pixel& src) noexcept { - const uint32 alpha = 0x100 - src.getAlpha(); + const uint32 alpha = (uint32) (0x100 - src.getAlpha()); uint32 rb = clampPixelComponents (src.getRB() + maskPixelComponents (getRB() * alpha)); uint32 ag = src.getAG() + (g * alpha >> 8); diff --git a/modules/juce_graphics/native/juce_RenderingHelpers.h b/modules/juce_graphics/native/juce_RenderingHelpers.h index ad08e9f933..53c2f10a76 100644 --- a/modules/juce_graphics/native/juce_RenderingHelpers.h +++ b/modules/juce_graphics/native/juce_RenderingHelpers.h @@ -433,12 +433,12 @@ namespace GradientPixelIterators if (vertical) { scale = roundToInt ((numEntries << (int) numScaleBits) / (double) (p2.y - p1.y)); - start = roundToInt (p1.y * scale); + start = roundToInt (p1.y * (float) scale); } else if (horizontal) { scale = roundToInt ((numEntries << (int) numScaleBits) / (double) (p2.x - p1.x)); - start = roundToInt (p1.x * scale); + start = roundToInt (p1.x * (float) scale); } else { @@ -534,8 +534,9 @@ namespace GradientPixelIterators forcedinline void setY (const int y) noexcept { - lineYM01 = inverseTransform.mat01 * y + inverseTransform.mat02 - gx1; - lineYM11 = inverseTransform.mat11 * y + inverseTransform.mat12 - gy1; + const float floatY = (float) y; + lineYM01 = inverseTransform.mat01 * floatY + inverseTransform.mat02 - gx1; + lineYM11 = inverseTransform.mat11 * floatY + inverseTransform.mat12 - gy1; } inline PixelARGB getPixel (const int px) const noexcept @@ -1301,7 +1302,7 @@ namespace EdgeTableFillers sx += pixelOffset; sy += pixelOffset; float x1 = sx, y1 = sy; - sx += numPixels; + sx += (float) numPixels; inverseTransform.transformPoints (x1, y1, sx, sy); xBresenham.set ((int) (x1 * 256.0f), (int) (sx * 256.0f), numPixels, pixelOffsetInt); diff --git a/modules/juce_graphics/native/juce_freetype_Fonts.cpp b/modules/juce_graphics/native/juce_freetype_Fonts.cpp index d124eafd97..dbcfdb9af0 100644 --- a/modules/juce_graphics/native/juce_freetype_Fonts.cpp +++ b/modules/juce_graphics/native/juce_freetype_Fonts.cpp @@ -307,9 +307,9 @@ public: faceWrapper->face->style_name); } - void initialiseCharacteristics (const String& name, const String& style) + void initialiseCharacteristics (const String& fontName, const String& fontStyle) { - setCharacteristics (name, style, + setCharacteristics (fontName, fontStyle, faceWrapper->face->ascender / (float) (faceWrapper->face->ascender - faceWrapper->face->descender), L' '); } diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index 0a40410114..abddbc78a6 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -587,15 +587,15 @@ public: if (imageDepth == 16) { - const int pixelStride = 2; - const int lineStride = ((w * pixelStride + 3) & ~3); + const int pixStride = 2; + const int stride = ((w * pixStride + 3) & ~3); - imageData16Bit.malloc (lineStride * h); + imageData16Bit.malloc (stride * h); xImage->data = imageData16Bit; xImage->bitmap_pad = 16; - xImage->depth = pixelStride * 8; - xImage->bytes_per_line = lineStride; - xImage->bits_per_pixel = pixelStride * 8; + xImage->depth = pixStride * 8; + xImage->bytes_per_line = stride; + xImage->bits_per_pixel = pixStride * 8; xImage->red_mask = visual->red_mask; xImage->green_mask = visual->green_mask; xImage->blue_mask = visual->blue_mask; @@ -1143,11 +1143,11 @@ public: ::Window root, child; int wx, wy; - unsigned int ww, wh, bw, depth; + unsigned int ww, wh, bw, bitDepth; ScopedXLock xlock; - return XGetGeometry (display, (::Drawable) windowH, &root, &wx, &wy, &ww, &wh, &bw, &depth) + return XGetGeometry (display, (::Drawable) windowH, &root, &wx, &wy, &ww, &wh, &bw, &bitDepth) && XTranslateCoordinates (display, windowH, windowH, localPos.getX(), localPos.getY(), &wx, &wy, &child) && child == None; } @@ -2384,11 +2384,11 @@ private: { Window root, child; int wx = 0, wy = 0; - unsigned int ww = 0, wh = 0, bw, depth; + unsigned int ww = 0, wh = 0, bw, bitDepth; ScopedXLock xlock; - if (XGetGeometry (display, (::Drawable) windowH, &root, &wx, &wy, &ww, &wh, &bw, &depth)) + if (XGetGeometry (display, (::Drawable) windowH, &root, &wx, &wy, &ww, &wh, &bw, &bitDepth)) if (! XTranslateCoordinates (display, windowH, root, 0, 0, &wx, &wy, &child)) wx = wy = 0; @@ -3009,10 +3009,10 @@ ModifierKeys ModifierKeys::getCurrentModifiersRealtime() noexcept //============================================================================== -void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool /* allowMenusAndBars */) +void Desktop::setKioskComponent (Component* comp, bool enableOrDisable, bool /* allowMenusAndBars */) { if (enableOrDisable) - kioskModeComponent->setBounds (getDisplays().getMainDisplay().totalArea); + comp->setBounds (getDisplays().getMainDisplay().totalArea); } //==============================================================================