Skip to content

Commit

Permalink
ensure we don't clip 64-bit cython values
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 25, 2025
1 parent 3e25ef4 commit 35dc292
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion xpra/platform/darwin/gdk3_bindings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cdef NSView *get_nsview(pywindow):
cdef NSView *nsview = gdk_quartz_window_get_nsview(gdkwindow)
return nsview

def get_nsview_ptr(pywindow) -> int:
def get_nsview_ptr(pywindow) -> long:
cdef NSView *nsview = get_nsview(pywindow)
return <uintptr_t> nsview

Expand Down
2 changes: 1 addition & 1 deletion xpra/platform/posix/proc_libproc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ cdef extern from "libproc2/pids.h":
int procps_pids_unref(pids_info **info)
pids_fetch *procps_pids_select(pids_info *info, unsigned*pids, int pidcount, int select_type)

def get_parent_pid(unsigned int pid) -> int:
def get_parent_pid(unsigned int pid) -> long:
cdef pids_info *handle = NULL
cdef pids_item selector = PIDS_ID_PPID
if procps_pids_new(&handle, &selector, 1) != 0:
Expand Down
2 changes: 1 addition & 1 deletion xpra/platform/posix/proc_procps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cdef extern from "proc/readproc.h":
proc_t* readproc(PROCTAB *PT, proc_t *p)
void closeproc(PROCTAB* PT)

def get_parent_pid(int pid) -> int:
def get_parent_pid(int pid) -> long:
cdef proc_t proc_info
memset(&proc_info, 0, sizeof(proc_t))
cdef PROCTAB *pt_ptr = openproc(PROC_FILLSTATUS | PROC_PID, &pid)
Expand Down
2 changes: 1 addition & 1 deletion xpra/x11/bindings/display_source.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cdef Display* get_display() noexcept:
return display


def get_display_ptr() -> int:
def get_display_ptr() -> long:
return int(<uintptr_t> display)


Expand Down
2 changes: 1 addition & 1 deletion xpra/x11/bindings/res.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ cdef class ResBindingsInstance(X11CoreBindingsInstance):
log("found XRes extension version %i.%i", cmajor, cminor)
return (cmajor, cminor) >= min_version

def get_pid(self, Window xid) -> int:
def get_pid(self, Window xid) -> long:
self.context_check("get_pid")
return get_pid(self.display, xid)

0 comments on commit 35dc292

Please sign in to comment.