Skip to content

Commit 5ec88e8

Browse files
committed
Fix pointer casting warnings
1 parent 604fa0e commit 5ec88e8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

av/sidedata/motionvectors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import cython
22
from cython.cimports import libav as lib
33
from cython.cimports.av.sidedata.sidedata import SideData
4+
from cython.cimports.libc.stdint import uintptr_t
45

56
_cinit_bypass_sentinel = cython.declare(object, object())
67

@@ -15,7 +16,7 @@ def __init__(self, sentinel, frame: Frame, index: cython.int):
1516
def __repr__(self):
1617
return (
1718
f"<av.sidedata.MotionVectors {self.ptr.size} bytes "
18-
f"of {len(self)} vectors at 0x{cython.cast(cython.uint, self.ptr.data):0x}>"
19+
f"of {len(self)} vectors at 0x{cython.cast(uintptr_t, self.ptr.data):0x}>"
1920
)
2021

2122
def __len__(self):

av/sidedata/sidedata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from enum import Enum
33

44
import cython
5-
from cython.cimports.libc.stdint import int32_t
5+
from cython.cimports.libc.stdint import int32_t, uintptr_t
66

77
from av.sidedata.encparams import VideoEncParams
88
from av.sidedata.motionvectors import MotionVectors
@@ -95,7 +95,7 @@ def _buffer_writable(self) -> cython.bint:
9595
return False
9696

9797
def __repr__(self):
98-
return f"<av.sidedata.{self.__class__.__name__} {self.ptr.size} bytes of {self.type} at 0x{cython.cast(cython.uint, self.ptr.data):0x}>"
98+
return f"<av.sidedata.{self.__class__.__name__} {self.ptr.size} bytes of {self.type} at 0x{cython.cast(uintptr_t, self.ptr.data):0x}>"
9999

100100
@property
101101
def type(self):

0 commit comments

Comments
 (0)