1- // Copyright 2016-2021 the Tectonic Project
1+ // Copyright 2016-2022 the Tectonic Project
22// Licensed under the MIT License.
33
44#![ deny( missing_docs) ]
@@ -817,11 +817,7 @@ pub unsafe extern "C" fn ttbc_get_file_md5(
817817 let rpath = CStr :: from_ptr ( path) . to_string_lossy ( ) ;
818818 let rdest = slice:: from_raw_parts_mut ( digest, 16 ) ;
819819
820- if es. get_file_md5 ( rpath. as_ref ( ) , rdest) {
821- 1
822- } else {
823- 0
824- }
820+ libc:: c_int:: from ( es. get_file_md5 ( rpath. as_ref ( ) , rdest) )
825821}
826822
827823/// Calculate the MD5 digest of a block of binary data.
@@ -917,11 +913,7 @@ pub extern "C" fn ttbc_output_flush(
917913 es : & mut CoreBridgeState ,
918914 handle : * mut OutputHandle ,
919915) -> libc:: c_int {
920- if es. output_flush ( handle) {
921- 1
922- } else {
923- 0
924- }
916+ libc:: c_int:: from ( es. output_flush ( handle) )
925917}
926918
927919/// Close a Tectonic output file.
@@ -934,11 +926,7 @@ pub extern "C" fn ttbc_output_close(
934926 return 0 ; // This is/was the behavior of close_file() in C.
935927 }
936928
937- if es. output_close ( handle) {
938- 1
939- } else {
940- 0
941- }
929+ libc:: c_int:: from ( es. output_close ( handle) )
942930}
943931
944932/// Open a Tectonic file for input.
@@ -1137,11 +1125,7 @@ pub extern "C" fn ttbc_input_close(
11371125 return 0 ; // This is/was the behavior of close_file() in C.
11381126 }
11391127
1140- if es. input_close ( handle) {
1141- 1
1142- } else {
1143- 0
1144- }
1128+ libc:: c_int:: from ( es. input_close ( handle) )
11451129}
11461130
11471131/// A buffer for diagnostic messages. Rust code does not need to use this type.
@@ -1214,11 +1198,7 @@ pub unsafe extern "C" fn ttbc_shell_escape(
12141198 }
12151199 } ;
12161200
1217- if es. shell_escape ( & rcmd) {
1218- 1
1219- } else {
1220- 0
1221- }
1201+ libc:: c_int:: from ( es. shell_escape ( & rcmd) )
12221202}
12231203
12241204/// Different types of files that can be opened by TeX engines
0 commit comments