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
1770ad58
Commit
1770ad58
authored
Oct 08, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete bufferobject.[ch].
This will undoubtedly require Windows build file changes too.
parent
59254e36
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
762 deletions
+9
-762
Include/Python.h
Include/Python.h
+0
-1
Include/bufferobject.h
Include/bufferobject.h
+0
-33
Makefile.pre.in
Makefile.pre.in
+0
-2
Objects/bufferobject.c
Objects/bufferobject.c
+0
-724
Objects/memoryobject.c
Objects/memoryobject.c
+4
-1
Objects/unicodeobject.c
Objects/unicodeobject.c
+5
-1
No files found.
Include/Python.h
View file @
1770ad58
...
...
@@ -76,7 +76,6 @@
#endif
#include "rangeobject.h"
#include "stringobject.h"
#include "bufferobject.h"
#include "memoryobject.h"
#include "tupleobject.h"
#include "listobject.h"
...
...
Include/bufferobject.h
deleted
100644 → 0
View file @
59254e36
/* Buffer object interface */
/* Note: the object's structure is private */
#ifndef Py_BUFFEROBJECT_H
#define Py_BUFFEROBJECT_H
#ifdef __cplusplus
extern
"C"
{
#endif
PyAPI_DATA
(
PyTypeObject
)
PyBuffer_Type
;
#define PyBuffer_Check(op) (Py_Type(op) == &PyBuffer_Type)
#define Py_END_OF_BUFFER (-1)
PyAPI_FUNC
(
PyObject
*
)
PyBuffer_FromObject
(
PyObject
*
base
,
Py_ssize_t
offset
,
Py_ssize_t
size
);
PyAPI_FUNC
(
PyObject
*
)
PyBuffer_FromReadWriteObject
(
PyObject
*
base
,
Py_ssize_t
offset
,
Py_ssize_t
size
);
PyAPI_FUNC
(
PyObject
*
)
PyBuffer_FromMemory
(
void
*
ptr
,
Py_ssize_t
size
);
PyAPI_FUNC
(
PyObject
*
)
PyBuffer_FromReadWriteMemory
(
void
*
ptr
,
Py_ssize_t
size
);
PyAPI_FUNC
(
PyObject
*
)
PyBuffer_New
(
Py_ssize_t
size
);
#ifdef __cplusplus
}
#endif
#endif
/* !Py_BUFFEROBJECT_H */
Makefile.pre.in
View file @
1770ad58
...
...
@@ -285,7 +285,6 @@ PYTHON_OBJS= \
OBJECT_OBJS
=
\
Objects/abstract.o
\
Objects/boolobject.o
\
Objects/bufferobject.o
\
Objects/bytesobject.o
\
Objects/cellobject.o
\
Objects/classobject.o
\
...
...
@@ -530,7 +529,6 @@ PYTHON_HEADERS= \
Include/asdl.h
\
Include/abstract.h
\
Include/boolobject.h
\
Include/bufferobject.h
\
Include/bytesobject.h
\
Include/ceval.h
\
Include/classobject.h
\
...
...
Objects/bufferobject.c
deleted
100644 → 0
View file @
59254e36
This diff is collapsed.
Click to expand it.
Objects/memoryobject.c
View file @
1770ad58
...
...
@@ -8,6 +8,8 @@ memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags)
{
if
(
view
!=
NULL
)
*
view
=
self
->
view
;
if
(
self
->
base
==
NULL
)
return
0
;
return
self
->
base
->
ob_type
->
tp_as_buffer
->
bf_getbuffer
(
self
->
base
,
NULL
,
PyBUF_FULL
);
}
...
...
@@ -15,7 +17,8 @@ memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags)
static
void
memory_releasebuf
(
PyMemoryViewObject
*
self
,
Py_buffer
*
view
)
{
PyObject_ReleaseBuffer
(
self
->
base
,
NULL
);
if
(
self
->
base
!=
NULL
)
PyObject_ReleaseBuffer
(
self
->
base
,
NULL
);
}
PyDoc_STRVAR
(
memory_doc
,
...
...
Objects/unicodeobject.c
View file @
1770ad58
...
...
@@ -1051,6 +1051,7 @@ PyObject *PyUnicode_Decode(const char *s,
const
char
*
errors
)
{
PyObject
*
buffer
=
NULL
,
*
unicode
;
Py_buffer
info
;
if
(
encoding
==
NULL
)
encoding
=
PyUnicode_GetDefaultEncoding
();
...
...
@@ -1068,7 +1069,10 @@ PyObject *PyUnicode_Decode(const char *s,
return
PyUnicode_DecodeASCII
(
s
,
size
,
errors
);
/* Decode via the codec registry */
buffer
=
PyBuffer_FromMemory
((
void
*
)
s
,
size
);
buffer
=
NULL
;
if
(
PyBuffer_FillInfo
(
&
info
,
(
void
*
)
s
,
size
,
1
,
PyBUF_SIMPLE
)
<
0
)
goto
onError
;
buffer
=
PyMemoryView_FromMemory
(
&
info
);
if
(
buffer
==
NULL
)
goto
onError
;
unicode
=
PyCodec_Decode
(
buffer
,
encoding
,
errors
);
...
...
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