Skip to content

Commit

Permalink
Use signed byte for C's char type (#2781)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Jan 9, 2024
1 parent 3ee83d5 commit 7c400dc
Show file tree
Hide file tree
Showing 141 changed files with 1,266 additions and 1,266 deletions.
2 changes: 1 addition & 1 deletion crates/libs/metadata/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,4 @@ impl Reader {
pub const REMAP_TYPES: [(TypeName, TypeName); 2] = [(TypeName::D2D_MATRIX_3X2_F, TypeName::Matrix3x2), (TypeName::D3DMATRIX, TypeName::Matrix4x4)];

// TODO: get rid of at least the second tuple if not the whole thing.
pub const CORE_TYPES: [(TypeName, Type); 11] = [(TypeName::GUID, Type::GUID), (TypeName::IUnknown, Type::IUnknown), (TypeName::HResult, Type::HRESULT), (TypeName::HRESULT, Type::HRESULT), (TypeName::HSTRING, Type::String), (TypeName::BSTR, Type::BSTR), (TypeName::IInspectable, Type::IInspectable), (TypeName::PSTR, Type::PSTR), (TypeName::PWSTR, Type::PWSTR), (TypeName::Type, Type::Type), (TypeName::CHAR, Type::U8)];
pub const CORE_TYPES: [(TypeName, Type); 11] = [(TypeName::GUID, Type::GUID), (TypeName::IUnknown, Type::IUnknown), (TypeName::HResult, Type::HRESULT), (TypeName::HRESULT, Type::HRESULT), (TypeName::HSTRING, Type::String), (TypeName::BSTR, Type::BSTR), (TypeName::IInspectable, Type::IInspectable), (TypeName::PSTR, Type::PSTR), (TypeName::PWSTR, Type::PWSTR), (TypeName::Type, Type::Type), (TypeName::CHAR, Type::I8)];
4 changes: 2 additions & 2 deletions crates/libs/sys/src/Windows/Wdk/Foundation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,8 +1516,8 @@ pub struct IRP {
pub IoStatus: super::super::Win32::System::IO::IO_STATUS_BLOCK,
pub RequestorMode: i8,
pub PendingReturned: super::super::Win32::Foundation::BOOLEAN,
pub StackCount: u8,
pub CurrentLocation: u8,
pub StackCount: i8,
pub CurrentLocation: i8,
pub Cancel: super::super::Win32::Foundation::BOOLEAN,
pub CancelIrql: u8,
pub ApcEnvironment: i8,
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/sys/src/Windows/Wdk/Graphics/Direct3D/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15332,7 +15332,7 @@ pub struct OUTPUTDUPL_CONTEXT_DEBUG_INFO {
pub AccumulatedPresents: u32,
pub LastPresentTime: i64,
pub LastMouseTime: i64,
pub ProcessName: [u8; 16],
pub ProcessName: [i8; 16],
}
impl ::core::marker::Copy for OUTPUTDUPL_CONTEXT_DEBUG_INFO {}
impl ::core::clone::Clone for OUTPUTDUPL_CONTEXT_DEBUG_INFO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4130,7 +4130,7 @@ pub struct NDIS_WMI_ENUM_ADAPTER {
pub IfIndex: u32,
pub NetLuid: super::super::super::Win32::NetworkManagement::Ndis::NET_LUID_LH,
pub DeviceNameLength: u16,
pub DeviceName: [u8; 1],
pub DeviceName: [i8; 1],
}
#[cfg(feature = "Win32_NetworkManagement_Ndis")]
impl ::core::marker::Copy for NDIS_WMI_ENUM_ADAPTER {}
Expand Down
16 changes: 8 additions & 8 deletions crates/libs/sys/src/Windows/Wdk/Storage/FileSystem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ pub mod Minifilters;
::windows_targets::link!("ntdll.dll" "system" #[doc = "Required features: `\"Win32_System_Kernel\"`"] fn RtlPrefixString(string1 : *const super::super::super::Win32::System::Kernel:: STRING, string2 : *const super::super::super::Win32::System::Kernel:: STRING, caseinsensitive : super::super::super::Win32::Foundation:: BOOLEAN) -> super::super::super::Win32::Foundation:: BOOLEAN);
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryPackageIdentity(tokenobject : *const ::core::ffi::c_void, packagefullname : ::windows_sys::core::PWSTR, packagesize : *mut usize, appid : ::windows_sys::core::PWSTR, appidsize : *mut usize, packaged : *mut super::super::super::Win32::Foundation:: BOOLEAN) -> super::super::super::Win32::Foundation:: NTSTATUS);
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryPackageIdentityEx(tokenobject : *const ::core::ffi::c_void, packagefullname : ::windows_sys::core::PWSTR, packagesize : *mut usize, appid : ::windows_sys::core::PWSTR, appidsize : *mut usize, dynamicid : *mut ::windows_sys::core::GUID, flags : *mut u64) -> super::super::super::Win32::Foundation:: NTSTATUS);
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryProcessPlaceholderCompatibilityMode() -> u8);
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryThreadPlaceholderCompatibilityMode() -> u8);
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryProcessPlaceholderCompatibilityMode() -> i8);
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryThreadPlaceholderCompatibilityMode() -> i8);
::windows_targets::link!("ntdll.dll" "system" fn RtlRandom(seed : *mut u32) -> u32);
::windows_targets::link!("ntdll.dll" "system" fn RtlRandomEx(seed : *mut u32) -> u32);
#[cfg(feature = "Wdk_Foundation")]
Expand All @@ -849,8 +849,8 @@ pub mod Minifilters;
::windows_targets::link!("ntdll.dll" "system" #[doc = "Required features: `\"Win32_Security\"`"] fn RtlSetGroupSecurityDescriptor(securitydescriptor : super::super::super::Win32::Security:: PSECURITY_DESCRIPTOR, group : super::super::super::Win32::Foundation:: PSID, groupdefaulted : super::super::super::Win32::Foundation:: BOOLEAN) -> super::super::super::Win32::Foundation:: NTSTATUS);
#[cfg(feature = "Win32_Security")]
::windows_targets::link!("ntdll.dll" "system" #[doc = "Required features: `\"Win32_Security\"`"] fn RtlSetOwnerSecurityDescriptor(securitydescriptor : super::super::super::Win32::Security:: PSECURITY_DESCRIPTOR, owner : super::super::super::Win32::Foundation:: PSID, ownerdefaulted : super::super::super::Win32::Foundation:: BOOLEAN) -> super::super::super::Win32::Foundation:: NTSTATUS);
::windows_targets::link!("ntdll.dll" "system" fn RtlSetProcessPlaceholderCompatibilityMode(mode : u8) -> u8);
::windows_targets::link!("ntdll.dll" "system" fn RtlSetThreadPlaceholderCompatibilityMode(mode : u8) -> u8);
::windows_targets::link!("ntdll.dll" "system" fn RtlSetProcessPlaceholderCompatibilityMode(mode : i8) -> i8);
::windows_targets::link!("ntdll.dll" "system" fn RtlSetThreadPlaceholderCompatibilityMode(mode : i8) -> i8);
::windows_targets::link!("ntdll.dll" "system" fn RtlSubAuthorityCountSid(sid : super::super::super::Win32::Foundation:: PSID) -> *mut u8);
::windows_targets::link!("ntdll.dll" "system" fn RtlSubAuthoritySid(sid : super::super::super::Win32::Foundation:: PSID, subauthority : u32) -> *mut u32);
::windows_targets::link!("ntdll.dll" "system" fn RtlTimeToSecondsSince1980(time : *const i64, elapsedseconds : *mut u32) -> super::super::super::Win32::Foundation:: BOOLEAN);
Expand Down Expand Up @@ -2599,7 +2599,7 @@ pub struct FILE_FULL_EA_INFORMATION {
pub Flags: u8,
pub EaNameLength: u8,
pub EaValueLength: u16,
pub EaName: [u8; 1],
pub EaName: [i8; 1],
}
impl ::core::marker::Copy for FILE_FULL_EA_INFORMATION {}
impl ::core::clone::Clone for FILE_FULL_EA_INFORMATION {
Expand All @@ -2611,7 +2611,7 @@ impl ::core::clone::Clone for FILE_FULL_EA_INFORMATION {
pub struct FILE_GET_EA_INFORMATION {
pub NextEntryOffset: u32,
pub EaNameLength: u8,
pub EaName: [u8; 1],
pub EaName: [i8; 1],
}
impl ::core::marker::Copy for FILE_GET_EA_INFORMATION {}
impl ::core::clone::Clone for FILE_GET_EA_INFORMATION {
Expand Down Expand Up @@ -3189,7 +3189,7 @@ pub struct FILE_PIPE_PEEK_BUFFER {
pub ReadDataAvailable: u32,
pub NumberOfMessages: u32,
pub MessageLength: u32,
pub Data: [u8; 1],
pub Data: [i8; 1],
}
impl ::core::marker::Copy for FILE_PIPE_PEEK_BUFFER {}
impl ::core::clone::Clone for FILE_PIPE_PEEK_BUFFER {
Expand Down Expand Up @@ -3489,7 +3489,7 @@ impl ::core::clone::Clone for FILE_TIMESTAMPS {
pub struct FILE_TRACKING_INFORMATION {
pub DestinationFile: super::super::super::Win32::Foundation::HANDLE,
pub ObjectInformationLength: u32,
pub ObjectInformation: [u8; 1],
pub ObjectInformation: [i8; 1],
}
impl ::core::marker::Copy for FILE_TRACKING_INFORMATION {}
impl ::core::clone::Clone for FILE_TRACKING_INFORMATION {
Expand Down
26 changes: 13 additions & 13 deletions crates/libs/sys/src/Windows/Wdk/System/SystemServices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@
::windows_targets::link!("ntdll.dll" "system" fn RtlUnicodeToUTF8N(utf8stringdestination : ::windows_sys::core::PSTR, utf8stringmaxbytecount : u32, utf8stringactualbytecount : *mut u32, unicodestringsource : *const u16, unicodestringbytecount : u32) -> super::super::super::Win32::Foundation:: NTSTATUS);
::windows_targets::link!("ntdll.dll" "system" fn RtlUpcaseUnicodeChar(sourcecharacter : u16) -> u16);
::windows_targets::link!("ntdll.dll" "system" fn RtlUpcaseUnicodeString(destinationstring : *mut super::super::super::Win32::Foundation:: UNICODE_STRING, sourcestring : *const super::super::super::Win32::Foundation:: UNICODE_STRING, allocatedestinationstring : super::super::super::Win32::Foundation:: BOOLEAN) -> super::super::super::Win32::Foundation:: NTSTATUS);
::windows_targets::link!("ntdll.dll" "system" fn RtlUpperChar(character : u8) -> u8);
::windows_targets::link!("ntdll.dll" "system" fn RtlUpperChar(character : i8) -> i8);
#[cfg(feature = "Win32_System_Kernel")]
::windows_targets::link!("ntdll.dll" "system" #[doc = "Required features: `\"Win32_System_Kernel\"`"] fn RtlUpperString(destinationstring : *mut super::super::super::Win32::System::Kernel:: STRING, sourcestring : *const super::super::super::Win32::System::Kernel:: STRING));
#[cfg(feature = "Win32_Security")]
Expand Down Expand Up @@ -5269,7 +5269,7 @@ impl ::core::clone::Clone for CM_EISA_SLOT_INFORMATION {
pub struct CM_FLOPPY_DEVICE_DATA {
pub Version: u16,
pub Revision: u16,
pub Size: [u8; 8],
pub Size: [i8; 8],
pub MaxDensity: u32,
pub MountDensity: u32,
pub StepRateHeadUnloadTime: u8,
Expand Down Expand Up @@ -14885,7 +14885,7 @@ pub struct RTL_BALANCED_LINKS {
pub Parent: *mut RTL_BALANCED_LINKS,
pub LeftChild: *mut RTL_BALANCED_LINKS,
pub RightChild: *mut RTL_BALANCED_LINKS,
pub Balance: u8,
pub Balance: i8,
pub Reserved: [u8; 3],
}
impl ::core::marker::Copy for RTL_BALANCED_LINKS {}
Expand Down Expand Up @@ -15156,7 +15156,7 @@ pub struct SOC_SUBSYSTEM_FAILURE_DETAILS {
pub FirmwareVersion: u64,
pub HardwareVersion: u64,
pub UnifiedFailureRegionSize: u32,
pub UnifiedFailureRegion: [u8; 1],
pub UnifiedFailureRegion: [i8; 1],
}
impl ::core::marker::Copy for SOC_SUBSYSTEM_FAILURE_DETAILS {}
impl ::core::clone::Clone for SOC_SUBSYSTEM_FAILURE_DETAILS {
Expand Down Expand Up @@ -15582,8 +15582,8 @@ impl ::core::clone::Clone for WHEA128A {
#[repr(C)]
pub struct WHEAP_ACPI_TIMEOUT_EVENT {
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
pub TableType: [u8; 32],
pub TableRequest: [u8; 32],
pub TableType: [i8; 32],
pub TableRequest: [i8; 32],
}
impl ::core::marker::Copy for WHEAP_ACPI_TIMEOUT_EVENT {}
impl ::core::clone::Clone for WHEAP_ACPI_TIMEOUT_EVENT {
Expand Down Expand Up @@ -15692,7 +15692,7 @@ impl ::core::clone::Clone for WHEAP_CMCI_RESTART_EVENT {
#[repr(C, packed(1))]
pub struct WHEAP_CREATE_GENERIC_RECORD_EVENT {
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
pub Error: [u8; 32],
pub Error: [i8; 32],
pub EntryCount: u32,
pub Status: super::super::super::Win32::Foundation::NTSTATUS,
}
Expand Down Expand Up @@ -15720,7 +15720,7 @@ impl ::core::clone::Clone for WHEAP_DEFERRED_EVENT {
#[repr(C)]
pub struct WHEAP_DEVICE_DRV_EVENT {
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
pub Function: [u8; 32],
pub Function: [i8; 32],
}
impl ::core::marker::Copy for WHEAP_DEVICE_DRV_EVENT {}
impl ::core::clone::Clone for WHEAP_DEVICE_DRV_EVENT {
Expand Down Expand Up @@ -15814,7 +15814,7 @@ impl ::core::clone::Clone for WHEAP_ERR_SRC_ARRAY_INVALID_EVENT {
pub struct WHEAP_ERR_SRC_INVALID_EVENT {
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
pub ErrDescriptor: super::super::super::Win32::System::Diagnostics::Debug::WHEA_ERROR_SOURCE_DESCRIPTOR,
pub Error: [u8; 32],
pub Error: [i8; 32],
}
#[cfg(feature = "Win32_System_Diagnostics_Debug")]
impl ::core::marker::Copy for WHEAP_ERR_SRC_INVALID_EVENT {}
Expand All @@ -15841,7 +15841,7 @@ impl ::core::clone::Clone for WHEAP_FOUND_ERROR_IN_BANK_EVENT {
#[repr(C, packed(1))]
pub struct WHEAP_GENERIC_ERR_MEM_MAP_EVENT {
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
pub MapReason: [u8; 32],
pub MapReason: [i8; 32],
pub PhysicalAddress: u64,
pub Length: u64,
}
Expand Down Expand Up @@ -16002,7 +16002,7 @@ impl ::core::clone::Clone for WHEAP_PLUGIN_PFA_EVENT {
#[repr(C, packed(1))]
pub struct WHEAP_PROCESS_EINJ_EVENT {
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
pub Error: [u8; 32],
pub Error: [i8; 32],
pub InjectionActionTableValid: super::super::super::Win32::Foundation::BOOLEAN,
pub BeginInjectionInstructionCount: u32,
pub GetTriggerErrorActionTableInstructionCount: u32,
Expand All @@ -16024,8 +16024,8 @@ impl ::core::clone::Clone for WHEAP_PROCESS_EINJ_EVENT {
#[repr(C, packed(1))]
pub struct WHEAP_PROCESS_HEST_EVENT {
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
pub Error: [u8; 32],
pub EntryType: [u8; 32],
pub Error: [i8; 32],
pub EntryType: [i8; 32],
pub EntryIndex: u32,
pub HestValid: super::super::super::Win32::Foundation::BOOLEAN,
pub CmcCount: u32,
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/sys/src/Windows/Win32/Devices/Bluetooth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ pub struct BTH_DEVICE_INFO {
pub flags: u32,
pub address: u64,
pub classOfDevice: u32,
pub name: [u8; 248],
pub name: [i8; 248],
}
impl ::core::marker::Copy for BTH_DEVICE_INFO {}
impl ::core::clone::Clone for BTH_DEVICE_INFO {
Expand Down Expand Up @@ -1572,7 +1572,7 @@ pub union SDP_ELEMENT_DATA_0 {
pub int64: i64,
pub int32: i32,
pub int16: i16,
pub int8: u8,
pub int8: i8,
pub uint128: SDP_ULARGE_INTEGER_16,
pub uint64: u64,
pub uint32: u32,
Expand Down
12 changes: 6 additions & 6 deletions crates/libs/sys/src/Windows/Win32/Devices/Communication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
::windows_targets::link!("kernel32.dll" "system" fn SetDefaultCommConfigA(lpszname : ::windows_sys::core::PCSTR, lpcc : *const COMMCONFIG, dwsize : u32) -> super::super::Foundation:: BOOL);
::windows_targets::link!("kernel32.dll" "system" fn SetDefaultCommConfigW(lpszname : ::windows_sys::core::PCWSTR, lpcc : *const COMMCONFIG, dwsize : u32) -> super::super::Foundation:: BOOL);
::windows_targets::link!("kernel32.dll" "system" fn SetupComm(hfile : super::super::Foundation:: HANDLE, dwinqueue : u32, dwoutqueue : u32) -> super::super::Foundation:: BOOL);
::windows_targets::link!("kernel32.dll" "system" fn TransmitCommChar(hfile : super::super::Foundation:: HANDLE, cchar : u8) -> super::super::Foundation:: BOOL);
::windows_targets::link!("kernel32.dll" "system" fn TransmitCommChar(hfile : super::super::Foundation:: HANDLE, cchar : i8) -> super::super::Foundation:: BOOL);
#[cfg(feature = "Win32_System_IO")]
::windows_targets::link!("kernel32.dll" "system" #[doc = "Required features: `\"Win32_System_IO\"`"] fn WaitCommEvent(hfile : super::super::Foundation:: HANDLE, lpevtmask : *mut COMM_EVENT_MASK, lpoverlapped : *mut super::super::System::IO:: OVERLAPPED) -> super::super::Foundation:: BOOL);
pub const CE_BREAK: CLEAR_COMM_ERROR_FLAGS = 16u32;
Expand Down Expand Up @@ -282,11 +282,11 @@ pub struct DCB {
pub ByteSize: u8,
pub Parity: DCB_PARITY,
pub StopBits: DCB_STOP_BITS,
pub XonChar: u8,
pub XoffChar: u8,
pub ErrorChar: u8,
pub EofChar: u8,
pub EvtChar: u8,
pub XonChar: i8,
pub XoffChar: i8,
pub ErrorChar: i8,
pub EofChar: i8,
pub EvtChar: i8,
pub wReserved1: u16,
}
impl ::core::marker::Copy for DCB {}
Expand Down
Loading

0 comments on commit 7c400dc

Please sign in to comment.