Skip to content

Commit da2e81a

Browse files
committed
libfoundation: Clean up unused variables.
1 parent 7c11982 commit da2e81a

5 files changed

Lines changed: 2 additions & 22 deletions

File tree

libfoundation/src/foundation-chunk.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ bool MCChunkIterate(MCRange& x_range, MCStringRef p_string, MCStringRef p_delimi
384384

385385
void MCChunkSkipWord(MCStringRef p_string, MCStringRef p_line_delimiter, MCStringOptions p_options, bool p_skip_spaces, uindex_t& x_offset)
386386
{
387-
uindex_t t_space_offset;
388387
uindex_t t_length = MCStringGetLength(p_string);
389388
uindex_t t_end_quote_offset = t_length;
390389
uindex_t t_end_line_offset = t_length;

libfoundation/src/foundation-data.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ bool MCDataConvertStringToData(MCStringRef string, MCDataRef& r_data)
175175
// AL-2014-12-12: [[ Bug 14208 ]] Implement MCDataConvertStringToData reduce the overhead in
176176
// converting from non-native string to data.
177177

178-
uindex_t t_native_length;
179178
MCStringRef t_native_copy;
180179
t_native_copy = nil;
181180
if (!MCStringNativeCopy(string, t_native_copy))
@@ -833,7 +832,6 @@ MCDataLastIndexOf (MCDataRef self,
833832
return false;
834833

835834
const byte_t *t_haystack = MCDataGetBytePtr (self);
836-
uindex_t t_haystack_len = MCDataGetLength (self);
837835

838836
for (uindex_t t_roffset = t_needle_len - 1;
839837
t_roffset < p_range.length;

libfoundation/src/foundation-foreign.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ MC_DLLEXPORT_DEF MCTypeInfoRef MCForeignSSizeTypeInfo() { return kMCSSizeTypeInf
4949
MC_DLLEXPORT_DEF
5050
bool MCForeignValueCreate(MCTypeInfoRef p_typeinfo, void *p_contents, MCForeignValueRef& r_value)
5151
{
52-
bool t_success;
53-
t_success = true;
54-
5552
MCTypeInfoRef t_resolved_typeinfo;
5653
t_resolved_typeinfo = __MCTypeInfoResolve(p_typeinfo);
5754

@@ -75,9 +72,6 @@ bool MCForeignValueCreate(MCTypeInfoRef p_typeinfo, void *p_contents, MCForeignV
7572
MC_DLLEXPORT_DEF
7673
bool MCForeignValueCreateAndRelease(MCTypeInfoRef p_typeinfo, void *p_contents, MCForeignValueRef& r_value)
7774
{
78-
bool t_success;
79-
t_success = true;
80-
8175
MCTypeInfoRef t_resolved_typeinfo;
8276
t_resolved_typeinfo = __MCTypeInfoResolve(p_typeinfo);
8377

@@ -101,9 +95,6 @@ bool MCForeignValueCreateAndRelease(MCTypeInfoRef p_typeinfo, void *p_contents,
10195
MC_DLLEXPORT_DEF
10296
bool MCForeignValueExport(MCTypeInfoRef p_typeinfo, MCValueRef p_value, MCForeignValueRef& r_value)
10397
{
104-
bool t_success;
105-
t_success = true;
106-
10798
MCTypeInfoRef t_resolved_typeinfo;
10899
t_resolved_typeinfo = __MCTypeInfoResolve(p_typeinfo);
109100

libfoundation/src/foundation-pickle.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static bool MCPickleReadTypeInfoRefContents(MCStreamRef stream, uint8_t p_kind,
197197

198198
for(uindex_t i = 0; t_success && i < t_param_count; i++)
199199
{
200-
uint8_t t_mode, t_type_kind;;
200+
uint8_t t_mode;
201201
t_success = MCStreamReadUInt8(stream, t_mode) &&
202202
MCPickleReadTypeInfoRef(stream, t_param_info[i] . type);
203203
if (t_success)
@@ -582,9 +582,6 @@ static bool MCPickleWriteCompactUInt(MCStreamRef stream, uint32_t p_value)
582582

583583
static bool MCPickleWriteStringRef(MCStreamRef stream, MCStringRef p_value)
584584
{
585-
bool t_success;
586-
t_success = true;
587-
588585
MCAutoStringRefAsUTF8String t_utf8_string;
589586
if (!t_utf8_string . Lock(p_value))
590587
return failed();

libfoundation/src/foundation-stream.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ struct __MCMemoryInputStream
5252

5353
static void __MCMemoryInputStreamDestroy(MCStreamRef p_stream)
5454
{
55-
__MCMemoryInputStream *self;
56-
self = (__MCMemoryInputStream *)MCStreamGetExtraBytesPtr(p_stream);
55+
/* Do nothing because the memory input stream doesn't own its buffer */
5756
}
5857

5958
static bool __MCMemoryInputStreamIsFinished(MCStreamRef p_stream, bool& r_finished)
@@ -182,16 +181,12 @@ static void __MCMemoryOutputStreamDestroy(MCStreamRef p_stream)
182181

183182
static bool __MCMemoryOutputStreamIsFinished(MCStreamRef p_stream, bool& r_finished)
184183
{
185-
__MCMemoryOutputStream *self;
186-
self = (__MCMemoryOutputStream *)MCStreamGetExtraBytesPtr(p_stream);
187184
r_finished = false;
188185
return true;
189186
}
190187

191188
static bool __MCMemoryOutputStreamGetAvailableForWrite(MCStreamRef p_stream, size_t& r_amount)
192189
{
193-
__MCMemoryOutputStream *self;
194-
self = (__MCMemoryOutputStream *)MCStreamGetExtraBytesPtr(p_stream);
195190
r_amount = SIZE_MAX;
196191
return true;
197192
}

0 commit comments

Comments
 (0)