Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c48b0e66
Commit
c48b0e66
authored
Jun 09, 2006
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix inconsistency in naming within an enum.
parent
0873b11f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
Objects/bufferobject.c
Objects/bufferobject.c
+12
-12
No files found.
Objects/bufferobject.c
View file @
c48b0e66
...
...
@@ -16,9 +16,9 @@ typedef struct {
enum
buffer_t
{
READBUFFER
,
WRITEBUFFER
,
CHARBUFFER
,
READ
_
BUFFER
,
WRITE
_
BUFFER
,
CHAR
_
BUFFER
,
ANY_BUFFER
,
};
...
...
@@ -40,13 +40,13 @@ get_buf(PyBufferObject *self, void **ptr, Py_ssize_t *size,
"single-segment buffer object expected"
);
return
0
;
}
if
((
buffer_type
==
READBUFFER
)
||
if
((
buffer_type
==
READ
_
BUFFER
)
||
((
buffer_type
==
ANY_BUFFER
)
&&
self
->
b_readonly
))
proc
=
bp
->
bf_getreadbuffer
;
else
if
((
buffer_type
==
WRITEBUFFER
)
||
else
if
((
buffer_type
==
WRITE
_
BUFFER
)
||
(
buffer_type
==
ANY_BUFFER
))
proc
=
(
readbufferproc
)
bp
->
bf_getwritebuffer
;
else
if
(
buffer_type
==
CHARBUFFER
)
{
else
if
(
buffer_type
==
CHAR
_
BUFFER
)
{
if
(
!
PyType_HasFeature
(
self
->
ob_type
,
Py_TPFLAGS_HAVE_GETCHARBUFFER
))
{
PyErr_SetString
(
PyExc_TypeError
,
...
...
@@ -58,13 +58,13 @@ get_buf(PyBufferObject *self, void **ptr, Py_ssize_t *size,
if
(
!
proc
)
{
char
*
buffer_type_name
;
switch
(
buffer_type
)
{
case
READBUFFER
:
case
READ
_
BUFFER
:
buffer_type_name
=
"read"
;
break
;
case
WRITEBUFFER
:
case
WRITE
_
BUFFER
:
buffer_type_name
=
"write"
;
break
;
case
CHARBUFFER
:
case
CHAR
_
BUFFER
:
buffer_type_name
=
"char"
;
break
;
default:
...
...
@@ -592,7 +592,7 @@ buffer_getreadbuf(PyBufferObject *self, Py_ssize_t idx, void **pp)
"accessing non-existent buffer segment"
);
return
-
1
;
}
if
(
!
get_buf
(
self
,
pp
,
&
size
,
READBUFFER
))
if
(
!
get_buf
(
self
,
pp
,
&
size
,
READ
_
BUFFER
))
return
-
1
;
return
size
;
}
...
...
@@ -613,7 +613,7 @@ buffer_getwritebuf(PyBufferObject *self, Py_ssize_t idx, void **pp)
"accessing non-existent buffer segment"
);
return
-
1
;
}
if
(
!
get_buf
(
self
,
pp
,
&
size
,
WRITEBUFFER
))
if
(
!
get_buf
(
self
,
pp
,
&
size
,
WRITE
_
BUFFER
))
return
-
1
;
return
size
;
}
...
...
@@ -640,7 +640,7 @@ buffer_getcharbuf(PyBufferObject *self, Py_ssize_t idx, const char **pp)
"accessing non-existent buffer segment"
);
return
-
1
;
}
if
(
!
get_buf
(
self
,
&
ptr
,
&
size
,
CHARBUFFER
))
if
(
!
get_buf
(
self
,
&
ptr
,
&
size
,
CHAR
_
BUFFER
))
return
-
1
;
*
pp
=
(
const
char
*
)
ptr
;
return
size
;
...
...
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