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

Commit a0821f4

Browse files
author
Ali Lloyd
committed
[[ RefactorSyntax ]] Fix various android issues
1 parent f2022fc commit a0821f4

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

engine/src/mblandroidcamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ MCCameraFeaturesType MCSystemGetSpecificCameraFeatures(MCCameraSourceType p_sour
4747
MCAutoStringRef t_camera_dir;
4848
uindex_t t_offset = 0;
4949

50-
MCAndroidEngineCall("getCameraDirections", "x", &t_camera_dir);
50+
MCAndroidEngineCall("getCameraDirections", "x", &(&t_camera_dir));
5151

5252
bool t_cam_exists = false;
5353

@@ -67,7 +67,7 @@ MCCamerasFeaturesType MCSystemGetAllCameraFeatures()
6767
MCAutoStringRef t_camera_dir;
6868
uindex_t t_offset = 0;
6969

70-
MCAndroidEngineCall("getCameraDirections", "x", &t_camera_dir);
70+
MCAndroidEngineCall("getCameraDirections", "x", &(&t_camera_dir));
7171

7272
uint32_t t_features;
7373
t_features = 0;

engine/src/mblandroiddc.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,26 +256,27 @@ bool MCScreenDC::device_getdisplays(bool p_effective, MCDisplay *& r_displays, u
256256
static MCDisplay s_display;
257257
memset(&s_display, 0, sizeof(MCDisplay));
258258

259-
char *t_rect_string = nil;
259+
MCAutoStringRef t_rect_string;
260260
int2 t_left, t_top, t_right, t_bottom;
261261

262262
// The workarea is the rect of the screen
263263
// not covered by any OS furniture, the viewport the whole area of the sreen.
264264

265265
// IM-2013-11-15: [[ Bug 10485 ]] Use appropriate java method to get (effective) working screenrect
266266
if (p_effective)
267-
MCAndroidEngineCall("getEffectiveWorkareaAsString", "s", &t_rect_string);
267+
MCAndroidEngineCall("getEffectiveWorkareaAsString", "x", &(&t_rect_string));
268268
else
269-
MCAndroidEngineCall("getWorkareaAsString", "s", &t_rect_string);
270-
MCU_stoi2x4(t_rect_string, t_left, t_top, t_right, t_bottom);
269+
MCAndroidEngineCall("getWorkareaAsString", "x", &(&t_rect_string));
270+
MCU_stoi2x4(*t_rect_string, t_left, t_top, t_right, t_bottom);
271271

272272
s_display.device_workarea.x = t_left;
273273
s_display.device_workarea.y = t_top;
274274
s_display.device_workarea.width = t_right - t_left;
275275
s_display.device_workarea.height = t_bottom - t_top;
276276

277-
MCAndroidEngineCall("getViewportAsString", "s", &t_rect_string);
278-
MCU_stoi2x4(t_rect_string, t_left, t_top, t_right, t_bottom);
277+
MCAutoStringRef t_viewport_string;
278+
MCAndroidEngineCall("getViewportAsString", "x", &(&t_viewport_string));
279+
MCU_stoi2x4(*t_viewport_string, t_left, t_top, t_right, t_bottom);
279280

280281
s_display.device_viewport.x = t_left;
281282
s_display.device_viewport.y = t_top;

engine/src/mblandroiddialog.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ bool MCScreenDC::popupaskdialog(uint32_t p_type, MCStringRef p_title, MCStringRe
120120
{
121121
r_result = s_popup_dialog_text;
122122
s_popup_dialog_text = nil;
123-
}
124-
return true;
123+
return true;
124+
}
125+
return false;
125126
}
126127

127128
extern "C" JNIEXPORT void JNICALL Java_com_runrev_android_Engine_doAskDialogDone(JNIEnv *env, jobject object, jstring result) __attribute__((visibility("default")));

engine/src/mblandroidmisc.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -794,17 +794,15 @@ bool MCSystemExportImageToAlbum(MCStringRef& r_save_result, MCDataRef p_raw_data
794794

795795
bool MCS_getnetworkinterfaces(MCStringRef& r_interfaces)
796796
{
797-
char *t_network_interfaces = NULL;
798-
799-
MCAndroidEngineCall("getNetworkInterfaces", "s", &t_network_interfaces);
797+
MCAutoStringRef t_interfaces;
798+
MCAndroidEngineCall("getNetworkInterfaces", "x", &(&t_interfaces));
800799

801-
if (t_network_interfaces == NULL)
802-
{
800+
if (*t_interfaces == nil)
803801
r_interfaces = MCValueRetain(kMCEmptyString);
804-
return true;
805-
}
806802
else
807-
return MCStringCreateWithCString(t_network_interfaces, r_interfaces);
803+
r_interfaces = MCValueRetain(*t_interfaces);
804+
805+
return true;
808806
}
809807

810808
////////////////////////////////////////////////////////////////////////////////

engine/src/mblandroidsound.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,19 @@ bool MCSystemSoundChannelStatus(MCStringRef p_channel, intenum_t& r_status)
198198

199199
bool MCSystemSoundOnChannel(MCStringRef p_channel, MCStringRef &r_sound)
200200
{
201-
MCAndroidEngineRemoteCall("getSoundOnChannel", "xx", r_sound, p_channel);
201+
MCAndroidEngineRemoteCall("getSoundOnChannel", "xx", &r_sound, p_channel);
202202
return true;
203203
}
204204

205205
bool MCSystemNextSoundOnChannel(MCStringRef p_channel, MCStringRef &r_sound)
206206
{
207-
MCAndroidEngineRemoteCall("getNextSoundOnChannel", "xx", r_sound, p_channel);
207+
MCAndroidEngineRemoteCall("getNextSoundOnChannel", "xx", &r_sound, p_channel);
208208
return true;
209209
}
210210

211211
bool MCSystemListSoundChannels(MCStringRef &r_channels)
212212
{
213-
MCAndroidEngineRemoteCall("getSoundChannels", "x", r_channels);
213+
MCAndroidEngineRemoteCall("getSoundChannels", "x", &r_channels);
214214
return true;
215215
}
216216

0 commit comments

Comments
 (0)