summaryrefslogtreecommitdiffstats
path: root/ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-06-26 10:41:35 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-06-26 10:41:35 +0200
commit2a4cb58fc9e680bb2bf3fe268ca96147cbe903ef (patch)
treea55cb61beb8285de5e38429eb416d6a6c608d067 /ffi
parent16553c8bd46f16811691bb0f657e0ee6593697ef (diff)
openpgp-ffi, ffi, ffi-macros: Avoid deprecated integer types.
Diffstat (limited to 'ffi')
-rw-r--r--ffi/src/core.rs4
-rw-r--r--ffi/src/net.rs4
-rw-r--r--ffi/src/store.rs28
3 files changed, 18 insertions, 18 deletions
diff --git a/ffi/src/core.rs b/ffi/src/core.rs
index 830391d6..70d333be 100644
--- a/ffi/src/core.rs
+++ b/ffi/src/core.rs
@@ -39,7 +39,7 @@
//! ```
use std::ptr;
-use libc::{uint8_t, c_char, c_int};
+use libc::{c_char, c_int};
use sequoia_core as core;
use sequoia_core::Config;
@@ -127,7 +127,7 @@ fn sq_context_ipc_policy(ctx: *const Context) -> c_int {
/// Returns whether or not this is an ephemeral context.
#[::ffi_catch_abort] #[no_mangle] pub extern "C"
-fn sq_context_ephemeral(ctx: *const Context) -> uint8_t {
+fn sq_context_ephemeral(ctx: *const Context) -> u8 {
let ctx = ffi_param_ref!(ctx);
if ctx.c.ephemeral() { 1 } else { 0 }
}
diff --git a/ffi/src/net.rs b/ffi/src/net.rs
index 93ea61cc..3f25b643 100644
--- a/ffi/src/net.rs
+++ b/ffi/src/net.rs
@@ -27,7 +27,7 @@
//! tpk = sq_keyserver_get (ctx, ks, id);
//! ```
-use libc::{uint8_t, c_char, size_t};
+use libc::{c_char, size_t};
use native_tls::Certificate;
use std::ptr;
use std::slice;
@@ -69,7 +69,7 @@ fn sq_keyserver_new(ctx: *mut Context, uri: *const c_char) -> *mut KeyServer {
#[::ffi_catch_abort] #[no_mangle] pub extern "C"
fn sq_keyserver_with_cert(ctx: *mut Context,
uri: *const c_char,
- cert: *const uint8_t,
+ cert: *const u8,
len: size_t) -> *mut KeyServer {
let ctx = ffi_param_ref_mut!(ctx);
ffi_make_fry_from_ctx!(ctx);
diff --git a/ffi/src/store.rs b/ffi/src/store.rs
index 3aef93a7..a5e49c8b 100644
--- a/ffi/src/store.rs
+++ b/ffi/src/store.rs
@@ -23,7 +23,7 @@
//! ```
-use libc::{uint8_t, uint64_t, c_char};
+use libc::c_char;
use std::ptr;
extern crate sequoia_openpgp as openpgp;
@@ -65,7 +65,7 @@ fn sq_store_list_stores(ctx: *mut Context,
fn sq_store_iter_next(iter: *mut StoreIter,
realmp: Option<&mut *mut c_char>,
namep: Option<&mut *mut c_char>,
- policyp: Option<&mut uint8_t>)
+ policyp: Option<&mut u8>)
-> *mut Store {
let iter = ffi_param_ref_mut!(iter);
match iter.next() {
@@ -159,7 +159,7 @@ fn sq_log_iter_next(iter: *mut LogIter) -> *mut Log {
};
box_raw!(Log{
- timestamp: e.timestamp.sec as uint64_t,
+ timestamp: e.timestamp.sec as u64,
store: maybe_box_raw!(e.store),
binding: maybe_box_raw!(e.binding),
key: maybe_box_raw!(e.key),
@@ -569,23 +569,23 @@ fn sq_stats_free(stats: Option<&mut Stats>) {
#[repr(C)]
pub struct Stamps {
/// Counts how many times this has been used.
- pub count: uint64_t,
+ pub count: u64,
/// Records the time when this has been used first.
- pub first: uint64_t,
+ pub first: u64,
/// Records the time when this has been used last.
- pub last: uint64_t,
+ pub last: u64,
}
impl Stamps {
fn new(s: &sequoia_store::Stamps) -> Stamps {
Stamps{
- count: s.count as uint64_t,
+ count: s.count as u64,
first: s.first.map(|t| t.sec).unwrap_or(0)
- as uint64_t,
+ as u64,
last: s.last.map(|t| t.sec).unwrap_or(0)
- as uint64_t,
+ as u64,
}
}
}
@@ -598,10 +598,10 @@ impl Stamps {
#[repr(C)]
pub struct Stats {
/// Records the time this item was created.
- pub created: uint64_t,
+ pub created: u64,
/// Records the time this item was last updated.
- pub updated: uint64_t,
+ pub updated: u64,
/// Records counters and timestamps of encryptions.
pub encryption: Stamps,
@@ -613,8 +613,8 @@ pub struct Stats {
impl Stats {
fn new(s: sequoia_store::Stats) -> Stats {
Stats {
- created: s.created.map(|t| t.sec).unwrap_or(0) as uint64_t,
- updated: s.updated.map(|t| t.sec).unwrap_or(0) as uint64_t,
+ created: s.created.map(|t| t.sec).unwrap_or(0) as u64,
+ updated: s.updated.map(|t| t.sec).unwrap_or(0) as u64,
encryption: Stamps::new(&s.encryption),
verification: Stamps::new(&s.verification),
}
@@ -625,7 +625,7 @@ impl Stats {
#[repr(C)]
pub struct Log {
/// Records the time of the entry.
- pub timestamp: uint64_t,
+ pub timestamp: u64,
/// Relates the entry to a store.
///