From 023c99c0d9df841797d060b43e432dec32f30fe8 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Mon, 19 Feb 2024 12:34:45 -0600 Subject: [PATCH] feedback --- crates/libs/bindgen/src/rust/constants.rs | 2 +- crates/libs/core/src/imp/com_bindings.rs | 14 +++++++------- crates/libs/result/src/bindings.rs | 4 ++-- crates/tests/standalone/src/b_constant_types.rs | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/libs/bindgen/src/rust/constants.rs b/crates/libs/bindgen/src/rust/constants.rs index aebfbc32a9..8548e6e27b 100644 --- a/crates/libs/bindgen/src/rust/constants.rs +++ b/crates/libs/bindgen/src/rust/constants.rs @@ -41,7 +41,7 @@ pub fn writer(writer: &Writer, def: metadata::Field) -> TokenStream { if underlying_type == constant_type { if ty == metadata::Type::HRESULT { if let metadata::Value::I32(signed) = constant.value() { - value = format!("0x{:X}u32 as _", signed).into(); + value = format!("0x{:X}_u32 as _", signed).into(); } } } else { diff --git a/crates/libs/core/src/imp/com_bindings.rs b/crates/libs/core/src/imp/com_bindings.rs index 2987fb8439..79bc2505e4 100644 --- a/crates/libs/core/src/imp/com_bindings.rs +++ b/crates/libs/core/src/imp/com_bindings.rs @@ -28,7 +28,7 @@ impl ::core::fmt::Debug for AgileReferenceOptions { f.debug_tuple("AgileReferenceOptions").field(&self.0).finish() } } -pub const CO_E_NOTINITIALIZED: ::windows_core::HRESULT = ::windows_core::HRESULT(0x800401F0u32 as _); +pub const CO_E_NOTINITIALIZED: ::windows_core::HRESULT = ::windows_core::HRESULT(0x800401F0_u32 as _); #[repr(C)] pub struct DateTime { pub UniversalTime: i64, @@ -61,9 +61,9 @@ impl ::core::default::Default for DateTime { unsafe { ::core::mem::zeroed() } } } -pub const E_BOUNDS: ::windows_core::HRESULT = ::windows_core::HRESULT(0x8000000Bu32 as _); -pub const E_NOINTERFACE: ::windows_core::HRESULT = ::windows_core::HRESULT(0x80004002u32 as _); -pub const E_OUTOFMEMORY: ::windows_core::HRESULT = ::windows_core::HRESULT(0x8007000Eu32 as _); +pub const E_BOUNDS: ::windows_core::HRESULT = ::windows_core::HRESULT(0x8000000B_u32 as _); +pub const E_NOINTERFACE: ::windows_core::HRESULT = ::windows_core::HRESULT(0x80004002_u32 as _); +pub const E_OUTOFMEMORY: ::windows_core::HRESULT = ::windows_core::HRESULT(0x8007000E_u32 as _); ::windows_core::imp::com_interface!(IAgileObject, IAgileObject_Vtbl, 0x94ea2b94_e9cc_49e0_c0ff_ee64ca8f5b90); ::windows_core::imp::interface_hierarchy!(IAgileObject, ::windows_core::IUnknown); impl IAgileObject {} @@ -696,7 +696,7 @@ pub struct IWeakReferenceSource_Vtbl { pub base__: ::windows_core::IUnknown_Vtbl, pub GetWeakReference: unsafe extern "system" fn(*mut ::core::ffi::c_void, *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT, } -pub const JSCRIPT_E_CANTEXECUTE: ::windows_core::HRESULT = ::windows_core::HRESULT(0x89020001u32 as _); +pub const JSCRIPT_E_CANTEXECUTE: ::windows_core::HRESULT = ::windows_core::HRESULT(0x89020001_u32 as _); #[repr(C)] pub struct Point { pub X: f32, @@ -1035,7 +1035,7 @@ impl PropertyValue { impl ::windows_core::RuntimeName for PropertyValue { const NAME: &'static str = "Windows.Foundation.PropertyValue"; } -pub const RPC_E_DISCONNECTED: ::windows_core::HRESULT = ::windows_core::HRESULT(0x80010108u32 as _); +pub const RPC_E_DISCONNECTED: ::windows_core::HRESULT = ::windows_core::HRESULT(0x80010108_u32 as _); #[repr(C)] pub struct Rect { pub X: f32, @@ -1104,7 +1104,7 @@ impl ::core::default::Default for Size { unsafe { ::core::mem::zeroed() } } } -pub const TYPE_E_TYPEMISMATCH: ::windows_core::HRESULT = ::windows_core::HRESULT(0x80028CA0u32 as _); +pub const TYPE_E_TYPEMISMATCH: ::windows_core::HRESULT = ::windows_core::HRESULT(0x80028CA0_u32 as _); #[repr(C)] pub struct TimeSpan { pub Duration: i64, diff --git a/crates/libs/result/src/bindings.rs b/crates/libs/result/src/bindings.rs index c36c5562b5..dc24fe0ff3 100644 --- a/crates/libs/result/src/bindings.rs +++ b/crates/libs/result/src/bindings.rs @@ -20,8 +20,8 @@ pub type BOOL = i32; pub type BSTR = *const u16; pub const ERROR_INVALID_DATA: WIN32_ERROR = 13u32; pub const ERROR_NO_UNICODE_TRANSLATION: WIN32_ERROR = 1113u32; -pub const E_INVALIDARG: HRESULT = 0x80070057u32 as _; -pub const E_UNEXPECTED: HRESULT = 0x8000FFFFu32 as _; +pub const E_INVALIDARG: HRESULT = 0x80070057_u32 as _; +pub const E_UNEXPECTED: HRESULT = 0x8000FFFF_u32 as _; pub const FORMAT_MESSAGE_ALLOCATE_BUFFER: FORMAT_MESSAGE_OPTIONS = 256u32; pub const FORMAT_MESSAGE_FROM_SYSTEM: FORMAT_MESSAGE_OPTIONS = 4096u32; pub const FORMAT_MESSAGE_IGNORE_INSERTS: FORMAT_MESSAGE_OPTIONS = 512u32; diff --git a/crates/tests/standalone/src/b_constant_types.rs b/crates/tests/standalone/src/b_constant_types.rs index 304a38014c..23098524e5 100644 --- a/crates/tests/standalone/src/b_constant_types.rs +++ b/crates/tests/standalone/src/b_constant_types.rs @@ -8,7 +8,7 @@ clippy::all )] pub const CMC_ADD_ATTRIBUTES: PCSTR = 63i32 as _; -pub const E_ACCESSDENIED: HRESULT = 0x80070005u32 as _; +pub const E_ACCESSDENIED: HRESULT = 0x80070005_u32 as _; pub type HRESULT = i32; pub const IDC_UPARROW: PCWSTR = 32516u16 as _; pub type PCSTR = *const u8;