Skip to content

Commit

Permalink
Enable -Wshadow compilation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Mar 13, 2019
1 parent f348b7a commit 686ab40
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions mythtv/configure
Expand Up @@ -6780,7 +6780,7 @@ elif enabled gcc; then
check_cflags -Wjump-misses-init
check_cflags -Wlogical-op
check_cflags -Wnull-dereference
#check_cflags -Wshadow
check_cflags -Wshadow
elif enabled llvm_gcc; then
check_cflags -mllvm -stack-alignment=16
elif enabled clang; then
Expand Down Expand Up @@ -6880,7 +6880,7 @@ if enabled gxx; then
check_cxxflags -Wmissing-declarations
check_cxxflags -Wnull-dereference
check_cxxflags -Woverloaded-virtual
#check_cxxflags -Wshadow
check_cxxflags -Wshadow

# This warning flag isn't enabled yet because it will require a
# large number of changes to the code to eliminate all the
Expand Down
8 changes: 4 additions & 4 deletions mythtv/filters/quickdnr/filter_quickdnr.c
Expand Up @@ -406,13 +406,13 @@ static int quickdnr2MMX(VideoFilter *f, VideoFrame *frame, int field)
// filter the leftovers from the mmx rutine
for (i = 0; i < 3; i++)
{
int thr1[3], thr2[3], height[3];
int thr1a[3], thr2a[3], heighta[3];
uint8_t *avg8[3], *buf8[3];
int end, beg;

init_vars(tf, frame, thr1, thr2, height, avg8, buf8);
init_vars(tf, frame, thr1a, thr2a, heighta, avg8, buf8);

end = height[i] * frame->pitches[i];
end = heighta[i] * frame->pitches[i];
beg = end & ~0x7;

if (beg == end)
Expand All @@ -421,7 +421,7 @@ static int quickdnr2MMX(VideoFilter *f, VideoFrame *frame, int field)
for (y = beg; y < end; y++)
{
int t = abs(avg8[i][y] - buf8[i][y]);
if (t < thr1[i])
if (t < thr1a[i])
{
if (t > thr2[i])
avg8[i][y] = (avg8[i][y] + buf8[i][y]) >> 1;
Expand Down
7 changes: 4 additions & 3 deletions mythtv/filters/yadif/filter_yadif.c
Expand Up @@ -409,9 +409,10 @@ static void filter_line_c(struct ThisFilter *p, uint8_t *dst,
int spatial_pred= (c+e)>>1;
int spatial_score= ABS(cur[-refs-1] - cur[+refs-1]) + ABS(c-e)
+ ABS(cur[-refs+1] - cur[+refs+1]) - 1;
int score;

#define CHECK(j)\
{ int score= ABS(cur[-refs-1+j] - cur[+refs-1-j])\
{ score= ABS(cur[-refs-1+j] - cur[+refs-1-j])\
+ ABS(cur[-refs +j] - cur[+refs -j])\
+ ABS(cur[-refs+1+j] - cur[+refs+1-j]);\
if (score < spatial_score){\
Expand Down Expand Up @@ -478,8 +479,8 @@ static void filter_func(struct ThisFilter *p, uint8_t *dst, int dst_offsets[3],
uint8_t *prev= &p->ref[nr_p][i][y*refs];
uint8_t *cur = &p->ref[nr_c][i][y*refs];
uint8_t *next= &p->ref[2][i][y*refs];
uint8_t *dst2= dst + dst_offsets[i] + y*dst_stride[i];
p->filter_line(p, dst2, prev, cur, next, w, refs, field);
uint8_t *dst2a= dst + dst_offsets[i] + y*dst_stride[i];
p->filter_line(p, dst2a, prev, cur, next, w, refs, field);
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/recorders/RTjpegN.cpp
Expand Up @@ -531,14 +531,14 @@ void RTjpeg::QuantInit(void)
qtbl.int16[i] = static_cast<int16_t>(cqt[i]);
}

void RTjpeg::Quant(int16_t *block, int32_t *qtbl)
void RTjpeg::Quant(int16_t *_block, int32_t *qtbl)
{
int i;
mmx_t *bl, *ql;


ql=(mmx_t *)qtbl;
bl=(mmx_t *)block;
bl=(mmx_t *)_block;

movq_m2r(RTjpeg_ones, mm6);
movq_m2r(RTjpeg_half, mm7);
Expand Down Expand Up @@ -572,12 +572,12 @@ void RTjpeg::QuantInit()
{
}

void RTjpeg::Quant(int16_t *block, int32_t *qtbl)
void RTjpeg::Quant(int16_t *_block, int32_t *qtbl)
{
int i;

for(i=0; i<64; i++)
block[i]=(int16_t)((block[i]*qtbl[i]+32767)>>16);
_block[i]=(int16_t)((_block[i]*qtbl[i]+32767)>>16);
}
#endif

Expand Down
22 changes: 11 additions & 11 deletions mythtv/libs/libmythtv/videoout_xv.cpp
Expand Up @@ -357,7 +357,7 @@ void VideoOutputXv::UngrabXvPort(MythXDisplay *disp, int port)
*
* \return port number if it succeeds, else -1.
*/
int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* _disp, Window root,
MythCodecID /*mcodecid*/,
uint width, uint height,
bool &xvsetdefaults,
Expand Down Expand Up @@ -397,7 +397,7 @@ int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
XvAdaptorInfo *ai = nullptr;
uint p_num_adaptors = 0;
int ret = Success;
XLOCK(disp, ret = XvQueryAdaptors(disp->GetDisplay(), root,
XLOCK(_disp, ret = XvQueryAdaptors(_disp->GetDisplay(), root,
&p_num_adaptors, &ai));
if (Success != ret)
{
Expand Down Expand Up @@ -439,7 +439,7 @@ int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
XvPortID p = 0;

if ((req[j].feature_flags & XvAttributes::kFeaturePicCtrl) &&
(!xv_is_attrib_supported(disp, firstPort, "XV_BRIGHTNESS")))
(!xv_is_attrib_supported(_disp, firstPort, "XV_BRIGHTNESS")))
{
LOG(VB_PLAYBACK, LOG_ERR, LOC +
"Missing XV_BRIGHTNESS, rejecting.");
Expand All @@ -449,7 +449,7 @@ int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
LOG(VB_PLAYBACK, LOG_INFO, LOC + "Has XV_BRIGHTNESS...");

if ((req[j].feature_flags & XvAttributes::kFeatureChromakey) &&
(!xv_is_attrib_supported(disp, firstPort, "XV_COLORKEY")))
(!xv_is_attrib_supported(_disp, firstPort, "XV_COLORKEY")))
{
LOG(VB_PLAYBACK, LOG_ERR, LOC +
"Missing XV_COLORKEY, rejecting.");
Expand All @@ -460,16 +460,16 @@ int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,

for (p = firstPort; (p <= lastPort) && (port == -1); ++p)
{
disp->Lock();
ret = XvGrabPort(disp->GetDisplay(), p, CurrentTime);
_disp->Lock();
ret = XvGrabPort(_disp->GetDisplay(), p, CurrentTime);
if (Success == ret)
{
LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("Grabbed xv port %1").arg(p));
port = p;
xvsetdefaults = add_open_xv_port(disp, p);
xvsetdefaults = add_open_xv_port(_disp, p);
}
disp->Unlock();
_disp->Unlock();
}
}

Expand All @@ -480,7 +480,7 @@ int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
QString("XV_SET_DEFAULTS is %1supported on this port")
.arg(xvsetdefaults ? "" : "not "));

bool xv_vsync = xv_is_attrib_supported(disp, port,
bool xv_vsync = xv_is_attrib_supported(_disp, port,
"XV_SYNC_TO_VBLANK");
LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("XV_SYNC_TO_VBLANK %1supported")
Expand All @@ -489,7 +489,7 @@ int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,
{
LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("XVideo Sync to VBlank %1set")
.arg(xv_set_attrib(disp, port, "XV_SYNC_TO_VBLANK", 1) ?
.arg(xv_set_attrib(_disp, port, "XV_SYNC_TO_VBLANK", 1) ?
"" : "NOT "));
}

Expand All @@ -502,7 +502,7 @@ int VideoOutputXv::GrabSuitableXvPort(MythXDisplay* disp, Window root,

// free list of Xv ports
if (ai)
XLOCK(disp, XvFreeAdaptorInfo(ai));
XLOCK(_disp, XvFreeAdaptorInfo(ai));

if ((port != -1) && adaptor_name)
*adaptor_name = lastAdaptorName;
Expand Down

0 comments on commit 686ab40

Please sign in to comment.