aboutsummaryrefslogtreecommitdiff
path: root/project/src/lib-szs-create.c
diff options
context:
space:
mode:
authorWiimm <none>2020-09-30 13:20:16 +0200
committerWiimm <none>2020-09-30 13:20:16 +0200
commit646b95d113309378591b75a290ee6c62a04f3772 (patch)
treea94864e8cef5fc0fbffb7e69d46d688e7caaae3d /project/src/lib-szs-create.c
parenteaf1f8f8ce68b80ebdcefb45896461a89b47e1e1 (diff)
SZS v2.20a.beta1: Test Mac build
Diffstat (limited to '')
-rw-r--r--project/src/lib-szs-create.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/project/src/lib-szs-create.c b/project/src/lib-szs-create.c
index 36d8516..1907542 100644
--- a/project/src/lib-szs-create.c
+++ b/project/src/lib-szs-create.c
@@ -808,16 +808,12 @@ enumError CreateSZS
{
StringCopyE( sd.path_rel, sd.path+sizeof(sd.path), *ptr );
struct stat st;
+ #if USE_NEW_FILEATTRIB
+ if ( stat(sd.path,&st) || CompareTimeSpec(&st.st_mtim,&szs.fatt.mtime) < 0 )
+ #else
const time_t mtime = stat(sd.path,&st) ? 0 : st.st_mtime;
-#if 0
- BINGO;
- printf("mtime: %u - %u = %d [%s>%s>] size=%zu,%zu\n",
- (uint)mtime, (uint)szs.fatt.mtime, (int)(mtime-szs.fatt.mtime),
- GetNameFF(setup_param2.fform_file,setup_param2.fform_arch),
- GetNameFF(szs.fform_file,szs.fform_arch),
- szs.size, szs.csize );
-#endif
if ( mtime < szs.fatt.mtime )
+ #endif
{
const bool is_compressed = IsCompressedFF(setup_param2.fform_file);
if (is_compressed)
@@ -1007,7 +1003,8 @@ enumError LoadCreateSZS
}
enumError err = LoadSZS(szs,fname,decompress,ignore_no_file,mark_readonly);
- PatchSZS(szs);
+ if ( err <= ERR_WARNING )
+ PatchSZS(szs);
return err;
}
@@ -3643,6 +3640,10 @@ static int check_brres
print_check_error( chk, CMOD_HINT,
"Unusual %s version %d: %s\n",
GetNameFF(0,fform), version, it->path );
+ else if ( bi->warn >= BIMD_INFO )
+ print_check_error( chk, CMOD_INFO,
+ "Unusual %s version %d: %s\n",
+ GetNameFF(0,fform), version, it->path );
}
return 0;
}
@@ -3710,6 +3711,18 @@ static void set_required_slot
///////////////////////////////////////////////////////////////////////////////
+static void dump_slots ( int stat, int *slot, ccp info )
+{
+ printf(">> stat=%d:",stat);
+ uint i;
+ for ( i = 0; i < 32; i++ )
+ printf("%s%c", i&3 ? "" : " ",
+ slot[i] < 0 ? '-' : slot[i] > 0 ? '+' : '.' );
+ printf(" : %s\n",info);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
int FindSlotsSZS
(
// returns -1, 0 or +1
@@ -3792,7 +3805,6 @@ int FindSlotsSZS
*required_slot = 31;
}
-
//--- analyze slot 4.2
if ( !szs->slot_42 || szs->moonview_mdl_stat < 2 )
@@ -3818,6 +3830,7 @@ int FindSlotsSZS
else if ( !SLOT(6,1) && szs->have_ice_brres )
SLOT(6,1) = 1;
+
//--- analyze slot 6.2
if (szs->slot_62)
@@ -3835,6 +3848,8 @@ int FindSlotsSZS
if (!SLOT(6,1)) SLOT(6,1) = -1;
if (!SLOT(6,2)) SLOT(6,2) = -1;
+
+ //dump_slots(stat,slot,"END");
return stat;
}
@@ -3860,10 +3875,12 @@ void AnalyzeSlot ( slot_ana_t *sa, szs_file_t *szs )
static char buf[500];
char *dest = buf;
- uint i;
+ uint i, allow = 0;
for ( i = 0; i < MKW_N_TRACKS; i++ )
{
const int slot = sa->slot[i];
+ if ( slot >= 0 )
+ allow++;
if ( slot != sa->stat )
{
if ( dest > buf )
@@ -3874,6 +3891,9 @@ void AnalyzeSlot ( slot_ana_t *sa, szs_file_t *szs )
}
}
+ if (!allow)
+ dest = StringCopyS(buf,sizeof(buf),"none");
+
if ( dest == buf )
*dest++ = '%';
*dest = 0;