@@ -197,11 +197,18 @@ procedure TThreadSortForm.ThreadDone(Sender: TObject);
197197
198198function TThreadSortForm.SortModule_GetValue ( pself, args : PPyObject ) : PPyObject; cdecl;
199199var
200- psort, index: Integer;
200+ psort: NativeInt;
201+ index: Integer;
201202begin
202203 with GetPythonEngine do
203204 begin
204- if (PyErr_Occurred() = nil ) and (PyArg_ParseTuple( args, ' ii' ,@psort, @index) <> 0 ) then
205+ if (PyErr_Occurred() = nil ) and
206+ { $IFDEF CPU64BITS}
207+ (PyArg_ParseTuple( args, ' Li' ,@psort, @index) <> 0 )
208+ { $ELSE}
209+ (PyArg_ParseTuple( args, ' ii' ,@psort, @index) <> 0 )
210+ { $ENDIF}
211+ then
205212 begin
206213 Result := PyLong_FromLong(TSortThread(psort)[index]);
207214 end else
@@ -211,11 +218,18 @@ function TThreadSortForm.SortModule_GetValue( pself, args : PPyObject ) : PPyObj
211218
212219function TThreadSortForm.SortModule_Swap ( pself, args : PPyObject ) : PPyObject; cdecl;
213220var
214- psort, i, j: Integer;
221+ psort: NativeInt;
222+ i, j: Integer;
215223begin
216224 with GetPythonEngine do
217225 begin
218- if (PyErr_Occurred() = nil ) and (PyArg_ParseTuple( args, ' iii' ,@psort, @i, @j) <> 0 ) then
226+ if (PyErr_Occurred() = nil ) and
227+ { $IFDEF CPU64BITS}
228+ (PyArg_ParseTuple( args, ' Lii' ,@psort, @i, @j) <> 0 )
229+ { $ELSE}
230+ (PyArg_ParseTuple( args, ' iii' ,@psort, @i, @j) <> 0 )
231+ { $ENDIF}
232+ then
219233 begin
220234 TSortThread(psort).VisualSwap(i,j);
221235 Result := ReturnNone;
0 commit comments