@@ -62,7 +62,7 @@ extern "C" {
6262struct timeval ;
6363#endif
6464
65- typedef PyTime_t _PyTime_t ;
65+ typedef PyTime_t PyTime_t ;
6666#define _SIZEOF_PYTIME_T 8
6767
6868typedef enum {
@@ -130,84 +130,84 @@ PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
130130
131131// Create a timestamp from a number of seconds.
132132// Export for '_socket' shared extension.
133- PyAPI_FUNC (_PyTime_t ) _PyTime_FromSeconds (int seconds );
133+ PyAPI_FUNC (PyTime_t ) _PyTime_FromSeconds (int seconds );
134134
135135// Create a timestamp from a number of seconds in double.
136136// Export for '_socket' shared extension.
137- PyAPI_FUNC (_PyTime_t ) _PyTime_FromSecondsDouble (double seconds , _PyTime_round_t round );
137+ PyAPI_FUNC (PyTime_t ) _PyTime_FromSecondsDouble (double seconds , _PyTime_round_t round );
138138
139139// Macro to create a timestamp from a number of seconds, no integer overflow.
140140// Only use the macro for small values, prefer _PyTime_FromSeconds().
141141#define _PYTIME_FROMSECONDS (seconds ) \
142- ((_PyTime_t )(seconds) * (1000 * 1000 * 1000))
142+ ((PyTime_t )(seconds) * (1000 * 1000 * 1000))
143143
144144// Create a timestamp from a number of nanoseconds.
145145// Export for '_testinternalcapi' shared extension.
146- PyAPI_FUNC (_PyTime_t ) _PyTime_FromNanoseconds (_PyTime_t ns );
146+ PyAPI_FUNC (PyTime_t ) _PyTime_FromNanoseconds (PyTime_t ns );
147147
148148// Create a timestamp from a number of microseconds.
149149// Clamp to [PyTime_MIN; PyTime_MAX] on overflow.
150- extern _PyTime_t _PyTime_FromMicrosecondsClamp (_PyTime_t us );
150+ extern PyTime_t _PyTime_FromMicrosecondsClamp (PyTime_t us );
151151
152152// Create a timestamp from nanoseconds (Python int).
153153// Export for '_lsprof' shared extension.
154- PyAPI_FUNC (int ) _PyTime_FromNanosecondsObject (_PyTime_t * t ,
154+ PyAPI_FUNC (int ) _PyTime_FromNanosecondsObject (PyTime_t * t ,
155155 PyObject * obj );
156156
157157// Convert a number of seconds (Python float or int) to a timestamp.
158158// Raise an exception and return -1 on error, return 0 on success.
159159// Export for '_socket' shared extension.
160- PyAPI_FUNC (int ) _PyTime_FromSecondsObject (_PyTime_t * t ,
160+ PyAPI_FUNC (int ) _PyTime_FromSecondsObject (PyTime_t * t ,
161161 PyObject * obj ,
162162 _PyTime_round_t round );
163163
164164// Convert a number of milliseconds (Python float or int, 10^-3) to a timestamp.
165165// Raise an exception and return -1 on error, return 0 on success.
166166// Export for 'select' shared extension.
167- PyAPI_FUNC (int ) _PyTime_FromMillisecondsObject (_PyTime_t * t ,
167+ PyAPI_FUNC (int ) _PyTime_FromMillisecondsObject (PyTime_t * t ,
168168 PyObject * obj ,
169169 _PyTime_round_t round );
170170
171171// Convert timestamp to a number of milliseconds (10^-3 seconds).
172172// Export for '_ssl' shared extension.
173- PyAPI_FUNC (_PyTime_t ) _PyTime_AsMilliseconds (_PyTime_t t ,
173+ PyAPI_FUNC (PyTime_t ) _PyTime_AsMilliseconds (PyTime_t t ,
174174 _PyTime_round_t round );
175175
176176// Convert timestamp to a number of microseconds (10^-6 seconds).
177177// Export for '_queue' shared extension.
178- PyAPI_FUNC (_PyTime_t ) _PyTime_AsMicroseconds (_PyTime_t t ,
178+ PyAPI_FUNC (PyTime_t ) _PyTime_AsMicroseconds (PyTime_t t ,
179179 _PyTime_round_t round );
180180
181181#ifdef MS_WINDOWS
182182// Convert timestamp to a number of 100 nanoseconds (10^-7 seconds).
183- extern _PyTime_t _PyTime_As100Nanoseconds (_PyTime_t t ,
183+ extern PyTime_t _PyTime_As100Nanoseconds (PyTime_t t ,
184184 _PyTime_round_t round );
185185#endif
186186
187187// Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int
188188// object.
189189// Export for '_testinternalcapi' shared extension.
190- PyAPI_FUNC (PyObject * ) _PyTime_AsNanosecondsObject (_PyTime_t t );
190+ PyAPI_FUNC (PyObject * ) _PyTime_AsNanosecondsObject (PyTime_t t );
191191
192192#ifndef MS_WINDOWS
193193// Create a timestamp from a timeval structure.
194194// Raise an exception and return -1 on overflow, return 0 on success.
195- extern int _PyTime_FromTimeval (_PyTime_t * tp , struct timeval * tv );
195+ extern int _PyTime_FromTimeval (PyTime_t * tp , struct timeval * tv );
196196#endif
197197
198198// Convert a timestamp to a timeval structure (microsecond resolution).
199199// tv_usec is always positive.
200200// Raise an exception and return -1 if the conversion overflowed,
201201// return 0 on success.
202202// Export for 'select' shared extension.
203- PyAPI_FUNC (int ) _PyTime_AsTimeval (_PyTime_t t ,
203+ PyAPI_FUNC (int ) _PyTime_AsTimeval (PyTime_t t ,
204204 struct timeval * tv ,
205205 _PyTime_round_t round );
206206
207207// Similar to _PyTime_AsTimeval() but don't raise an exception on overflow.
208- // On overflow, clamp tv_sec to _PyTime_t min/max.
208+ // On overflow, clamp tv_sec to PyTime_t min/max.
209209// Export for 'select' shared extension.
210- PyAPI_FUNC (void ) _PyTime_AsTimeval_clamp (_PyTime_t t ,
210+ PyAPI_FUNC (void ) _PyTime_AsTimeval_clamp (PyTime_t t ,
211211 struct timeval * tv ,
212212 _PyTime_round_t round );
213213
@@ -219,31 +219,31 @@ PyAPI_FUNC(void) _PyTime_AsTimeval_clamp(_PyTime_t t,
219219// return 0 on success.
220220// Export for '_datetime' shared extension.
221221PyAPI_FUNC (int ) _PyTime_AsTimevalTime_t (
222- _PyTime_t t ,
222+ PyTime_t t ,
223223 time_t * secs ,
224224 int * us ,
225225 _PyTime_round_t round );
226226
227227#if defined(HAVE_CLOCK_GETTIME ) || defined(HAVE_KQUEUE )
228228// Create a timestamp from a timespec structure.
229229// Raise an exception and return -1 on overflow, return 0 on success.
230- extern int _PyTime_FromTimespec (_PyTime_t * tp , const struct timespec * ts );
230+ extern int _PyTime_FromTimespec (PyTime_t * tp , const struct timespec * ts );
231231
232232// Convert a timestamp to a timespec structure (nanosecond resolution).
233233// tv_nsec is always positive.
234234// Raise an exception and return -1 on error, return 0 on success.
235235// Export for '_testinternalcapi' shared extension.
236- PyAPI_FUNC (int ) _PyTime_AsTimespec (_PyTime_t t , struct timespec * ts );
236+ PyAPI_FUNC (int ) _PyTime_AsTimespec (PyTime_t t , struct timespec * ts );
237237
238238// Similar to _PyTime_AsTimespec() but don't raise an exception on overflow.
239- // On overflow, clamp tv_sec to _PyTime_t min/max.
239+ // On overflow, clamp tv_sec to PyTime_t min/max.
240240// Export for '_testinternalcapi' shared extension.
241- PyAPI_FUNC (void ) _PyTime_AsTimespec_clamp (_PyTime_t t , struct timespec * ts );
241+ PyAPI_FUNC (void ) _PyTime_AsTimespec_clamp (PyTime_t t , struct timespec * ts );
242242#endif
243243
244244
245245// Compute t1 + t2. Clamp to [PyTime_MIN; PyTime_MAX] on overflow.
246- extern _PyTime_t _PyTime_Add (_PyTime_t t1 , _PyTime_t t2 );
246+ extern PyTime_t _PyTime_Add (PyTime_t t1 , PyTime_t t2 );
247247
248248// Structure used by time.get_clock_info()
249249typedef struct {
@@ -262,13 +262,13 @@ typedef struct {
262262// Use _PyTime_GetSystemClockWithInfo or the public PyTime_Time() to check
263263// for failure.
264264// Export for '_random' shared extension.
265- PyAPI_FUNC (_PyTime_t ) _PyTime_GetSystemClock (void );
265+ PyAPI_FUNC (PyTime_t ) _PyTime_GetSystemClock (void );
266266
267267// Get the current time from the system clock.
268268// On success, set *t and *info (if not NULL), and return 0.
269269// On error, raise an exception and return -1.
270270extern int _PyTime_GetSystemClockWithInfo (
271- _PyTime_t * t ,
271+ PyTime_t * t ,
272272 _Py_clock_info_t * info );
273273
274274// Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
@@ -283,7 +283,7 @@ extern int _PyTime_GetSystemClockWithInfo(
283283// Use _PyTime_GetMonotonicClockWithInfo or the public PyTime_Monotonic()
284284// to check for failure.
285285// Export for '_random' shared extension.
286- PyAPI_FUNC (_PyTime_t ) _PyTime_GetMonotonicClock (void );
286+ PyAPI_FUNC (PyTime_t ) _PyTime_GetMonotonicClock (void );
287287
288288// Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
289289// The clock is not affected by system clock updates. The reference point of
@@ -295,7 +295,7 @@ PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void);
295295// Return 0 on success, raise an exception and return -1 on error.
296296// Export for '_testsinglephase' shared extension.
297297PyAPI_FUNC (int ) _PyTime_GetMonotonicClockWithInfo (
298- _PyTime_t * t ,
298+ PyTime_t * t ,
299299 _Py_clock_info_t * info );
300300
301301
@@ -319,7 +319,7 @@ PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
319319// Use _PyTime_GetPerfCounterWithInfo() or the public PyTime_PerfCounter
320320// to check for failure.
321321// Export for '_lsprof' shared extension.
322- PyAPI_FUNC (_PyTime_t ) _PyTime_GetPerfCounter (void );
322+ PyAPI_FUNC (PyTime_t ) _PyTime_GetPerfCounter (void );
323323
324324
325325// Get the performance counter: clock with the highest available resolution to
@@ -329,7 +329,7 @@ PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void);
329329//
330330// Return 0 on success, raise an exception and return -1 on error.
331331extern int _PyTime_GetPerfCounterWithInfo (
332- _PyTime_t * t ,
332+ PyTime_t * t ,
333333 _Py_clock_info_t * info );
334334
335335// Alias for backward compatibility
@@ -343,33 +343,33 @@ extern int _PyTime_GetPerfCounterWithInfo(
343343// Create a deadline.
344344// Pseudo code: _PyTime_GetMonotonicClock() + timeout.
345345// Export for '_ssl' shared extension.
346- PyAPI_FUNC (_PyTime_t ) _PyDeadline_Init (_PyTime_t timeout );
346+ PyAPI_FUNC (PyTime_t ) _PyDeadline_Init (PyTime_t timeout );
347347
348348// Get remaining time from a deadline.
349349// Pseudo code: deadline - _PyTime_GetMonotonicClock().
350350// Export for '_ssl' shared extension.
351- PyAPI_FUNC (_PyTime_t ) _PyDeadline_Get (_PyTime_t deadline );
351+ PyAPI_FUNC (PyTime_t ) _PyDeadline_Get (PyTime_t deadline );
352352
353353
354354// --- _PyTimeFraction -------------------------------------------------------
355355
356356typedef struct {
357- _PyTime_t numer ;
358- _PyTime_t denom ;
357+ PyTime_t numer ;
358+ PyTime_t denom ;
359359} _PyTimeFraction ;
360360
361361// Set a fraction.
362362// Return 0 on success.
363363// Return -1 if the fraction is invalid.
364364extern int _PyTimeFraction_Set (
365365 _PyTimeFraction * frac ,
366- _PyTime_t numer ,
367- _PyTime_t denom );
366+ PyTime_t numer ,
367+ PyTime_t denom );
368368
369369// Compute ticks * frac.numer / frac.denom.
370370// Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow.
371- extern _PyTime_t _PyTimeFraction_Mul (
372- _PyTime_t ticks ,
371+ extern PyTime_t _PyTimeFraction_Mul (
372+ PyTime_t ticks ,
373373 const _PyTimeFraction * frac );
374374
375375// Compute a clock resolution: frac.numer / frac.denom / 1e9.
0 commit comments