Skip to content

Commit d3e6094

Browse files
authored
Merge pull request livecode#4479 from montegoulding/unused-variable
Turn on -Werror=unused-variable
2 parents 398b17d + baa8fdc commit d3e6094

File tree

103 files changed

+141
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+141
-446
lines changed

config/mac.gypi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
'-Werror=conversion-null',
131131
'-Werror=missing-declarations',
132132
'-Werror=mismatched-new-delete',
133+
'-Werror=unused-variable',
133134
'-Werror=constant-logical-operand',
134135
'-Werror=unknown-pragmas',
135136
'-Werror=missing-field-initializers',

engine/src/bitmapeffectblur.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,7 @@ void MCBitmapEffectFastGaussianBlur::Process(uint8_t *mask)
447447
uint32_t *t_buffer_ptr;
448448
t_buffer_ptr = t_buffer;
449449

450-
int32_t t_y = t_top + y;
451-
452-
for (int32_t k = 0; k < t_vcount; k++)//, t_y++)
450+
for (int32_t k = 0; k < t_vcount; k++)
453451
{
454452
uint32_t t_weighted = t_kernel_ptr[k] * (t_buffer_ptr[x] >> 16);
455453
if ((0xFFFFFFFF - t_alpha) > t_weighted)

engine/src/block.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,21 +1683,14 @@ findex_t MCBlock::GetCursorIndex(coord_t x, Boolean chunk, Boolean last, bool mo
16831683
}
16841684

16851685
findex_t i = m_index;
1686-
coord_t cwidth;
1687-
findex_t tlen = 0;
1688-
coord_t twidth = 0;
1689-
coord_t toldwidth = 0;
1690-
1686+
16911687
// MW-2012-02-01: [[ Bug 9982 ]] iOS uses sub-pixel positioning, so make sure we measure
16921688
// complete runs.
16931689
// MW-2013-11-07: [[ Bug 11393 ]] We only want to measure complete runs now regardless of
16941690
// platform.
16951691
coord_t t_last_width;
16961692
t_last_width = is_rtl() ? width : 0;
16971693

1698-
MCRange t_char_range;
1699-
MCRange t_cp_range;
1700-
17011694
coord_t t_pos = t_last_width;
17021695
while(i < m_index + m_size)
17031696
{
@@ -1748,8 +1741,7 @@ coord_t MCBlock::getsubwidth(MCDC *dc, coord_t x /* IGNORED */, findex_t i, find
17481741
else
17491742
{
17501743
findex_t sptr = i;
1751-
findex_t t_length = l;
1752-
1744+
17531745
// MW-2012-02-12: [[ Bug 10662 ]] If the last char is a VTAB then ignore it.
17541746
if (parent->TextIsLineBreak(parent->GetCodepointAtIndex(sptr + l - 1)))
17551747
l--;

engine/src/button.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -212,23 +212,6 @@ typedef struct
212212
const char *token;
213213
} ModKeyToken;
214214

215-
static ModKeyToken modifier_tokens[] =
216-
{
217-
{MS_SHIFT, 5, "shift"},
218-
{MS_SHIFT, 1, "@"},
219-
{MS_ALT, 6, "option"},
220-
{MS_ALT, 3, "opt"},
221-
{MS_ALT, 3, "alt"},
222-
{MS_ALT, 1, "#"},
223-
{MS_MAC_CONTROL, 7, "control"},
224-
{MS_MAC_CONTROL, 4, "ctrl"},
225-
{MS_MAC_CONTROL, 1, "%"},
226-
{MS_CONTROL, 7, "command"},
227-
{MS_CONTROL, 3, "cmd"},
228-
{MS_CONTROL, 1, "^"},
229-
{0, 0, NULL}
230-
};
231-
232215
////////////////////////////////////////////////////////////////////////////////
233216

234217
MCPropertyInfo MCButton::kProperties[] =
@@ -1394,7 +1377,7 @@ Boolean MCButton::mup(uint2 which, bool p_release)
13941377
// that we need to check is the rect of the stack containing
13951378
// the menu).
13961379
MCRectangle t_rect = t_menu->getstack()->getrect();
1397-
t_outside = !MCU_point_in_rect(rect, mx, my);
1380+
t_outside = !MCU_point_in_rect(t_rect, mx, my);
13981381

13991382
// Move to the parent menu, if it exists
14001383
if (t_menu->getstack()->getparent() // Stack's parent
@@ -2576,7 +2559,6 @@ class ButtonMenuCallback : public IParseMenuCallback
25762559

25772560
Boolean MCButton::findmenu(bool p_just_for_accel)
25782561
{
2579-
Boolean isunicode = hasunicode();
25802562
if (!MCNameIsEmpty(menuname))
25812563
{
25822564
if (!(menu.IsValid()))
@@ -3831,8 +3813,6 @@ IO_stat MCButton::load(IO_handle stream, uint32_t version)
38313813
return checkloadstat(stat);
38323814
}
38333815

3834-
uint4 tacceltextsize;
3835-
38363816
if ((stat = IO_read_uint2(&accelkey, stream)) != IO_NORMAL)
38373817
return checkloadstat(stat);
38383818
if (accelkey < 256)

engine/src/cmdsc.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ void MCCreate::exec_ctxt(MCExecContext& ctxt)
587587
if (!ctxt . EvalOptionalExprAsNullableStringRef(newname, EE_CREATE_BADEXP, &t_new_name))
588588
return;
589589

590-
MCObject *optr;
591590
if (script_only_stack)
592591
MCInterfaceExecCreateScriptOnlyStack(ctxt, *t_new_name);
593592
else

engine/src/customprinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,6 @@ bool MCCustomMetaContext::begincomposite(const MCRectangle &p_mark_clip, MCGCont
636636
if (t_success)
637637
t_success = MCGContextCreate(t_width, t_height, true, t_gcontext);
638638

639-
MCContext *t_context = nil;
640639
if (t_success)
641640
{
642641
MCGContextScaleCTM(t_gcontext, t_scale, t_scale);

engine/src/debug.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ uint2 MCnexecutioncontexts = 0;
6868
uint2 MCdebugcontext = MAXUINT2;
6969
Boolean MCmessagemessages = False;
7070

71-
static int2 depth;
72-
7371
////////////////////////////////////////////////////////////////////////////////
7472

7573
#if defined(_SERVER)
@@ -199,15 +197,14 @@ void MCB_message(MCExecContext &ctxt, MCNameRef mess, MCParameter *p)
199197
if (ctxt.GetObject() -> message(mess, p, True, False, True) == ES_NORMAL)
200198
{
201199
MCcheckstack = oldcheck;
202-
// if (depth++ > 1)
203-
// fprintf(stderr, "Debug depth %d\n", depth);
204-
while (!MCtracereturn)
200+
201+
while (!MCtracereturn)
205202
{
206203
MCU_resetprops(True);
207204
MCscreen->wait(REFRESH_INTERVAL, True, True);
208205
}
209-
// depth--;
210-
if (MCtracedobject == NULL)
206+
207+
if (MCtracedobject == NULL)
211208
MCtracedobject = ctxt.GetObject();
212209
if (MCtraceabort)
213210
{

engine/src/deploy_capsule.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ bool MCDeployCapsuleDefine(MCDeployCapsuleRef self, MCCapsuleSectionType p_type,
186186
bool MCDeployCapsuleDefineString(MCDeployCapsuleRef self, MCCapsuleSectionType p_type, MCStringRef p_string)
187187
{
188188
MCAutoStringRefAsCString t_auto_cstring;
189-
uindex_t t_length;
190-
char_t* t_native;
191189
/* UNCHECKED */ t_auto_cstring . Lock(p_string);
192190
return MCDeployCapsuleDefine(self, p_type, *t_auto_cstring, strlen(*t_auto_cstring) + 1);
193191
}

engine/src/desktop-dc.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ Boolean MCScreenDC::close(Boolean force)
137137
MCPlatformReleaseMenu(icon_menu);
138138

139139
// COCOA-TODO: Is this still needed?
140-
uint2 i;
141140
if (ncolors != 0)
142141
{
143142
int2 i;
@@ -670,7 +669,6 @@ void MCScreenDC::beep()
670669

671670
void MCScreenDC::getbeep(uint4 which, int4& r_value)
672671
{
673-
long v;
674672
switch (which)
675673
{
676674
case P_BEEP_LOUDNESS:
@@ -794,7 +792,6 @@ Boolean MCScreenDC::wait(real8 duration, Boolean dispatch, Boolean anyevent)
794792
real8 exittime = curtime + duration;
795793

796794
Boolean abort = False;
797-
Boolean reset = False;
798795
Boolean done = False;
799796

800797
MCwaitdepth++;

engine/src/desktop-menu.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ void MCButton::macopenmenu(void)
367367
return;
368368

369369
MCRectangle trect;
370-
long result;
371370

372371
int4 tmenux,tmenuy;
373372
tmenux = tmenuy = 0;

0 commit comments

Comments
 (0)