@@ -2585,7 +2585,8 @@ _posix_free(void *module)
2585
2585
}
2586
2586
2587
2587
static int
2588
- fill_time (PyObject * module , PyObject * v , int s_index , int f_index , int ns_index , time_t sec , unsigned long nsec )
2588
+ fill_time (_posixstate * state , PyObject * v , int s_index , int f_index ,
2589
+ int ns_index , time_t sec , unsigned long nsec )
2589
2590
{
2590
2591
assert (!PyErr_Occurred ());
2591
2592
#define SEC_TO_NS (1000000000LL)
@@ -2628,7 +2629,7 @@ fill_time(PyObject *module, PyObject *v, int s_index, int f_index, int ns_index,
2628
2629
goto exit ;
2629
2630
}
2630
2631
2631
- s_in_ns = PyNumber_Multiply (s , get_posix_state ( module ) -> billion );
2632
+ s_in_ns = PyNumber_Multiply (s , state -> billion );
2632
2633
if (s_in_ns == NULL ) {
2633
2634
goto exit ;
2634
2635
}
@@ -2686,7 +2687,8 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
2686
2687
{
2687
2688
assert (!PyErr_Occurred ());
2688
2689
2689
- PyObject * StatResultType = get_posix_state (module )-> StatResultType ;
2690
+ _posixstate * state = get_posix_state (module );
2691
+ PyObject * StatResultType = state -> StatResultType ;
2690
2692
PyObject * v = PyStructSequence_New ((PyTypeObject * )StatResultType );
2691
2693
if (v == NULL ) {
2692
2694
return NULL ;
@@ -2740,13 +2742,13 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
2740
2742
#else
2741
2743
ansec = mnsec = cnsec = 0 ;
2742
2744
#endif
2743
- if (fill_time (module , v , 7 , 10 , 13 , st -> st_atime , ansec ) < 0 ) {
2745
+ if (fill_time (state , v , 7 , 10 , 13 , st -> st_atime , ansec ) < 0 ) {
2744
2746
goto error ;
2745
2747
}
2746
- if (fill_time (module , v , 8 , 11 , 14 , st -> st_mtime , mnsec ) < 0 ) {
2748
+ if (fill_time (state , v , 8 , 11 , 14 , st -> st_mtime , mnsec ) < 0 ) {
2747
2749
goto error ;
2748
2750
}
2749
- if (fill_time (module , v , 9 , 12 , 15 , st -> st_ctime , cnsec ) < 0 ) {
2751
+ if (fill_time (state , v , 9 , 12 , 15 , st -> st_ctime , cnsec ) < 0 ) {
2750
2752
goto error ;
2751
2753
}
2752
2754
@@ -2774,7 +2776,7 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
2774
2776
SET_ITEM (ST_BIRTHTIME_IDX , PyFloat_FromDouble (bsec + bnsec * 1e-9 ));
2775
2777
}
2776
2778
#elif defined(MS_WINDOWS )
2777
- if (fill_time (module , v , -1 , ST_BIRTHTIME_IDX , ST_BIRTHTIME_NS_IDX ,
2779
+ if (fill_time (state , v , -1 , ST_BIRTHTIME_IDX , ST_BIRTHTIME_NS_IDX ,
2778
2780
st -> st_birthtime , st -> st_birthtime_nsec ) < 0 ) {
2779
2781
goto error ;
2780
2782
}
0 commit comments