Skip to content

Commit 842c002

Browse files
committed
Fix new errors flagged after removing -Wno-error=maybe-uninitialized
1 parent 40ae583 commit 842c002

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

libfoundation/src/foundation-string-native.cpp.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ struct __MCNativeStr_Forward
487487
size_t t_char_offset;
488488
t_char_offset = 0;
489489

490-
size_t t_offset;
490+
size_t t_offset = 0;
491491
while(t_char_offset < p_haystack_length)
492492
{
493493
if (CharEqual(p_haystack_chars[t_char_offset], p_needle_char))
@@ -527,7 +527,7 @@ struct __MCNativeStr_Forward
527527
size_t t_char_offset;
528528
t_char_offset = 0;
529529

530-
size_t t_offset;
530+
size_t t_offset = 0;
531531
while(t_char_offset <= p_haystack_length)
532532
{
533533
if (__MCNativeStr_Equal<CharEqual>(p_haystack_chars + t_char_offset,
@@ -570,7 +570,7 @@ struct __MCNativeStr_Reverse
570570
size_t t_char_offset;
571571
t_char_offset = p_haystack_length;
572572

573-
size_t t_offset;
573+
size_t t_offset = 0;
574574
while(t_char_offset > 0)
575575
{
576576
if (CharEqual(p_haystack_chars[t_char_offset - 1], p_needle_char))
@@ -610,7 +610,7 @@ struct __MCNativeStr_Reverse
610610
size_t t_char_offset;
611611
t_char_offset = p_haystack_length;
612612

613-
size_t t_offset;
613+
size_t t_offset = 0;
614614
while(t_char_offset > 0)
615615
{
616616
if (__MCNativeStr_Equal<CharEqual>(p_haystack_chars + t_char_offset - 1,
@@ -981,7 +981,7 @@ static bool __MCNativeOp_ForwardCharDelimitedOffset_Core(const char_t *p_haystac
981981
size_t t_index;
982982
t_index = 0;
983983

984-
size_t t_offset;
984+
size_t t_offset = 0;
985985
t_offset = 0;
986986

987987
size_t t_end_before;

libfoundation/src/foundation-string.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5144,7 +5144,7 @@ bool MCStringSplitNative(MCStringRef self, MCStringRef p_elem_del, MCStringRef p
51445144

51455145
for(;;)
51465146
{
5147-
const char_t *t_element_end;
5147+
const char_t *t_element_end = NULL;
51485148
split_find_end_of_element_native(t_sptr, t_eptr, p_elem_del -> native_chars, p_elem_del -> char_count, t_element_end, p_options);
51495149

51505150
MCAutoStringRef t_string;
@@ -5169,8 +5169,8 @@ bool MCStringSplitNative(MCStringRef self, MCStringRef p_elem_del, MCStringRef p
51695169

51705170
for(;;)
51715171
{
5172-
const char_t *t_element_end;
5173-
const char_t *t_key_end;
5172+
const char_t *t_element_end = NULL;
5173+
const char_t *t_key_end = NULL;
51745174

51755175
split_find_end_of_element_and_key_native(t_sptr, t_eptr, p_elem_del -> native_chars, p_elem_del -> char_count, p_key_del -> native_chars, p_key_del -> char_count, t_key_end, t_element_end, p_options);
51765176

@@ -5619,7 +5619,7 @@ MCStringSplitByDelimiterNative(MCStringRef self, MCStringRef p_elem_del, MCStrin
56195619

56205620
for(;;)
56215621
{
5622-
const char_t *t_element_end;
5622+
const char_t *t_element_end = NULL;
56235623
split_find_end_of_element_native(t_sptr, t_eptr, p_elem_del -> native_chars, p_elem_del -> char_count, t_element_end, p_options);
56245624

56255625
MCStringRef t_string;

0 commit comments

Comments
 (0)