From e6579120e7ae76445527a276c33c0ade66053ea4 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 10 Nov 2023 10:28:57 +0900 Subject: [PATCH] Stop exporting via FFI functions that the C code doesn't use anymore --- src/libcinnabar.rs | 3 +-- src/main.rs | 16 +++++++--------- src/store.rs | 3 +-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/libcinnabar.rs b/src/libcinnabar.rs index ef519768a..0df8875e1 100644 --- a/src/libcinnabar.rs +++ b/src/libcinnabar.rs @@ -216,8 +216,7 @@ pub unsafe extern "C" fn resolve_hg2git(oid: *const hg_object_id) -> *const obje get_note_hg(&mut hg2git.0, oid) } -#[no_mangle] -pub unsafe extern "C" fn get_note_hg( +unsafe fn get_note_hg( notes: *mut cinnabar_notes_tree, oid: *const hg_object_id, ) -> *const object_id { diff --git a/src/main.rs b/src/main.rs index 82bafd69d..ae7ebf47f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3110,15 +3110,13 @@ fn do_fsck_full( } } - unsafe { - clear_manifest_heads(); - for h in manifest_heads { - // TODO: This is gross. - let m = RawCommit::read(h).unwrap(); - let m = m.parse().unwrap(); - let m = HgManifestId::from_bytes(m.body()).unwrap(); - do_set(SetWhat::Manifest, m.into(), h.into()); - } + clear_manifest_heads(); + for h in manifest_heads { + // TODO: This is gross. + let m = RawCommit::read(h).unwrap(); + let m = m.parse().unwrap(); + let m = HgManifestId::from_bytes(m.body()).unwrap(); + do_set(SetWhat::Manifest, m.into(), h.into()); } } } diff --git a/src/store.rs b/src/store.rs index eafc30d48..a1695f910 100644 --- a/src/store.rs +++ b/src/store.rs @@ -1128,8 +1128,7 @@ pub unsafe extern "C" fn reset_manifest_heads() { *heads = ManifestHeads::from_stored_metadata(); } -#[no_mangle] -pub unsafe extern "C" fn clear_manifest_heads() { +pub fn clear_manifest_heads() { let mut heads = MANIFEST_HEADS.lock().unwrap(); *heads = ManifestHeads::new(); }