Skip to content

Commit

Permalink
fixed type errors (#284)
Browse files Browse the repository at this point in the history
# Description

Fixing some type errors for ARM machines
  • Loading branch information
Maleware committed Jun 19, 2023
1 parent 7b05814 commit e14cc79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions rust/krb5/src/kadm5.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{
ffi::{c_int, CStr, CString},
ffi::{c_char, c_int, CStr, CString},
fmt::Display,
slice,
};
Expand Down Expand Up @@ -62,11 +62,11 @@ impl ConfigParams {
fn as_c(&self) -> krb5_sys::kadm5_config_params {
let mut c = unsafe { std::mem::zeroed::<krb5_sys::kadm5_config_params>() };
if let Some(default_realm) = &self.default_realm {
c.realm = default_realm.as_ptr() as *mut i8;
c.realm = default_realm.as_ptr() as *mut c_char;
c.mask |= i64::from(krb5_sys::KADM5_CONFIG_REALM);
}
if let Some(admin_server) = &self.admin_server {
c.admin_server = admin_server.as_ptr() as *mut i8;
c.admin_server = admin_server.as_ptr() as *mut c_char;
c.mask |= i64::from(krb5_sys::KADM5_CONFIG_ADMIN_SERVER);
}
if let Some(kadmind_port) = self.kadmind_port {
Expand Down
8 changes: 4 additions & 4 deletions rust/krb5/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! The primary entry point is [`KrbContext`].

use std::{
ffi::{c_int, CStr},
ffi::{c_char, c_int, CStr},
fmt::{Debug, Display},
ops::Deref,
};
Expand Down Expand Up @@ -116,7 +116,7 @@ impl KrbContext {

/// Get the default realm configured for this context.
pub fn default_realm(&self) -> Result<DefaultRealm, Error> {
let mut realm: *mut i8 = std::ptr::null_mut();
let mut realm: *mut c_char = std::ptr::null_mut();
unsafe {
Error::from_call_result(
Some(self),
Expand All @@ -142,7 +142,7 @@ impl Drop for KrbContext {
/// Created by [`KrbContext::default_realm`].
pub struct DefaultRealm<'a> {
ctx: &'a KrbContext,
raw: *const i8,
raw: *const c_char,
}
impl Deref for DefaultRealm<'_> {
type Target = CStr;
Expand Down Expand Up @@ -319,7 +319,7 @@ impl<'a> Keyblock<'a> {
.context(StringTooLongSnafu {
string_name: "password",
})?,
data: password.as_ptr().cast::<i8>().cast_mut(),
data: password.as_ptr().cast::<c_char>().cast_mut(),
};
unsafe {
Error::from_call_result(
Expand Down

0 comments on commit e14cc79

Please sign in to comment.