@@ -3661,11 +3661,11 @@ typedef struct {
3661
3661
*/
3662
3662
3663
3663
typedef enum {
3664
- utime_success = 0 ,
3665
- utime_parse_failure = 1 ,
3666
- utime_times_and_ns_collision = 2 ,
3667
- utime_times_conversion_failure = 3 ,
3668
- utime_ns_conversion_failure = 4 ,
3664
+ UTIME_SUCCESS = 0 ,
3665
+ UTIME_PARSE_FAILURE = 1 ,
3666
+ UTIME_TIMES_AND_NS_COLLISION = 2 ,
3667
+ UTIME_TIMES_CONVERSION_FAILURE = 3 ,
3668
+ UTIME_NS_CONVERSION_FAILURE = 4 ,
3669
3669
} utime_status ;
3670
3670
3671
3671
static utime_status
@@ -3697,14 +3697,14 @@ utime_read_time_arguments(utime_arguments *ua)
3697
3697
format , kwlist , ua -> path , & times , & ns );
3698
3698
3699
3699
if (!parse_result )
3700
- return utime_parse_failure ;
3700
+ return UTIME_PARSE_FAILURE ;
3701
3701
3702
3702
if (times && ns ) {
3703
3703
PyErr_Format (PyExc_RuntimeError ,
3704
3704
"%s: you may specify either 'times'"
3705
3705
" or 'ns' but not both" ,
3706
3706
ua -> function_name );
3707
- return_value = utime_times_and_ns_collision ;
3707
+ return_value = UTIME_TIMES_AND_NS_COLLISION ;
3708
3708
goto fail ;
3709
3709
}
3710
3710
@@ -3714,42 +3714,42 @@ utime_read_time_arguments(utime_arguments *ua)
3714
3714
"%s: 'times' must be either"
3715
3715
" a tuple of two ints or None" ,
3716
3716
ua -> function_name );
3717
- return_value = utime_times_conversion_failure ;
3717
+ return_value = UTIME_TIMES_CONVERSION_FAILURE ;
3718
3718
goto fail ;
3719
3719
}
3720
3720
ua -> now = 0 ;
3721
3721
if (_PyTime_ObjectToTimespec (PyTuple_GET_ITEM (times , 0 ),
3722
3722
& ua -> atime_s , & ua -> atime_ns ) == -1 ||
3723
3723
_PyTime_ObjectToTimespec (PyTuple_GET_ITEM (times , 1 ),
3724
3724
& ua -> mtime_s , & ua -> mtime_ns ) == -1 ) {
3725
- return_value = utime_times_conversion_failure ;
3725
+ return_value = UTIME_TIMES_CONVERSION_FAILURE ;
3726
3726
goto fail ;
3727
3727
}
3728
- return utime_success ;
3728
+ return UTIME_SUCCESS ;
3729
3729
}
3730
3730
3731
3731
if (ns ) {
3732
3732
if (!PyTuple_CheckExact (ns ) || (PyTuple_Size (ns ) != 2 )) {
3733
3733
PyErr_Format (PyExc_TypeError ,
3734
3734
"%s: 'ns' must be a tuple of two ints" ,
3735
3735
ua -> function_name );
3736
- return_value = utime_ns_conversion_failure ;
3736
+ return_value = UTIME_NS_CONVERSION_FAILURE ;
3737
3737
goto fail ;
3738
3738
}
3739
3739
ua -> now = 0 ;
3740
3740
if (!split_py_long_to_s_and_ns (PyTuple_GET_ITEM (ns , 0 ),
3741
3741
& ua -> atime_s , & ua -> atime_ns ) ||
3742
3742
!split_py_long_to_s_and_ns (PyTuple_GET_ITEM (ns , 1 ),
3743
3743
& ua -> mtime_s , & ua -> mtime_ns )) {
3744
- return_value = utime_ns_conversion_failure ;
3744
+ return_value = UTIME_NS_CONVERSION_FAILURE ;
3745
3745
goto fail ;
3746
3746
}
3747
- return utime_success ;
3747
+ return UTIME_SUCCESS ;
3748
3748
}
3749
3749
3750
3750
/* either times=None, or neither times nor ns was specified. use "now". */
3751
3751
ua -> now = 1 ;
3752
- return utime_success ;
3752
+ return UTIME_SUCCESS ;
3753
3753
3754
3754
fail :
3755
3755
if (ua -> converter )
@@ -3786,7 +3786,7 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
3786
3786
switch (utime_read_time_arguments (& ua )) {
3787
3787
default :
3788
3788
return NULL ;
3789
- case utime_success : {
3789
+ case UTIME_SUCCESS : {
3790
3790
wchar_t * wpath = PyUnicode_AsUnicode (upath );
3791
3791
if (wpath == NULL )
3792
3792
return NULL ;
@@ -3799,15 +3799,15 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
3799
3799
return win32_error_object ("utime ", upath );
3800
3800
break ;
3801
3801
}
3802
- case utime_parse_failure : {
3802
+ case UTIME_PARSE_FAILURE : {
3803
3803
const char * apath ;
3804
3804
/* Drop the argument parsing error as narrow strings
3805
3805
are also valid. */
3806
3806
PyErr_Clear ();
3807
3807
3808
3808
ua .path_format = 'y' ;
3809
3809
ua .path = (PyObject * * )& apath ;
3810
- if (utime_read_time_arguments (& ua ) != utime_success )
3810
+ if (utime_read_time_arguments (& ua ) != UTIME_SUCCESS )
3811
3811
return NULL ;
3812
3812
if (win32_warn_bytes_api ())
3813
3813
return NULL ;
@@ -3862,7 +3862,7 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
3862
3862
ua .path = & opath ;
3863
3863
ua .converter = PyUnicode_FSConverter ;
3864
3864
3865
- if (utime_read_time_arguments (& ua ) != utime_success )
3865
+ if (utime_read_time_arguments (& ua ) != UTIME_SUCCESS )
3866
3866
return NULL ;
3867
3867
path = PyBytes_AsString (opath );
3868
3868
if (ua .now ) {
@@ -3915,7 +3915,7 @@ posix_futimes(PyObject *self, PyObject *args, PyObject *kwargs)
3915
3915
ua .path = (PyObject * * )& fd ;
3916
3916
ua .first_argument_name = "fd" ;
3917
3917
3918
- if (utime_read_time_arguments (& ua ) != utime_success )
3918
+ if (utime_read_time_arguments (& ua ) != UTIME_SUCCESS )
3919
3919
return NULL ;
3920
3920
3921
3921
if (ua .now ) {
@@ -3960,7 +3960,7 @@ posix_lutimes(PyObject *self, PyObject *args, PyObject *kwargs)
3960
3960
ua .path = & opath ;
3961
3961
ua .converter = PyUnicode_FSConverter ;
3962
3962
3963
- if (utime_read_time_arguments (& ua ) != utime_success )
3963
+ if (utime_read_time_arguments (& ua ) != UTIME_SUCCESS )
3964
3964
return NULL ;
3965
3965
path = PyBytes_AsString (opath );
3966
3966
0 commit comments