Update Rust to 1.13.0-nightly (198713106 2016-08-26)

This commit is contained in:
Anthony Ramine 2016-08-26 16:49:47 +02:00
parent f4d3281a6a
commit c66380d83c
64 changed files with 1428 additions and 2636 deletions

View file

@ -426,8 +426,7 @@ pub struct CefMenuModel {
impl Clone for CefMenuModel {
fn clone(&self) -> CefMenuModel{
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
if !self.c_object.is_null() {
((*self.c_object).base.add_ref.unwrap())(&mut (*self.c_object).base);
}
CefMenuModel {
@ -440,8 +439,7 @@ impl Clone for CefMenuModel {
impl Drop for CefMenuModel {
fn drop(&mut self) {
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
if !self.c_object.is_null() {
((*self.c_object).base.release.unwrap())(&mut (*self.c_object).base);
}
}
@ -456,8 +454,7 @@ impl CefMenuModel {
}
pub unsafe fn from_c_object_addref(c_object: *mut cef_menu_model_t) -> CefMenuModel {
if !c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if !c_object.is_null() {
((*c_object).base.add_ref.unwrap())(&mut (*c_object).base);
}
CefMenuModel {
@ -471,8 +468,7 @@ impl CefMenuModel {
pub fn c_object_addrefed(&self) -> *mut cef_menu_model_t {
unsafe {
if !self.c_object.is_null() &&
self.c_object as usize != mem::POST_DROP_USIZE {
if !self.c_object.is_null() {
eutil::add_ref(self.c_object as *mut types::cef_base_t);
}
self.c_object
@ -480,18 +476,17 @@ impl CefMenuModel {
}
pub fn is_null_cef_object(&self) -> bool {
self.c_object.is_null() || self.c_object as usize == mem::POST_DROP_USIZE
self.c_object.is_null()
}
pub fn is_not_null_cef_object(&self) -> bool {
!self.c_object.is_null() && self.c_object as usize != mem::POST_DROP_USIZE
!self.c_object.is_null()
}
//
// Clears the menu. Returns true (1) on success.
//
pub fn clear(&self) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -505,8 +500,7 @@ impl CefMenuModel {
// Returns the number of items in this menu.
//
pub fn get_count(&self) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -520,8 +514,7 @@ impl CefMenuModel {
// Add a separator to the menu. Returns true (1) on success.
//
pub fn add_separator(&self) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -536,8 +529,7 @@ impl CefMenuModel {
//
pub fn add_item(&self, command_id: libc::c_int,
label: &[u16]) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -554,8 +546,7 @@ impl CefMenuModel {
//
pub fn add_check_item(&self, command_id: libc::c_int,
label: &[u16]) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -573,8 +564,7 @@ impl CefMenuModel {
//
pub fn add_radio_item(&self, command_id: libc::c_int, label: &[u16],
group_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -592,8 +582,7 @@ impl CefMenuModel {
//
pub fn add_sub_menu(&self, command_id: libc::c_int,
label: &[u16]) -> interfaces::CefMenuModel {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -610,8 +599,7 @@ impl CefMenuModel {
// on success.
//
pub fn insert_separator_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -628,8 +616,7 @@ impl CefMenuModel {
//
pub fn insert_item_at(&self, index: libc::c_int, command_id: libc::c_int,
label: &[u16]) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -648,8 +635,7 @@ impl CefMenuModel {
//
pub fn insert_check_item_at(&self, index: libc::c_int,
command_id: libc::c_int, label: &[u16]) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -670,8 +656,7 @@ impl CefMenuModel {
pub fn insert_radio_item_at(&self, index: libc::c_int,
command_id: libc::c_int, label: &[u16],
group_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -691,8 +676,7 @@ impl CefMenuModel {
//
pub fn insert_sub_menu_at(&self, index: libc::c_int, command_id: libc::c_int,
label: &[u16]) -> interfaces::CefMenuModel {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -710,8 +694,7 @@ impl CefMenuModel {
// success.
//
pub fn remove(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -726,8 +709,7 @@ impl CefMenuModel {
// Removes the item at the specified |index|. Returns true (1) on success.
//
pub fn remove_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -743,8 +725,7 @@ impl CefMenuModel {
// found due to the command id not existing in the menu.
//
pub fn get_index_of(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -760,8 +741,7 @@ impl CefMenuModel {
// invalid range or the index being a separator.
//
pub fn get_command_id_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -777,8 +757,7 @@ impl CefMenuModel {
//
pub fn set_command_id_at(&self, index: libc::c_int,
command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -795,8 +774,7 @@ impl CefMenuModel {
//
// The resulting string must be freed by calling cef_string_userfree_free().
pub fn get_label(&self, command_id: libc::c_int) -> String {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -813,8 +791,7 @@ impl CefMenuModel {
//
// The resulting string must be freed by calling cef_string_userfree_free().
pub fn get_label_at(&self, index: libc::c_int) -> String {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -830,8 +807,7 @@ impl CefMenuModel {
//
pub fn set_label(&self, command_id: libc::c_int,
label: &[u16]) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -847,8 +823,7 @@ impl CefMenuModel {
// Set the label at the specified |index|. Returns true (1) on success.
//
pub fn set_label_at(&self, index: libc::c_int, label: &[u16]) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -865,8 +840,7 @@ impl CefMenuModel {
//
pub fn get_type(&self,
command_id: libc::c_int) -> types::cef_menu_item_type_t {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -881,8 +855,7 @@ impl CefMenuModel {
// Returns the item type at the specified |index|.
//
pub fn get_type_at(&self, index: libc::c_int) -> types::cef_menu_item_type_t {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -897,8 +870,7 @@ impl CefMenuModel {
// Returns the group id for the specified |command_id| or -1 if invalid.
//
pub fn get_group_id(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -913,8 +885,7 @@ impl CefMenuModel {
// Returns the group id at the specified |index| or -1 if invalid.
//
pub fn get_group_id_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -931,8 +902,7 @@ impl CefMenuModel {
//
pub fn set_group_id(&self, command_id: libc::c_int,
group_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -949,8 +919,7 @@ impl CefMenuModel {
//
pub fn set_group_id_at(&self, index: libc::c_int,
group_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -967,8 +936,7 @@ impl CefMenuModel {
//
pub fn get_sub_menu(&self,
command_id: libc::c_int) -> interfaces::CefMenuModel {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -984,8 +952,7 @@ impl CefMenuModel {
//
pub fn get_sub_menu_at(&self,
index: libc::c_int) -> interfaces::CefMenuModel {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1000,8 +967,7 @@ impl CefMenuModel {
// Returns true (1) if the specified |command_id| is visible.
//
pub fn is_visible(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1016,8 +982,7 @@ impl CefMenuModel {
// Returns true (1) if the specified |index| is visible.
//
pub fn is_visible_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1034,8 +999,7 @@ impl CefMenuModel {
//
pub fn set_visible(&self, command_id: libc::c_int,
visible: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1053,8 +1017,7 @@ impl CefMenuModel {
//
pub fn set_visible_at(&self, index: libc::c_int,
visible: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1070,8 +1033,7 @@ impl CefMenuModel {
// Returns true (1) if the specified |command_id| is enabled.
//
pub fn is_enabled(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1086,8 +1048,7 @@ impl CefMenuModel {
// Returns true (1) if the specified |index| is enabled.
//
pub fn is_enabled_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1104,8 +1065,7 @@ impl CefMenuModel {
//
pub fn set_enabled(&self, command_id: libc::c_int,
enabled: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1123,8 +1083,7 @@ impl CefMenuModel {
//
pub fn set_enabled_at(&self, index: libc::c_int,
enabled: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1141,8 +1100,7 @@ impl CefMenuModel {
// check and radio items.
//
pub fn is_checked(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1158,8 +1116,7 @@ impl CefMenuModel {
// and radio items.
//
pub fn is_checked_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1176,8 +1133,7 @@ impl CefMenuModel {
//
pub fn set_checked(&self, command_id: libc::c_int,
checked: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1195,8 +1151,7 @@ impl CefMenuModel {
//
pub fn set_checked_at(&self, index: libc::c_int,
checked: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1213,8 +1168,7 @@ impl CefMenuModel {
// assigned.
//
pub fn has_accelerator(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1230,8 +1184,7 @@ impl CefMenuModel {
// assigned.
//
pub fn has_accelerator_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1249,8 +1202,7 @@ impl CefMenuModel {
pub fn set_accelerator(&self, command_id: libc::c_int, key_code: libc::c_int,
shift_pressed: libc::c_int, ctrl_pressed: libc::c_int,
alt_pressed: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1272,8 +1224,7 @@ impl CefMenuModel {
pub fn set_accelerator_at(&self, index: libc::c_int, key_code: libc::c_int,
shift_pressed: libc::c_int, ctrl_pressed: libc::c_int,
alt_pressed: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1293,8 +1244,7 @@ impl CefMenuModel {
// true (1) on success.
//
pub fn remove_accelerator(&self, command_id: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1310,8 +1260,7 @@ impl CefMenuModel {
// on success.
//
pub fn remove_accelerator_at(&self, index: libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1330,8 +1279,7 @@ impl CefMenuModel {
key_code: &mut libc::c_int, shift_pressed: &mut libc::c_int,
ctrl_pressed: &mut libc::c_int,
alt_pressed: &mut libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1354,8 +1302,7 @@ impl CefMenuModel {
key_code: &mut libc::c_int, shift_pressed: &mut libc::c_int,
ctrl_pressed: &mut libc::c_int,
alt_pressed: &mut libc::c_int) -> libc::c_int {
if self.c_object.is_null() ||
self.c_object as usize == mem::POST_DROP_USIZE {
if self.c_object.is_null() {
panic!("called a CEF method on a null object")
}
unsafe {
@ -1387,8 +1334,7 @@ impl CefWrap<*mut cef_menu_model_t> for Option<CefMenuModel> {
}
}
unsafe fn to_rust(c_object: *mut cef_menu_model_t) -> Option<CefMenuModel> {
if c_object.is_null() &&
c_object as usize != mem::POST_DROP_USIZE {
if c_object.is_null() {
None
} else {
Some(CefMenuModel::from_c_object_addref(c_object))