Skip to content

Commit

Permalink
Stop exporting via FFI functions that the C code doesn't use anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Nov 10, 2023
1 parent 1c863b7 commit e657912
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/libcinnabar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 7 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit e657912

Please sign in to comment.