[pypy-commit] pypy win64-stage1: merge with default
ctismer
noreply at buildbot.pypy.org
Sun Dec 4 18:37:27 CET 2011
Author: Christian Tismer <tismer at stackless.com>
Branch: win64-stage1
Changeset: r50136:2426fc9271a4
Date: 2011-12-04 18:14 +0100
http://bitbucket.org/pypy/pypy/changeset/2426fc9271a4/
Log: merge with default
diff --git a/pypy/module/_multiprocessing/interp_connection.py b/pypy/module/_multiprocessing/interp_connection.py
--- a/pypy/module/_multiprocessing/interp_connection.py
+++ b/pypy/module/_multiprocessing/interp_connection.py
@@ -100,7 +100,6 @@
res, newbuf = self.do_recv_string(
space, self.BUFFER_SIZE, maxlength)
- res = intmask(res) # XXX why?
try:
if newbuf:
return space.wrap(rffi.charpsize2str(newbuf, res))
@@ -117,7 +116,6 @@
res, newbuf = self.do_recv_string(
space, length - offset, PY_SSIZE_T_MAX)
- res = intmask(res) # XXX why?
try:
if newbuf:
raise BufferTooShort(space, space.wrap(
@@ -148,7 +146,6 @@
res, newbuf = self.do_recv_string(
space, self.BUFFER_SIZE, PY_SSIZE_T_MAX)
- res = intmask(res) # XXX why?
try:
if newbuf:
w_received = space.wrap(rffi.charpsize2str(newbuf, res))
@@ -413,7 +410,7 @@
self.buffer, min(self.BUFFER_SIZE, buflength),
read_ptr, rffi.NULL)
if result:
- return read_ptr[0], lltype.nullptr(rffi.CCHARP.TO)
+ return intmask(read_ptr[0]), lltype.nullptr(rffi.CCHARP.TO)
err = rwin32.GetLastError()
if err == ERROR_BROKEN_PIPE:
diff --git a/pypy/rpython/module/ll_os_stat.py b/pypy/rpython/module/ll_os_stat.py
--- a/pypy/rpython/module/ll_os_stat.py
+++ b/pypy/rpython/module/ll_os_stat.py
@@ -12,6 +12,7 @@
from pypy.rpython.tool import rffi_platform as platform
from pypy.rpython.lltypesystem.rtupletype import TUPLE_TYPE
from pypy.rlib import rposix
+from pypy.rlib.rarithmetic import intmask
from pypy.rlib.objectmodel import specialize
from pypy.translator.tool.cbuild import ExternalCompilationInfo
from pypy.rpython.annlowlevel import hlstr
@@ -319,7 +320,6 @@
assert len(STAT_FIELDS) == 10 # no extra fields on Windows
def attributes_to_mode(attributes):
- attributes = lltype.r_uint(attributes)
m = 0
if attributes & win32traits.FILE_ATTRIBUTE_DIRECTORY:
m |= win32traits._S_IFDIR | 0111 # IFEXEC for user,group,other
@@ -443,20 +443,19 @@
# Helper functions for win32
def make_longlong(high, low):
- return (lltype.r_longlong(high) << 32) + lltype.r_longlong(low)
+ return (rffi.r_longlong(high) << 32) + rffi.r_longlong(low)
# Seconds between 1.1.1601 and 1.1.1970
-secs_between_epochs = lltype.r_longlong(11644473600)
+secs_between_epochs = rffi.r_longlong(11644473600)
def FILE_TIME_to_time_t_nsec(filetime):
ft = make_longlong(filetime.c_dwHighDateTime, filetime.c_dwLowDateTime)
# FILETIME is in units of 100 nsec
nsec = (ft % 10000000) * 100
time = (ft / 10000000) - secs_between_epochs
- return time, nsec
+ return intmask(time), intmask(nsec)
def time_t_to_FILE_TIME(time, filetime):
- ft = lltype.r_longlong((time + secs_between_epochs) * 10000000)
- filetime.c_dwHighDateTime = lltype.r_uint32(ft >> 32)
- filetime.c_dwLowDateTime = lltype.r_uint32(ft & lltype.r_uint(-1))
-
+ ft = (rffi.r_longlong(time) + secs_between_epochs) * 10000000
+ filetime.c_dwHighDateTime = rffi.r_uint(ft >> 32)
+ filetime.c_dwLowDateTime = rffi.r_uint(ft) # masking off high bits
More information about the pypy-commit
mailing list