Skip to content

Commit 2aba7fb

Browse files
committed
[[ Bug 14422 ]] Cleanup a few stylistic things.
1 parent 2c6593e commit 2aba7fb

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

engine/src/deploy.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ static bool MCDeployMapArchitectureString(const MCString& p_string, MCDeployArch
120120

121121
static Exec_stat MCDeployPushMinOSVersion(MCDeployParameters& p_params, MCDeployArchitecture p_arch, const char *p_vers_string)
122122
{
123+
// Use sscanf to parse out the version string. We don't check the return value of
124+
// sscanf as we don't care - any malformed / missing components will come out as
125+
// 0.
123126
int t_major, t_minor, t_inc;
124127
t_major = t_minor = t_inc = 0;
125128
sscanf(p_vers_string, "%d.%d.%d", &t_major, &t_minor, &t_inc);

engine/src/deploy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct MCDeployParameters
5656
// When building for Mac/iOS, you can specify a min os version per arch
5757
// slice.
5858
MCDeployMinOSVersion *min_os_versions;
59-
uint32_t min_os_version_count;
59+
uindex_t min_os_version_count;
6060

6161
// The root stackfile to be included in the standalone.
6262
char *stackfile;

engine/src/deploy_macosx.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,8 @@ static bool MCDeployToMacOSXFetchMinOSVersion(const MCDeployParameters& p_params
11551155
t_arch = kMCDeployArchitecture_PPC;
11561156
else if (p_header . cputype == CPU_TYPE_POWERPC64)
11571157
t_arch = kMCDeployArchitecture_PPC64;
1158+
else
1159+
t_arch = kMCDeployArchitecture_Unknown;
11581160

11591161
// Search for both the architecture in the mach header and for the 'unknown'
11601162
// architecture. If the real arch is found, then we use that version; otherwise
@@ -1165,16 +1167,16 @@ static bool MCDeployToMacOSXFetchMinOSVersion(const MCDeployParameters& p_params
11651167
t_found_index = -1;
11661168
for(uindex_t i = 0; i < p_params . min_os_version_count; i++)
11671169
if (p_params . min_os_versions[i] . architecture == t_arch &&
1168-
t_found_index == -1)
1170+
t_found_index < 0)
11691171
t_found_index = (signed)i;
11701172
else if (p_params . min_os_versions[i] . architecture == kMCDeployArchitecture_Unknown &&
1171-
t_unknown_index == -1)
1173+
t_unknown_index < 0)
11721174
t_unknown_index = -1;
11731175

1174-
if (t_found_index == -1 && t_unknown_index == -1)
1176+
if (t_found_index < 0 && t_unknown_index < 0)
11751177
return false;
11761178

1177-
if (t_found_index == -1)
1179+
if (t_found_index >= 0)
11781180
{
11791181
r_version = p_params . min_os_versions[t_unknown_index] . version;
11801182
return true;

0 commit comments

Comments
 (0)