Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit c6bd398

Browse files
[[ UninitialisedVars ]] Fix Android compilation
1 parent 9e36cfb commit c6bd398

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

engine/src/customprinter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,8 @@ static bool dotextmark_callback(void *p_context, const MCTextLayoutSpan *p_span)
10851085
extern int32_t MCCustomPrinterComputeFontSize(void *font);
10861086
t_font_size = MCCustomPrinterComputeFontSize(p_span -> font);
10871087
t_font_handle = p_span -> font;
1088-
#elif defined(_SERVER)
1088+
#else
1089+
// Neither servers nor Android have an implementation
10891090
t_font_size = 0;
10901091
t_font_handle = NULL;
10911092
#endif
@@ -2179,8 +2180,8 @@ Exec_stat MCCustomPrinterCreate(MCStringRef p_destination, MCStringRef p_filenam
21792180
// AL-2014-09-19: Range argument to MCStringFormat is a pointer to an MCRange.
21802181
MCStringFormat(&t_module_path, "%*@/revpdfprinter.dylib", &t_range, MCcmd);
21812182
t_module = MCS_loadmodule(*t_module_path);
2182-
#elif defined(_SERVER)
2183-
2183+
#else
2184+
// Neither servers nor Android have an implementation
21842185
t_module = nil;
21852186
#endif
21862187
if (t_module != nil)

engine/src/mblandroiddialog.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ bool MCSystemPickDate(MCDateTime *p_current, MCDateTime *p_min, MCDateTime *p_ma
156156
int32_t t_current, t_min, t_max;
157157
bool t_use_min, t_use_max;
158158

159+
// Avoid to leave t_min/t_max uninitialised, even though showDatePicker
160+
// won't use it if t_use_min/t_use_max is not true
161+
t_min = 0;
162+
t_max = 0;
163+
159164
t_use_min = p_min != nil;
160165
t_use_max = p_max != nil;
161166

@@ -182,7 +187,7 @@ bool MCSystemPickDate(MCDateTime *p_current, MCDateTime *p_min, MCDateTime *p_ma
182187
MCD_convert_from_datetime(ctxt, *p_max, CF_SECONDS, CF_UNDEFINED, &t_val);
183188
/* UNCHECKED */ ctxt.ConvertToInteger(*t_val, t_max);
184189
}
185-
190+
186191
s_in_popup_dialog = true;
187192
s_dialog_result = kMCDialogResultUnknown;
188193
// IM-2012-10-31 [[ BZ 10483 ]] - make sure we have the timezone bias for the date

engine/src/mblandroidinput.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ void MCAndroidInputControl::GetTextAlign(MCExecContext& ctxt, MCNativeControlInp
637637
t_view = GetView();
638638

639639
MCInputTextAlign t_align;
640+
// Default to the switch's default
641+
t_align = kMCInputTextAlignLeft;
640642

641643
if (t_view != nil)
642644
MCAndroidObjectRemoteCall(t_view, "getTextAlign", "v", &t_align);
@@ -662,6 +664,8 @@ void MCAndroidInputControl::GetVerticalTextAlign(MCExecContext& ctxt, MCNativeCo
662664
t_view = GetView();
663665

664666
MCInputVerticalAlign t_align;
667+
// Default to the switch's default
668+
t_align = kMCInputVerticalAlignCenter;
665669

666670
if (t_view != nil)
667671
MCAndroidObjectRemoteCall(t_view, "getVerticalAlign", "i", &t_align);
@@ -698,6 +702,8 @@ void MCAndroidInputControl::GetAutoCapitalizationType(MCExecContext& ctxt, MCNat
698702
t_view = GetView();
699703

700704
MCInputCapitalizationType t_type;
705+
// Default to the switch default
706+
t_type = kMCInputCapitalizeNone;
701707

702708
if (t_view != nil)
703709
MCAndroidObjectRemoteCall(t_view, "getCapitalization", "i", &t_type);
@@ -739,6 +745,8 @@ void MCAndroidInputControl::GetKeyboardType(MCExecContext& ctxt, MCNativeControl
739745
t_view = GetView();
740746

741747
MCInputKeyboardType t_type;
748+
// Default to the switch's default
749+
t_type = kMCInputKeyboardTypeDefault;
742750

743751
if (t_view != nil)
744752
MCAndroidObjectRemoteCall(t_view, "getKeyboardType", "v", &t_type);
@@ -776,6 +784,8 @@ void MCAndroidInputControl::GetReturnKey(MCExecContext& ctxt, MCNativeControlInp
776784
t_view = GetView();
777785

778786
MCInputReturnKeyType t_type;
787+
// Default to the switch's default
788+
t_type = kMCInputReturnKeyTypeDefault;
779789

780790
if (t_view != nil)
781791
MCAndroidObjectRemoteCall(t_view, "getReturnKeyType", "i", &t_type);

0 commit comments

Comments
 (0)