File tree Expand file tree Collapse file tree 2 files changed +6
-22
lines changed Expand file tree Collapse file tree 2 files changed +6
-22
lines changed Original file line number Diff line number Diff line change @@ -733,7 +733,7 @@ static struct PyModuleDef_Slot _zstd_slots[] = {
733733    {0 , NULL },
734734};
735735
736- struct  PyModuleDef  _zstdmodule  =  {
736+ static   struct  PyModuleDef  _zstdmodule  =  {
737737    .m_base  =  PyModuleDef_HEAD_INIT ,
738738    .m_name  =  "_zstd" ,
739739    .m_doc  =  "Implementation module for Zstandard compression." ,
Original file line number Diff line number Diff line change @@ -9,38 +9,22 @@ Python module.
99#define  ZSTD_MODULE_H 
1010#include  "Python.h" 
1111
12- /* Forward declaration of module state */ 
13- typedef  struct  _zstd_state  _zstd_state ;
14- 
15- /* Forward reference of module def */ 
16- extern  PyModuleDef  _zstdmodule ;
17- 
18- /* For clinic type calculations */ 
19- static  inline  _zstd_state  * 
20- get_zstd_state_from_type (PyTypeObject  * type )
21- {
22-     PyObject  * module  =  PyType_GetModuleByDef (type , & _zstdmodule );
23-     if  (module  ==  NULL ) {
24-         return  NULL ;
25-     }
26-     void  * state  =  PyModule_GetState (module );
27-     assert (state  !=  NULL );
28-     return  (_zstd_state  * )state ;
29- }
30- 
12+ /* Type specs */ 
3113extern  PyType_Spec  zstd_dict_type_spec ;
3214extern  PyType_Spec  zstd_compressor_type_spec ;
3315extern  PyType_Spec  zstd_decompressor_type_spec ;
3416
35- struct  _zstd_state  {
17+ typedef  struct  {
18+     /* Module heap types. */ 
3619    PyTypeObject  * ZstdDict_type ;
3720    PyTypeObject  * ZstdCompressor_type ;
3821    PyTypeObject  * ZstdDecompressor_type ;
3922    PyObject  * ZstdError ;
4023
24+     /* enum types set by set_parameter_types. */ 
4125    PyTypeObject  * CParameter_type ;
4226    PyTypeObject  * DParameter_type ;
43- };
27+ }  _zstd_state ;
4428
4529typedef  enum  {
4630    ERR_DECOMPRESS ,
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments