@@ -50,19 +50,19 @@ use libc::{c_int, size_t};
5050
5151#[link(name = "snappy")]
5252extern {
53- fn snappy_compress(input: *u8,
53+ fn snappy_compress(input: *const u8,
5454 input_length: size_t,
5555 compressed: *mut u8,
5656 compressed_length: *mut size_t) -> c_int;
57- fn snappy_uncompress(compressed: *u8,
57+ fn snappy_uncompress(compressed: *const u8,
5858 compressed_length: size_t,
5959 uncompressed: *mut u8,
6060 uncompressed_length: *mut size_t) -> c_int;
6161 fn snappy_max_compressed_length(source_length: size_t) -> size_t;
62- fn snappy_uncompressed_length(compressed: *u8,
62+ fn snappy_uncompressed_length(compressed: *const u8,
6363 compressed_length: size_t,
6464 result: *mut size_t) -> c_int;
65- fn snappy_validate_compressed_buffer(compressed: *u8,
65+ fn snappy_validate_compressed_buffer(compressed: *const u8,
6666 compressed_length: size_t) -> c_int;
6767}
6868# fn main() {}
@@ -82,7 +82,7 @@ the allocated memory. The length is less than or equal to the capacity.
8282~~~~
8383# extern crate libc;
8484# use libc::{c_int, size_t};
85- # unsafe fn snappy_validate_compressed_buffer(_: *u8, _: size_t) -> c_int { 0 }
85+ # unsafe fn snappy_validate_compressed_buffer(_: *const u8, _: size_t) -> c_int { 0 }
8686# fn main() {}
8787pub fn validate_compressed_buffer(src: &[u8]) -> bool {
8888 unsafe {
@@ -106,7 +106,7 @@ the true length after compression for setting the length.
106106~~~~
107107# extern crate libc;
108108# use libc::{size_t, c_int};
109- # unsafe fn snappy_compress(a: *u8, b: size_t, c: *mut u8,
109+ # unsafe fn snappy_compress(a: *const u8, b: size_t, c: *mut u8,
110110# d: *mut size_t) -> c_int { 0 }
111111# unsafe fn snappy_max_compressed_length(a: size_t) -> size_t { a }
112112# fn main() {}
@@ -132,11 +132,11 @@ format and `snappy_uncompressed_length` will retrieve the exact buffer size requ
132132~~~~
133133# extern crate libc;
134134# use libc::{size_t, c_int};
135- # unsafe fn snappy_uncompress(compressed: *u8,
135+ # unsafe fn snappy_uncompress(compressed: *const u8,
136136# compressed_length: size_t,
137137# uncompressed: *mut u8,
138138# uncompressed_length: *mut size_t) -> c_int { 0 }
139- # unsafe fn snappy_uncompressed_length(compressed: *u8,
139+ # unsafe fn snappy_uncompressed_length(compressed: *const u8,
140140# compressed_length: size_t,
141141# result: *mut size_t) -> c_int { 0 }
142142# fn main() {}
@@ -418,7 +418,7 @@ Unsafe functions, on the other hand, advertise it to the world. An unsafe functi
418418this:
419419
420420~~~~
421- unsafe fn kaboom(ptr: * int) -> int { * ptr }
421+ unsafe fn kaboom(ptr: * const int) -> int { * ptr }
422422~~~~
423423
424424This function can only be called from an `unsafe` block or another `unsafe` function.
@@ -453,7 +453,7 @@ use std::ptr;
453453
454454#[link(name = "readline")]
455455extern {
456- static mut rl_prompt: *libc::c_char;
456+ static mut rl_prompt: *const libc::c_char;
457457}
458458
459459fn main() {
@@ -478,7 +478,7 @@ extern crate libc;
478478#[ link(name = "kernel32")]
479479#[ allow(non_snake_case_functions)]
480480extern "stdcall" {
481- fn SetEnvironmentVariableA(n: * u8, v: * u8) -> libc::c_int;
481+ fn SetEnvironmentVariableA(n: * const u8, v: * const u8) -> libc::c_int;
482482}
483483# fn main() { }
484484~~~~
0 commit comments