@@ -187,7 +187,7 @@ static PyTypeObject DictRemover_Type = {
187
187
0 , /* tp_as_buffer */
188
188
/* XXX should participate in GC? */
189
189
Py_TPFLAGS_DEFAULT , /* tp_flags */
190
- "deletes a key from a dictionary" , /* tp_doc */
190
+ PyDoc_STR ( "deletes a key from a dictionary" ), /* tp_doc */
191
191
0 , /* tp_traverse */
192
192
0 , /* tp_clear */
193
193
0 , /* tp_richcompare */
@@ -570,8 +570,8 @@ UnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
570
570
return StructUnionType_new (type , args , kwds , 0 );
571
571
}
572
572
573
- static const char from_address_doc [] =
574
- "C.from_address(integer) -> C instance\naccess a C instance at the specified address" ;
573
+ PyDoc_STRVAR ( from_address_doc ,
574
+ "C.from_address(integer) -> C instance\naccess a C instance at the specified address" ) ;
575
575
576
576
static PyObject *
577
577
CDataType_from_address (PyObject * type , PyObject * value )
@@ -588,8 +588,8 @@ CDataType_from_address(PyObject *type, PyObject *value)
588
588
return PyCData_AtAddress (type , buf );
589
589
}
590
590
591
- static const char from_buffer_doc [] =
592
- "C.from_buffer(object, offset=0) -> C instance\ncreate a C instance from a writeable buffer" ;
591
+ PyDoc_STRVAR ( from_buffer_doc ,
592
+ "C.from_buffer(object, offset=0) -> C instance\ncreate a C instance from a writeable buffer" ) ;
593
593
594
594
static int
595
595
KeepRef (CDataObject * target , Py_ssize_t index , PyObject * keep );
@@ -668,8 +668,8 @@ CDataType_from_buffer(PyObject *type, PyObject *args)
668
668
return result ;
669
669
}
670
670
671
- static const char from_buffer_copy_doc [] =
672
- "C.from_buffer_copy(object, offset=0) -> C instance\ncreate a C instance from a readable buffer" ;
671
+ PyDoc_STRVAR ( from_buffer_copy_doc ,
672
+ "C.from_buffer_copy(object, offset=0) -> C instance\ncreate a C instance from a readable buffer" ) ;
673
673
674
674
static PyObject *
675
675
GenericPyCData_new (PyTypeObject * type , PyObject * args , PyObject * kwds );
@@ -719,8 +719,8 @@ CDataType_from_buffer_copy(PyObject *type, PyObject *args)
719
719
return result ;
720
720
}
721
721
722
- static const char in_dll_doc [] =
723
- "C.in_dll(dll, name) -> C instance\naccess a C instance in a dll" ;
722
+ PyDoc_STRVAR ( in_dll_doc ,
723
+ "C.in_dll(dll, name) -> C instance\naccess a C instance in a dll" ) ;
724
724
725
725
static PyObject *
726
726
CDataType_in_dll (PyObject * type , PyObject * args )
@@ -781,8 +781,8 @@ CDataType_in_dll(PyObject *type, PyObject *args)
781
781
return PyCData_AtAddress (type , address );
782
782
}
783
783
784
- static const char from_param_doc [] =
785
- "Convert a Python object into a function call parameter." ;
784
+ PyDoc_STRVAR ( from_param_doc ,
785
+ "Convert a Python object into a function call parameter." ) ;
786
786
787
787
static PyObject *
788
788
CDataType_from_param (PyObject * type , PyObject * value )
@@ -936,7 +936,7 @@ PyTypeObject PyCStructType_Type = {
936
936
PyCStructType_setattro , /* tp_setattro */
937
937
0 , /* tp_as_buffer */
938
938
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC , /* tp_flags */
939
- "metatype for the CData Objects" , /* tp_doc */
939
+ PyDoc_STR ( "metatype for the CData Objects" ), /* tp_doc */
940
940
(traverseproc )CDataType_traverse , /* tp_traverse */
941
941
(inquiry )CDataType_clear , /* tp_clear */
942
942
0 , /* tp_richcompare */
@@ -978,7 +978,7 @@ static PyTypeObject UnionType_Type = {
978
978
UnionType_setattro , /* tp_setattro */
979
979
0 , /* tp_as_buffer */
980
980
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC , /* tp_flags */
981
- "metatype for the CData Objects" , /* tp_doc */
981
+ PyDoc_STR ( "metatype for the CData Objects" ), /* tp_doc */
982
982
(traverseproc )CDataType_traverse , /* tp_traverse */
983
983
(inquiry )CDataType_clear , /* tp_clear */
984
984
0 , /* tp_richcompare */
@@ -1236,7 +1236,7 @@ PyTypeObject PyCPointerType_Type = {
1236
1236
0 , /* tp_setattro */
1237
1237
0 , /* tp_as_buffer */
1238
1238
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC , /* tp_flags */
1239
- "metatype for the Pointer Objects" , /* tp_doc */
1239
+ PyDoc_STR ( "metatype for the Pointer Objects" ), /* tp_doc */
1240
1240
(traverseproc )CDataType_traverse , /* tp_traverse */
1241
1241
(inquiry )CDataType_clear , /* tp_clear */
1242
1242
0 , /* tp_richcompare */
@@ -1648,7 +1648,7 @@ PyTypeObject PyCArrayType_Type = {
1648
1648
0 , /* tp_setattro */
1649
1649
0 , /* tp_as_buffer */
1650
1650
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
1651
- "metatype for the Array Objects" , /* tp_doc */
1651
+ PyDoc_STR ( "metatype for the Array Objects" ), /* tp_doc */
1652
1652
0 , /* tp_traverse */
1653
1653
0 , /* tp_clear */
1654
1654
0 , /* tp_richcompare */
@@ -2342,7 +2342,7 @@ PyTypeObject PyCSimpleType_Type = {
2342
2342
0 , /* tp_setattro */
2343
2343
0 , /* tp_as_buffer */
2344
2344
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
2345
- "metatype for the PyCSimpleType Objects" , /* tp_doc */
2345
+ PyDoc_STR ( "metatype for the PyCSimpleType Objects" ), /* tp_doc */
2346
2346
0 , /* tp_traverse */
2347
2347
0 , /* tp_clear */
2348
2348
0 , /* tp_richcompare */
@@ -2624,7 +2624,7 @@ PyTypeObject PyCFuncPtrType_Type = {
2624
2624
0 , /* tp_setattro */
2625
2625
0 , /* tp_as_buffer */
2626
2626
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC , /* tp_flags */
2627
- "metatype for C function pointers" , /* tp_doc */
2627
+ PyDoc_STR ( "metatype for C function pointers" ), /* tp_doc */
2628
2628
(traverseproc )CDataType_traverse , /* tp_traverse */
2629
2629
(inquiry )CDataType_clear , /* tp_clear */
2630
2630
0 , /* tp_richcompare */
@@ -2929,7 +2929,7 @@ PyTypeObject PyCData_Type = {
2929
2929
0 , /* tp_setattro */
2930
2930
& PyCData_as_buffer , /* tp_as_buffer */
2931
2931
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
2932
- "XXX to be provided" , /* tp_doc */
2932
+ PyDoc_STR ( "XXX to be provided" ), /* tp_doc */
2933
2933
(traverseproc )PyCData_traverse , /* tp_traverse */
2934
2934
(inquiry )PyCData_clear , /* tp_clear */
2935
2935
0 , /* tp_richcompare */
@@ -4327,7 +4327,7 @@ PyTypeObject PyCFuncPtr_Type = {
4327
4327
0 , /* tp_setattro */
4328
4328
& PyCData_as_buffer , /* tp_as_buffer */
4329
4329
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
4330
- "Function Pointer" , /* tp_doc */
4330
+ PyDoc_STR ( "Function Pointer" ), /* tp_doc */
4331
4331
(traverseproc )PyCFuncPtr_traverse , /* tp_traverse */
4332
4332
(inquiry )PyCFuncPtr_clear , /* tp_clear */
4333
4333
0 , /* tp_richcompare */
@@ -4479,7 +4479,7 @@ static PyTypeObject Struct_Type = {
4479
4479
0 , /* tp_setattro */
4480
4480
& PyCData_as_buffer , /* tp_as_buffer */
4481
4481
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
4482
- "Structure base class" , /* tp_doc */
4482
+ PyDoc_STR ( "Structure base class" ), /* tp_doc */
4483
4483
(traverseproc )PyCData_traverse , /* tp_traverse */
4484
4484
(inquiry )PyCData_clear , /* tp_clear */
4485
4485
0 , /* tp_richcompare */
@@ -4521,7 +4521,7 @@ static PyTypeObject Union_Type = {
4521
4521
0 , /* tp_setattro */
4522
4522
& PyCData_as_buffer , /* tp_as_buffer */
4523
4523
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
4524
- "Union base class" , /* tp_doc */
4524
+ PyDoc_STR ( "Union base class" ), /* tp_doc */
4525
4525
(traverseproc )PyCData_traverse , /* tp_traverse */
4526
4526
(inquiry )PyCData_clear , /* tp_clear */
4527
4527
0 , /* tp_richcompare */
@@ -4841,7 +4841,7 @@ PyTypeObject PyCArray_Type = {
4841
4841
0 , /* tp_setattro */
4842
4842
& PyCData_as_buffer , /* tp_as_buffer */
4843
4843
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
4844
- "XXX to be provided" , /* tp_doc */
4844
+ PyDoc_STR ( "XXX to be provided" ), /* tp_doc */
4845
4845
(traverseproc )PyCData_traverse , /* tp_traverse */
4846
4846
(inquiry )PyCData_clear , /* tp_clear */
4847
4847
0 , /* tp_richcompare */
@@ -5060,7 +5060,7 @@ static PyTypeObject Simple_Type = {
5060
5060
0 , /* tp_setattro */
5061
5061
& PyCData_as_buffer , /* tp_as_buffer */
5062
5062
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
5063
- "XXX to be provided" , /* tp_doc */
5063
+ PyDoc_STR ( "XXX to be provided" ), /* tp_doc */
5064
5064
(traverseproc )PyCData_traverse , /* tp_traverse */
5065
5065
(inquiry )PyCData_clear , /* tp_clear */
5066
5066
0 , /* tp_richcompare */
@@ -5442,7 +5442,7 @@ PyTypeObject PyCPointer_Type = {
5442
5442
0 , /* tp_setattro */
5443
5443
& PyCData_as_buffer , /* tp_as_buffer */
5444
5444
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
5445
- "XXX to be provided" , /* tp_doc */
5445
+ PyDoc_STR ( "XXX to be provided" ), /* tp_doc */
5446
5446
(traverseproc )PyCData_traverse , /* tp_traverse */
5447
5447
(inquiry )PyCData_clear , /* tp_clear */
5448
5448
0 , /* tp_richcompare */
@@ -5469,12 +5469,12 @@ PyTypeObject PyCPointer_Type = {
5469
5469
* Module initialization.
5470
5470
*/
5471
5471
5472
- static const char module_docs [] =
5473
- "Create and manipulate C compatible data types in Python." ;
5472
+ PyDoc_STRVAR ( _ctypes__doc__ ,
5473
+ "Create and manipulate C compatible data types in Python." ) ;
5474
5474
5475
5475
#ifdef MS_WIN32
5476
5476
5477
- static const char comerror_doc [] = "Raised when a COM method call failed." ;
5477
+ PyDoc_STRVAR ( comerror_doc , "Raised when a COM method call failed." ) ;
5478
5478
5479
5479
int
5480
5480
comerror_init (PyObject * self , PyObject * args , PyObject * kwds )
@@ -5663,7 +5663,7 @@ wstring_at(const wchar_t *ptr, int size)
5663
5663
static struct PyModuleDef _ctypesmodule = {
5664
5664
PyModuleDef_HEAD_INIT ,
5665
5665
.m_name = "_ctypes" ,
5666
- .m_doc = module_docs ,
5666
+ .m_doc = _ctypes__doc__ ,
5667
5667
.m_size = -1 ,
5668
5668
.m_methods = _ctypes_module_methods ,
5669
5669
};
0 commit comments