diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-14 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-15 23:55:04 +0500 |
commit | fc662341e6f85da78ada0e443f6116b978f79f22 (patch) | |
tree | 1be1cc402a7a9cbc18d4eeea6b141354c2d559e3 /C/MtDec.c | |
parent | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (diff) | |
download | 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.gz 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.bz2 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.zip |
24.0524.05
Diffstat (limited to 'C/MtDec.c')
-rw-r--r-- | C/MtDec.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* MtDec.c -- Multi-thread Decoder | 1 | /* MtDec.c -- Multi-thread Decoder |
2 | 2023-04-02 : Igor Pavlov : Public domain */ | 2 | 2024-02-20 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
5 | 5 | ||
@@ -809,6 +809,16 @@ static WRes MtDec_ThreadFunc2(CMtDecThread *t) | |||
809 | #endif | 809 | #endif |
810 | 810 | ||
811 | 811 | ||
812 | typedef | ||
813 | #ifdef _WIN32 | ||
814 | UINT_PTR | ||
815 | #elif 1 | ||
816 | uintptr_t | ||
817 | #else | ||
818 | ptrdiff_t | ||
819 | #endif | ||
820 | MY_uintptr_t; | ||
821 | |||
812 | static THREAD_FUNC_DECL MtDec_ThreadFunc1(void *pp) | 822 | static THREAD_FUNC_DECL MtDec_ThreadFunc1(void *pp) |
813 | { | 823 | { |
814 | WRes res; | 824 | WRes res; |
@@ -821,7 +831,7 @@ static THREAD_FUNC_DECL MtDec_ThreadFunc1(void *pp) | |||
821 | res = MtDec_ThreadFunc2(t); | 831 | res = MtDec_ThreadFunc2(t); |
822 | p = t->mtDec; | 832 | p = t->mtDec; |
823 | if (res == 0) | 833 | if (res == 0) |
824 | return (THREAD_FUNC_RET_TYPE)(UINT_PTR)p->exitThreadWRes; | 834 | return (THREAD_FUNC_RET_TYPE)(MY_uintptr_t)p->exitThreadWRes; |
825 | { | 835 | { |
826 | // it's unexpected situation for some threading function error | 836 | // it's unexpected situation for some threading function error |
827 | if (p->exitThreadWRes == 0) | 837 | if (p->exitThreadWRes == 0) |
@@ -832,7 +842,7 @@ static THREAD_FUNC_DECL MtDec_ThreadFunc1(void *pp) | |||
832 | Event_Set(&p->threads[0].canWrite); | 842 | Event_Set(&p->threads[0].canWrite); |
833 | MtProgress_SetError(&p->mtProgress, MY_SRes_HRESULT_FROM_WRes(res)); | 843 | MtProgress_SetError(&p->mtProgress, MY_SRes_HRESULT_FROM_WRes(res)); |
834 | } | 844 | } |
835 | return (THREAD_FUNC_RET_TYPE)(UINT_PTR)res; | 845 | return (THREAD_FUNC_RET_TYPE)(MY_uintptr_t)res; |
836 | } | 846 | } |
837 | 847 | ||
838 | static Z7_NO_INLINE THREAD_FUNC_DECL MtDec_ThreadFunc(void *pp) | 848 | static Z7_NO_INLINE THREAD_FUNC_DECL MtDec_ThreadFunc(void *pp) |
@@ -1072,7 +1082,7 @@ SRes MtDec_Code(CMtDec *p) | |||
1072 | if (wres == 0) { wres = Event_Set(&nextThread->canWrite); | 1082 | if (wres == 0) { wres = Event_Set(&nextThread->canWrite); |
1073 | if (wres == 0) { wres = Event_Set(&nextThread->canRead); | 1083 | if (wres == 0) { wres = Event_Set(&nextThread->canRead); |
1074 | if (wres == 0) { THREAD_FUNC_RET_TYPE res = MtDec_ThreadFunc(nextThread); | 1084 | if (wres == 0) { THREAD_FUNC_RET_TYPE res = MtDec_ThreadFunc(nextThread); |
1075 | wres = (WRes)(UINT_PTR)res; | 1085 | wres = (WRes)(MY_uintptr_t)res; |
1076 | if (wres != 0) | 1086 | if (wres != 0) |
1077 | { | 1087 | { |
1078 | p->needContinue = False; | 1088 | p->needContinue = False; |