Rename dc_chat_t to Chat

This clears the way to start working on making the functions safe.
But small PRs are good PRs so let's get this rename out of the way and
have future PRs less noisy.

Also stop making this #[repr(C)] and start making fields that are not
used private. Lastly clean up some comments by moving them or
deleting them, so they make sense again after the translation.
This commit is contained in:
Floris Bruynooghe
2019-07-09 21:27:56 +02:00
parent 816fa1df9b
commit 4c646dc1e0
11 changed files with 77 additions and 91 deletions

View File

@@ -377,7 +377,7 @@ pub unsafe fn dc_cmdline_skip_auth() {
S_IS_AUTH = 1;
}
unsafe fn chat_prefix(chat: *const dc_chat_t) -> &'static str {
unsafe fn chat_prefix(chat: *const Chat) -> &'static str {
if (*chat).type_0 == 120 {
"Group"
} else if (*chat).type_0 == 130 {
@@ -787,7 +787,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
let chat_id_0: libc::c_int =
dc_create_chat_by_msg_id(context, msg_id_0 as uint32_t) as libc::c_int;
if chat_id_0 != 0 {
let chat_0: *mut dc_chat_t = dc_get_chat(context, chat_id_0 as uint32_t);
let chat_0: *mut Chat = dc_get_chat(context, chat_id_0 as uint32_t);
println!(
"{}#{} created successfully.",
chat_prefix(chat_0),