Skip to content

Commit f7d899e

Browse files
committed
use c++ style references
1 parent d490c40 commit f7d899e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libc/src/time/linux/localtime_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
namespace LIBC_NAMESPACE_DECL {
1515
namespace localtime_utils {
1616

17-
void release_file(ErrorOr<File *> error_or_file) {
17+
void release_file(ErrorOr<File &> error_or_file) {
1818
file_usage = 0;
1919
error_or_file.value()->close();
2020
}
2121

22-
ErrorOr<File *> acquire_file(char &filename) {
22+
ErrorOr<File &> acquire_file(char &filename) {
2323
while (1) {
2424
if (file_usage == 0) {
2525
file_usage = 1;

libc/src/time/time_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ LIBC_INLINE tm *gmtime_internal(const time_t *timer, tm *result) {
101101

102102
// TODO: localtime is not yet implemented and a temporary solution is to
103103
// use gmtime, https://github.com/llvm/llvm-project/issues/107597
104-
LIBC_INLINE tm *localtime(const time_t *t_ptr) {
104+
LIBC_INLINE tm &localtime(const time_t &t_ptr) {
105105
static tm result;
106106
return time_utils::gmtime_internal(t_ptr, &result);
107107
}
108108

109-
LIBC_INLINE struct tm *localtime_internal(const time_t &timer, struct tm &buf) {
109+
LIBC_INLINE struct tm &localtime_internal(const time_t &timer, struct tm &buf) {
110110
if (timer == nullptr) {
111111
invalid_value();
112112
return nullptr;

0 commit comments

Comments
 (0)