@@ -49,23 +49,11 @@ fn f2(a0: ::libc::clockid_t, a1: Ptr<Timespec>) -> i32 {
4949}
5050
5151fn f4 ( a0 : Ptr < :: libc:: time_t > , a1 : Ptr < Tm > ) -> Ptr < Tm > {
52- let __res = a1;
52+ let __res = a1. clone ( ) ;
5353 match jiff:: Timestamp :: from_second ( a0. read ( ) ) {
5454 Ok ( __ts) => {
5555 let __dt = __ts. to_zoned ( jiff:: tz:: TimeZone :: UTC ) ;
56- __res. with_mut ( |__tm| {
57- * __tm. tm_sec . borrow_mut ( ) = __dt. second ( ) as i32 ;
58- * __tm. tm_min . borrow_mut ( ) = __dt. minute ( ) as i32 ;
59- * __tm. tm_hour . borrow_mut ( ) = __dt. hour ( ) as i32 ;
60- * __tm. tm_mday . borrow_mut ( ) = __dt. day ( ) as i32 ;
61- * __tm. tm_mon . borrow_mut ( ) = __dt. month ( ) as i32 - 1 ;
62- * __tm. tm_year . borrow_mut ( ) = __dt. year ( ) as i32 - 1900 ;
63- * __tm. tm_wday . borrow_mut ( ) = __dt. weekday ( ) . to_sunday_zero_offset ( ) as i32 ;
64- * __tm. tm_yday . borrow_mut ( ) = __dt. day_of_year ( ) as i32 - 1 ;
65- * __tm. tm_isdst . borrow_mut ( ) = 0 ;
66- * __tm. tm_gmtoff . borrow_mut ( ) = 0 ;
67- * __tm. tm_zone . borrow_mut ( ) = Ptr :: from_string_literal ( b"GMT" ) ;
68- } ) ;
56+ __res. with_mut ( |__tm| * __tm = Tm :: from_zoned ( & __dt) ) ;
6957 __res
7058 }
7159 Err ( _) => {
@@ -76,17 +64,7 @@ fn f4(a0: Ptr<::libc::time_t>, a1: Ptr<Tm>) -> Ptr<Tm> {
7664}
7765
7866fn f6 ( a0 : Ptr < u8 > , a1 : usize , a2 : Ptr < u8 > , a3 : Ptr < Tm > ) -> usize {
79- let __dt = a3. with ( |__tm| {
80- jiff:: civil:: DateTime :: new (
81- ( * __tm. tm_year . borrow ( ) + 1900 ) as i16 ,
82- ( * __tm. tm_mon . borrow ( ) + 1 ) as i8 ,
83- * __tm. tm_mday . borrow ( ) as i8 ,
84- * __tm. tm_hour . borrow ( ) as i8 ,
85- * __tm. tm_min . borrow ( ) as i8 ,
86- * __tm. tm_sec . borrow ( ) as i8 ,
87- 0 ,
88- )
89- } ) ;
67+ let __dt = a3. with ( |__tm| __tm. to_civil ( ) ) ;
9068 let __text = match __dt {
9169 Ok ( __d) => {
9270 jiff:: fmt:: strtime:: format ( a2. to_rust_string ( ) . as_str ( ) , __d) . unwrap_or_default ( )
0 commit comments