diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-08-02 14:30:00 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-08-02 21:57:59 -0700 |
| commit | 9457ebee550d8f77ffc9b895acddae8946ee631e (patch) | |
| tree | b7612d4ec3135ab61b5a02f68259943e88b87936 /src/libextra | |
| parent | 887c65697056b23be69b9b11f41637d07327626e (diff) | |
| download | rust-9457ebee550d8f77ffc9b895acddae8946ee631e.tar.gz rust-9457ebee550d8f77ffc9b895acddae8946ee631e.zip | |
librustc: Disallow "unsafe" for external functions
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/flate.rs | 20 | ||||
| -rw-r--r-- | src/libextra/rl.rs | 14 | ||||
| -rw-r--r-- | src/libextra/time.rs | 17 | ||||
| -rw-r--r-- | src/libextra/unicode.rs | 15 |
4 files changed, 31 insertions, 35 deletions
diff --git a/src/libextra/flate.rs b/src/libextra/flate.rs index d330b0ea163..8024b9aa159 100644 --- a/src/libextra/flate.rs +++ b/src/libextra/flate.rs @@ -25,17 +25,17 @@ pub mod rustrt { #[link_name = "rustrt"] extern { - pub unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void, - src_buf_len: size_t, - pout_len: *mut size_t, - flags: c_int) - -> *c_void; + pub fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void, + src_buf_len: size_t, + pout_len: *mut size_t, + flags: c_int) + -> *c_void; - pub unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void, - src_buf_len: size_t, - pout_len: *mut size_t, - flags: c_int) - -> *c_void; + pub fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void, + src_buf_len: size_t, + pout_len: *mut size_t, + flags: c_int) + -> *c_void; } } diff --git a/src/libextra/rl.rs b/src/libextra/rl.rs index 08e1c240a4c..8aff8d38887 100644 --- a/src/libextra/rl.rs +++ b/src/libextra/rl.rs @@ -20,13 +20,13 @@ pub mod rustrt { use std::libc::{c_char, c_int}; extern { - pub unsafe fn linenoise(prompt: *c_char) -> *c_char; - pub unsafe fn linenoiseHistoryAdd(line: *c_char) -> c_int; - pub unsafe fn linenoiseHistorySetMaxLen(len: c_int) -> c_int; - pub unsafe fn linenoiseHistorySave(file: *c_char) -> c_int; - pub unsafe fn linenoiseHistoryLoad(file: *c_char) -> c_int; - pub unsafe fn linenoiseSetCompletionCallback(callback: *u8); - pub unsafe fn linenoiseAddCompletion(completions: *(), line: *c_char); + pub fn linenoise(prompt: *c_char) -> *c_char; + pub fn linenoiseHistoryAdd(line: *c_char) -> c_int; + pub fn linenoiseHistorySetMaxLen(len: c_int) -> c_int; + pub fn linenoiseHistorySave(file: *c_char) -> c_int; + pub fn linenoiseHistoryLoad(file: *c_char) -> c_int; + pub fn linenoiseSetCompletionCallback(callback: *u8); + pub fn linenoiseAddCompletion(completions: *(), line: *c_char); } } diff --git a/src/libextra/time.rs b/src/libextra/time.rs index 6595904a082..d95ac6d6c25 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -23,16 +23,13 @@ pub mod rustrt { #[abi = "cdecl"] extern { - pub unsafe fn get_time(sec: &mut i64, nsec: &mut i32); - - pub unsafe fn precise_time_ns(ns: &mut u64); - - pub unsafe fn rust_tzset(); - - pub unsafe fn rust_gmtime(sec: i64, nsec: i32, result: &mut Tm); - pub unsafe fn rust_localtime(sec: i64, nsec: i32, result: &mut Tm); - pub unsafe fn rust_timegm(tm: &Tm) -> i64; - pub unsafe fn rust_mktime(tm: &Tm) -> i64; + pub fn get_time(sec: &mut i64, nsec: &mut i32); + pub fn precise_time_ns(ns: &mut u64); + pub fn rust_tzset(); + pub fn rust_gmtime(sec: i64, nsec: i32, result: &mut Tm); + pub fn rust_localtime(sec: i64, nsec: i32, result: &mut Tm); + pub fn rust_timegm(tm: &Tm) -> i64; + pub fn rust_mktime(tm: &Tm) -> i64; } } diff --git a/src/libextra/unicode.rs b/src/libextra/unicode.rs index 9b502216fc1..4949ee79e5d 100644 --- a/src/libextra/unicode.rs +++ b/src/libextra/unicode.rs @@ -162,14 +162,13 @@ pub mod icu { #[link_name = "icuuc"] #[abi = "cdecl"] extern { - pub unsafe fn u_hasBinaryProperty(c: UChar32, which: UProperty) - -> UBool; - pub unsafe fn u_isdigit(c: UChar32) -> UBool; - pub unsafe fn u_islower(c: UChar32) -> UBool; - pub unsafe fn u_isspace(c: UChar32) -> UBool; - pub unsafe fn u_isupper(c: UChar32) -> UBool; - pub unsafe fn u_tolower(c: UChar32) -> UChar32; - pub unsafe fn u_toupper(c: UChar32) -> UChar32; + pub fn u_hasBinaryProperty(c: UChar32, which: UProperty) -> UBool; + pub fn u_isdigit(c: UChar32) -> UBool; + pub fn u_islower(c: UChar32) -> UBool; + pub fn u_isspace(c: UChar32) -> UBool; + pub fn u_isupper(c: UChar32) -> UBool; + pub fn u_tolower(c: UChar32) -> UChar32; + pub fn u_toupper(c: UChar32) -> UChar32; } } } |
