@@ -14,7 +14,7 @@ fn main_0() -> i32 {
1414 ( 0 ..16 ) . map ( |_| <u8 >:: default ( ) ) . collect :: < Box < [ u8 ] > > ( ) ,
1515 ) ) ;
1616 assert ! (
17- ( ( ( if 2 == libc:: AF_INET {
17+ ( ( ( if libc :: AF_INET == libc:: AF_INET {
1818 match Ptr :: from_string_literal( b"1.2.3.4" )
1919 . to_rust_string( )
2020 . parse:: <std:: net:: Ipv4Addr >( )
@@ -32,7 +32,7 @@ fn main_0() -> i32 {
3232 }
3333 Err ( _) => 0 ,
3434 }
35- } else if 2 == libc:: AF_INET6 {
35+ } else if libc :: AF_INET == libc:: AF_INET6 {
3636 match Ptr :: from_string_literal( b"1.2.3.4" )
3737 . to_rust_string( )
3838 . parse:: <std:: net:: Ipv6Addr >( )
@@ -66,7 +66,7 @@ fn main_0() -> i32 {
6666 != 0 )
6767 ) ;
6868 assert ! (
69- ( ( ( if 2 == libc:: AF_INET {
69+ ( ( ( if libc :: AF_INET == libc:: AF_INET {
7070 match Ptr :: from_string_literal( b"999.1.1.1" )
7171 . to_rust_string( )
7272 . parse:: <std:: net:: Ipv4Addr >( )
@@ -84,7 +84,7 @@ fn main_0() -> i32 {
8484 }
8585 Err ( _) => 0 ,
8686 }
87- } else if 2 == libc:: AF_INET6 {
87+ } else if libc :: AF_INET == libc:: AF_INET6 {
8888 match Ptr :: from_string_literal( b"999.1.1.1" )
8989 . to_rust_string( )
9090 . parse:: <std:: net:: Ipv6Addr >( )
@@ -108,7 +108,7 @@ fn main_0() -> i32 {
108108 != 0 )
109109 ) ;
110110 assert ! (
111- ( ( ( if 2 == libc:: AF_INET {
111+ ( ( ( if libc :: AF_INET == libc:: AF_INET {
112112 match Ptr :: from_string_literal( b"not an ip" )
113113 . to_rust_string( )
114114 . parse:: <std:: net:: Ipv4Addr >( )
@@ -126,7 +126,7 @@ fn main_0() -> i32 {
126126 }
127127 Err ( _) => 0 ,
128128 }
129- } else if 2 == libc:: AF_INET6 {
129+ } else if libc :: AF_INET == libc:: AF_INET6 {
130130 match Ptr :: from_string_literal( b"not an ip" )
131131 . to_rust_string( )
132132 . parse:: <std:: net:: Ipv6Addr >( )
@@ -150,7 +150,7 @@ fn main_0() -> i32 {
150150 != 0 )
151151 ) ;
152152 assert ! (
153- ( ( ( if 10 == libc:: AF_INET {
153+ ( ( ( if libc :: AF_INET6 == libc:: AF_INET {
154154 match Ptr :: from_string_literal( b"::1" )
155155 . to_rust_string( )
156156 . parse:: <std:: net:: Ipv4Addr >( )
@@ -168,7 +168,7 @@ fn main_0() -> i32 {
168168 }
169169 Err ( _) => 0 ,
170170 }
171- } else if 10 == libc:: AF_INET6 {
171+ } else if libc :: AF_INET6 == libc:: AF_INET6 {
172172 match Ptr :: from_string_literal( b"::1" )
173173 . to_rust_string( )
174174 . parse:: <std:: net:: Ipv6Addr >( )
@@ -197,7 +197,7 @@ fn main_0() -> i32 {
197197 != 0 )
198198 ) ;
199199 assert ! (
200- ( ( ( if 10 == libc:: AF_INET {
200+ ( ( ( if libc :: AF_INET6 == libc:: AF_INET {
201201 match Ptr :: from_string_literal( b"2001:db8::5" )
202202 . to_rust_string( )
203203 . parse:: <std:: net:: Ipv4Addr >( )
@@ -215,7 +215,7 @@ fn main_0() -> i32 {
215215 }
216216 Err ( _) => 0 ,
217217 }
218- } else if 10 == libc:: AF_INET6 {
218+ } else if libc :: AF_INET6 == libc:: AF_INET6 {
219219 match Ptr :: from_string_literal( b"2001:db8::5" )
220220 . to_rust_string( )
221221 . parse:: <std:: net:: Ipv6Addr >( )
@@ -251,8 +251,8 @@ fn main_0() -> i32 {
251251 let four: Value < Box < [ u8 ] > > = Rc :: new ( RefCell :: new ( Box :: new ( [ 10_u8 , 0_u8 , 0_u8 , 1_u8 ] ) ) ) ;
252252 assert ! (
253253 ( ( ( {
254- let mut __p1 = {
255- let __text = if 2 == libc:: AF_INET {
254+ let mut __it1 = {
255+ let __text = if libc :: AF_INET == libc:: AF_INET {
256256 let mut __b = [ 0u8 ; 4 ] ;
257257 for __i in 0 ..4 {
258258 __b[ __i] = ( ( four. as_pointer( ) as Ptr <u8 >) as Ptr <u8 >)
@@ -262,7 +262,7 @@ fn main_0() -> i32 {
262262 . read( ) ;
263263 }
264264 Some ( std:: net:: Ipv4Addr :: from( __b) . to_string( ) )
265- } else if 2 == libc:: AF_INET6 {
265+ } else if libc :: AF_INET == libc:: AF_INET6 {
266266 let mut __b = [ 0u8 ; 16 ] ;
267267 for __i in 0 ..16 {
268268 __b[ __i] = ( ( four. as_pointer( ) as Ptr <u8 >) as Ptr <u8 >)
@@ -290,19 +290,17 @@ fn main_0() -> i32 {
290290 _ => Ptr :: null( ) ,
291291 }
292292 }
293- . clone ( ) ;
294- let mut __p2 = Ptr :: from_string_literal( b"10.0.0.1" ) . clone ( ) ;
293+ . to_c_string_iterator ( ) ;
294+ let mut __it2 = Ptr :: from_string_literal( b"10.0.0.1" ) . to_c_string_iterator ( ) ;
295295 loop {
296- let __c1 = __p1 . read ( ) ;
297- let __c2 = __p2 . read ( ) ;
296+ let __c1 = __it1 . next ( ) ;
297+ let __c2 = __it2 . next ( ) ;
298298 if __c1 != __c2 {
299- break ( __c1 as i32 ) - ( __c2 as i32 ) ;
299+ break ( __c1. unwrap_or ( 0 ) as i32 ) - ( __c2. unwrap_or ( 0 ) as i32 ) ;
300300 }
301- if __c1 == 0 {
301+ if __c1. is_none ( ) {
302302 break 0 ;
303303 }
304- __p1 += 1 ;
305- __p2 += 1 ;
306304 }
307305 } == 0 ) as i32 )
308306 != 0 )
@@ -328,8 +326,8 @@ fn main_0() -> i32 {
328326 ( * sixteen. borrow_mut ( ) ) [ ( 15 ) as usize ] = 1_u8 ;
329327 assert ! (
330328 ( ( ( {
331- let mut __p1 = {
332- let __text = if 10 == libc:: AF_INET {
329+ let mut __it1 = {
330+ let __text = if libc :: AF_INET6 == libc:: AF_INET {
333331 let mut __b = [ 0u8 ; 4 ] ;
334332 for __i in 0 ..4 {
335333 __b[ __i] = ( ( sixteen. as_pointer( ) as Ptr <u8 >) as Ptr <u8 >)
@@ -339,7 +337,7 @@ fn main_0() -> i32 {
339337 . read( ) ;
340338 }
341339 Some ( std:: net:: Ipv4Addr :: from( __b) . to_string( ) )
342- } else if 10 == libc:: AF_INET6 {
340+ } else if libc :: AF_INET6 == libc:: AF_INET6 {
343341 let mut __b = [ 0u8 ; 16 ] ;
344342 for __i in 0 ..16 {
345343 __b[ __i] = ( ( sixteen. as_pointer( ) as Ptr <u8 >) as Ptr <u8 >)
@@ -367,26 +365,24 @@ fn main_0() -> i32 {
367365 _ => Ptr :: null( ) ,
368366 }
369367 }
370- . clone ( ) ;
371- let mut __p2 = Ptr :: from_string_literal( b"::1" ) . clone ( ) ;
368+ . to_c_string_iterator ( ) ;
369+ let mut __it2 = Ptr :: from_string_literal( b"::1" ) . to_c_string_iterator ( ) ;
372370 loop {
373- let __c1 = __p1 . read ( ) ;
374- let __c2 = __p2 . read ( ) ;
371+ let __c1 = __it1 . next ( ) ;
372+ let __c2 = __it2 . next ( ) ;
375373 if __c1 != __c2 {
376- break ( __c1 as i32 ) - ( __c2 as i32 ) ;
374+ break ( __c1. unwrap_or ( 0 ) as i32 ) - ( __c2. unwrap_or ( 0 ) as i32 ) ;
377375 }
378- if __c1 == 0 {
376+ if __c1. is_none ( ) {
379377 break 0 ;
380378 }
381- __p1 += 1 ;
382- __p2 += 1 ;
383379 }
384380 } == 0 ) as i32 )
385381 != 0 )
386382 ) ;
387383 assert ! (
388384 ( ( ( ( {
389- let __text = if 2 == libc:: AF_INET {
385+ let __text = if libc :: AF_INET == libc:: AF_INET {
390386 let mut __b = [ 0u8 ; 4 ] ;
391387 for __i in 0 ..4 {
392388 __b[ __i] = ( ( four. as_pointer( ) as Ptr <u8 >) as Ptr <u8 >)
@@ -396,7 +392,7 @@ fn main_0() -> i32 {
396392 . read( ) ;
397393 }
398394 Some ( std:: net:: Ipv4Addr :: from( __b) . to_string( ) )
399- } else if 2 == libc:: AF_INET6 {
395+ } else if libc :: AF_INET == libc:: AF_INET6 {
400396 let mut __b = [ 0u8 ; 16 ] ;
401397 for __i in 0 ..16 {
402398 __b[ __i] = ( ( four. as_pointer( ) as Ptr <u8 >) as Ptr <u8 >)
0 commit comments