Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
ef219a03
Commit
ef219a03
authored
Aug 07, 2000
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added U64 which always returns a long.
Added some comments.
parent
06dabfac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/ZODB/utils.py
src/ZODB/utils.py
+9
-0
No files found.
src/ZODB/utils.py
View file @
ef219a03
...
...
@@ -88,6 +88,7 @@ import TimeStamp, time, struct
t32
=
1L
<<
32
def
p64
(
v
,
pack
=
struct
.
pack
):
"""Pack an integer or long into a 8-byte string"""
if
v
<
t32
:
h
=
0
else
:
h
=
v
/
t32
...
...
@@ -95,6 +96,7 @@ def p64(v, pack=struct.pack):
return
pack
(
">II"
,
h
,
v
)
def
u64
(
v
,
unpack
=
struct
.
unpack
):
"""Unpack an 8-byte string into a 64-bit (or long) integer"""
h
,
v
=
unpack
(
">ii"
,
v
)
if
v
<
0
:
v
=
t32
+
v
if
h
:
...
...
@@ -102,6 +104,13 @@ def u64(v, unpack=struct.unpack):
v
=
h
*
t32
+
v
return
v
def
U64
(
v
,
unpack
=
struct
.
unpack
):
"""Same as u64 but always returns a long."""
h
,
v
=
unpack
(
">II"
,
v
)
if
h
:
v
=
h
*
t32
+
v
return
v
def
cp
(
f1
,
f2
,
l
):
read
=
f1
.
read
write
=
f2
.
write
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment