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

Fixed some warnings flagged by Clang's static analyzer

This commit is contained in:
ed 2021-07-19 11:48:06 +01:00
parent d3556dfd7f
commit a2d03d2266
9 changed files with 52 additions and 12 deletions

View file

@ -7,7 +7,7 @@ the appropriate libraries on every different platform.
There are minimal changes to the Ogg-Vorbis code - a few include paths have
been changed to make it build smoothly, and some headers have been added to
allow you to exclude it from the build. Any significant code modifications
are marked clearly by "JUCE CHANGE STARTS HERE" and "JUCE_CHANGE_ENDS_HERE"
are marked clearly by "JUCE CHANGE STARTS HERE" and "JUCE CHANGE ENDS HERE"
comments.
=====================================================================

View file

@ -489,6 +489,10 @@ static int fit_line(lsfit_acc *a,int fits,int *y0,int *y1,
y2b+= *y1 * *y1;
xyb+= *y1 * x1;
bn++;
// JUCE CHANGE STARTS HERE
(void) y2b;
// JUCE CHANGE ENDS HERE
}
{

View file

@ -834,6 +834,10 @@ static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
t1+=t2;
t4+=t2;
}
// JUCE CHANGE STARTS HERE
(void) t5;
// JUCE CHANGE ENDS HERE
}
static void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,

View file

@ -334,6 +334,9 @@ static int _fetch_headers(OggVorbis_File *vf,vorbis_info *vi,vorbis_comment *vc,
/* vorbis header; continue setup */
vf->ready_state=STREAMSET;
if((ret=vorbis_synthesis_headerin(vi,vc,&op))){
// JUCE CHANGE STARTS HERE
(void) ret;
// JUCE CHANGE ENDS HERE
ret=OV_EBADHEADER;
goto bail_header;
}
@ -784,6 +787,9 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
if(!readp)return(0);
if((ret=_get_next_page(vf,&og,-1))<0){
// JUCE CHANGE STARTS HERE
(void) ret;
// JUCE CHANGE ENDS HERE
return(OV_EOF); /* eof. leave unitialized */
}
@ -865,6 +871,9 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
vf->current_serialno=vf->os.serialno;
vf->current_link++;
link=0;
// JUCE CHANGE STARTS HERE
(void) link;
// JUCE CHANGE ENDS HERE
}
}
}
@ -1667,6 +1676,9 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
break;
}else
result=ogg_stream_packetout(&vf->os,NULL);
// JUCE CHANGE STARTS HERE
(void) result;
// JUCE CHANGE ENDS HERE
}
}
}
@ -2267,6 +2279,9 @@ static void _ov_getlap(OggVorbis_File *vf,vorbis_info *vi,vorbis_dsp_state *vd,
memcpy(lappcm[i]+lapcount,pcm[i],sizeof(**pcm)*samples);
lapcount+=samples;
}
// JUCE CHANGE STARTS HERE
(void) lapcount;
// JUCE CHANGE ENDS HERE
}
}

View file

@ -196,18 +196,19 @@ private:
OwnedArray<RenderingOp> renderOps;
//==============================================================================
template <typename LambdaType>
template <typename LambdaType,
std::enable_if_t<std::is_rvalue_reference<LambdaType&&>::value, int> = 0>
void createOp (LambdaType&& fn)
{
struct LambdaOp : public RenderingOp
{
LambdaOp (LambdaType&& f) : function (std::move (f)) {}
LambdaOp (LambdaType&& f) : function (std::forward<LambdaType> (f)) {}
void perform (const Context& c) override { function (c); }
LambdaType function;
};
renderOps.add (new LambdaOp (std::move (fn)));
renderOps.add (new LambdaOp (std::forward<LambdaType> (fn)));
}
//==============================================================================

View file

@ -363,11 +363,12 @@
#ifndef PNG_VERSION_INFO_ONLY
// JUCE modification
//JUCE CHANGE STARTS HERE
///* Inhibit C++ name-mangling for libpng functions but not for system calls. */
//#ifdef __cplusplus
//extern "C" {
//#endif /* __cplusplus */
//JUCE CHANGE ENDS HERE
/* Version information for C files, stored in png.c. This had better match
* the version above.
@ -3239,10 +3240,11 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
PNG_EXPORT_LAST_ORDINAL(249);
#endif
// JUCE modification
// JUCE CHANGE STARTS HERE
//#ifdef __cplusplus
//}
//#endif
// JUCE CHANGE ENDS HERE
#endif /* PNG_VERSION_INFO_ONLY */
/* Do not put anything past this line */

View file

@ -958,11 +958,12 @@ PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]);
#endif /* SIMPLIFIED_READ/WRITE */
// JUCE modification
// JUCE CHANGE STARTS HERE
///* Inhibit C++ name-mangling for libpng functions but not for system calls. */
//#ifdef __cplusplus
//extern "C" {
//#endif /* __cplusplus */
// JUCE CHANGE ENDS HERE
/* Internal functions; these are not exported from a DLL however because they
* are used within several of the C source files they have to be C extern.
@ -2145,10 +2146,11 @@ PNG_INTERNAL_FUNCTION(int,
#include "pngdebug.h"
// JUCE modification
// JUCE CHANGE STARTS HERE
//#ifdef __cplusplus
//}
//#endif
// JUCE CHANGE ENDS HERE
#endif /* PNG_VERSION_INFO_ONLY */
#endif /* PNGPRIV_H */

View file

@ -425,6 +425,10 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
sp+=3; dp = sp;
*dp = (png_byte)(255 - *(sp++));
}
// JUCE CHANGE STARTS HERE
(void) dp;
// JUCE CHANGE ENDS HERE
}
#ifdef PNG_WRITE_16BIT_SUPPORTED
@ -449,6 +453,10 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)(255 - *(sp++));
*dp = (png_byte)(255 - *(sp++));
}
// JUCE CHANGE STARTS HERE
(void) dp;
// JUCE CHANGE ENDS HERE
}
#endif /* WRITE_16BIT */
}
@ -487,6 +495,10 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)(255 - *(sp++));
*dp = (png_byte)(255 - *(sp++));
}
// JUCE CHANGE STARTS HERE
(void) dp;
// JUCE CHANGE ENDS HERE
}
#endif /* WRITE_16BIT */
}

View file

@ -402,7 +402,7 @@ private:
return;
}
auto afterAsking = [doSave = std::move (doSave),
auto afterAsking = [doSave = std::forward<DoSave> (doSave),
completed = std::move (completed)] (SafeParentPointer ptr,
int alertResult)
{
@ -562,7 +562,7 @@ private:
newFile,
showMessageOnFailure,
showWaitCursor,
doSaveDocument = std::move (doSaveDocument)]
doSaveDocument = std::forward<DoSaveDocument> (doSaveDocument)]
{
if (! parent.shouldExitAsyncCallback())
parent->saveInternal (parent,
@ -723,8 +723,8 @@ private:
{
doSelectFilename (parent,
warnAboutOverwritingExistingFiles,
[doSaveAs = std::move (doSaveAs),
doAskToOverwriteFile = std::move (doAskToOverwriteFile),
[doSaveAs = std::forward<DoSaveAs> (doSaveAs),
doAskToOverwriteFile = std::forward<DoAskToOverwriteFile> (doAskToOverwriteFile),
callback = std::move (callback)] (SafeParentPointer ptr, File chosen)
{
if (ptr.shouldExitAsyncCallback())