aboutsummaryrefslogtreecommitdiff
path: root/C/MtDec.c
diff options
context:
space:
mode:
Diffstat (limited to 'C/MtDec.c')
-rw-r--r--C/MtDec.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/C/MtDec.c b/C/MtDec.c
index 7820699..96274b6 100644
--- a/C/MtDec.c
+++ b/C/MtDec.c
@@ -1,5 +1,5 @@
1/* MtDec.c -- Multi-thread Decoder 1/* MtDec.c -- Multi-thread Decoder
22023-04-02 : Igor Pavlov : Public domain */ 22024-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
812typedef
813 #ifdef _WIN32
814 UINT_PTR
815 #elif 1
816 uintptr_t
817 #else
818 ptrdiff_t
819 #endif
820 MY_uintptr_t;
821
812static THREAD_FUNC_DECL MtDec_ThreadFunc1(void *pp) 822static 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
838static Z7_NO_INLINE THREAD_FUNC_DECL MtDec_ThreadFunc(void *pp) 848static 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;