Skip to content

Commit 7c400dc

Browse files
authored
Use signed byte for C's char type (#2781)
1 parent 3ee83d5 commit 7c400dc

141 files changed

Lines changed: 1266 additions & 1266 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crates/libs/metadata/src/reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,4 @@ impl Reader {
252252
pub const REMAP_TYPES: [(TypeName, TypeName); 2] = [(TypeName::D2D_MATRIX_3X2_F, TypeName::Matrix3x2), (TypeName::D3DMATRIX, TypeName::Matrix4x4)];
253253

254254
// TODO: get rid of at least the second tuple if not the whole thing.
255-
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)];
255+
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)];

crates/libs/sys/src/Windows/Wdk/Foundation/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,8 @@ pub struct IRP {
15161516
pub IoStatus: super::super::Win32::System::IO::IO_STATUS_BLOCK,
15171517
pub RequestorMode: i8,
15181518
pub PendingReturned: super::super::Win32::Foundation::BOOLEAN,
1519-
pub StackCount: u8,
1520-
pub CurrentLocation: u8,
1519+
pub StackCount: i8,
1520+
pub CurrentLocation: i8,
15211521
pub Cancel: super::super::Win32::Foundation::BOOLEAN,
15221522
pub CancelIrql: u8,
15231523
pub ApcEnvironment: i8,

crates/libs/sys/src/Windows/Wdk/Graphics/Direct3D/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15332,7 +15332,7 @@ pub struct OUTPUTDUPL_CONTEXT_DEBUG_INFO {
1533215332
pub AccumulatedPresents: u32,
1533315333
pub LastPresentTime: i64,
1533415334
pub LastMouseTime: i64,
15335-
pub ProcessName: [u8; 16],
15335+
pub ProcessName: [i8; 16],
1533615336
}
1533715337
impl ::core::marker::Copy for OUTPUTDUPL_CONTEXT_DEBUG_INFO {}
1533815338
impl ::core::clone::Clone for OUTPUTDUPL_CONTEXT_DEBUG_INFO {

crates/libs/sys/src/Windows/Wdk/NetworkManagement/Ndis/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4130,7 +4130,7 @@ pub struct NDIS_WMI_ENUM_ADAPTER {
41304130
pub IfIndex: u32,
41314131
pub NetLuid: super::super::super::Win32::NetworkManagement::Ndis::NET_LUID_LH,
41324132
pub DeviceNameLength: u16,
4133-
pub DeviceName: [u8; 1],
4133+
pub DeviceName: [i8; 1],
41344134
}
41354135
#[cfg(feature = "Win32_NetworkManagement_Ndis")]
41364136
impl ::core::marker::Copy for NDIS_WMI_ENUM_ADAPTER {}

crates/libs/sys/src/Windows/Wdk/Storage/FileSystem/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@ pub mod Minifilters;
832832
::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);
833833
::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);
834834
::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);
835-
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryProcessPlaceholderCompatibilityMode() -> u8);
836-
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryThreadPlaceholderCompatibilityMode() -> u8);
835+
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryProcessPlaceholderCompatibilityMode() -> i8);
836+
::windows_targets::link!("ntdll.dll" "system" fn RtlQueryThreadPlaceholderCompatibilityMode() -> i8);
837837
::windows_targets::link!("ntdll.dll" "system" fn RtlRandom(seed : *mut u32) -> u32);
838838
::windows_targets::link!("ntdll.dll" "system" fn RtlRandomEx(seed : *mut u32) -> u32);
839839
#[cfg(feature = "Wdk_Foundation")]
@@ -849,8 +849,8 @@ pub mod Minifilters;
849849
::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);
850850
#[cfg(feature = "Win32_Security")]
851851
::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);
852-
::windows_targets::link!("ntdll.dll" "system" fn RtlSetProcessPlaceholderCompatibilityMode(mode : u8) -> u8);
853-
::windows_targets::link!("ntdll.dll" "system" fn RtlSetThreadPlaceholderCompatibilityMode(mode : u8) -> u8);
852+
::windows_targets::link!("ntdll.dll" "system" fn RtlSetProcessPlaceholderCompatibilityMode(mode : i8) -> i8);
853+
::windows_targets::link!("ntdll.dll" "system" fn RtlSetThreadPlaceholderCompatibilityMode(mode : i8) -> i8);
854854
::windows_targets::link!("ntdll.dll" "system" fn RtlSubAuthorityCountSid(sid : super::super::super::Win32::Foundation:: PSID) -> *mut u8);
855855
::windows_targets::link!("ntdll.dll" "system" fn RtlSubAuthoritySid(sid : super::super::super::Win32::Foundation:: PSID, subauthority : u32) -> *mut u32);
856856
::windows_targets::link!("ntdll.dll" "system" fn RtlTimeToSecondsSince1980(time : *const i64, elapsedseconds : *mut u32) -> super::super::super::Win32::Foundation:: BOOLEAN);
@@ -2599,7 +2599,7 @@ pub struct FILE_FULL_EA_INFORMATION {
25992599
pub Flags: u8,
26002600
pub EaNameLength: u8,
26012601
pub EaValueLength: u16,
2602-
pub EaName: [u8; 1],
2602+
pub EaName: [i8; 1],
26032603
}
26042604
impl ::core::marker::Copy for FILE_FULL_EA_INFORMATION {}
26052605
impl ::core::clone::Clone for FILE_FULL_EA_INFORMATION {
@@ -2611,7 +2611,7 @@ impl ::core::clone::Clone for FILE_FULL_EA_INFORMATION {
26112611
pub struct FILE_GET_EA_INFORMATION {
26122612
pub NextEntryOffset: u32,
26132613
pub EaNameLength: u8,
2614-
pub EaName: [u8; 1],
2614+
pub EaName: [i8; 1],
26152615
}
26162616
impl ::core::marker::Copy for FILE_GET_EA_INFORMATION {}
26172617
impl ::core::clone::Clone for FILE_GET_EA_INFORMATION {
@@ -3189,7 +3189,7 @@ pub struct FILE_PIPE_PEEK_BUFFER {
31893189
pub ReadDataAvailable: u32,
31903190
pub NumberOfMessages: u32,
31913191
pub MessageLength: u32,
3192-
pub Data: [u8; 1],
3192+
pub Data: [i8; 1],
31933193
}
31943194
impl ::core::marker::Copy for FILE_PIPE_PEEK_BUFFER {}
31953195
impl ::core::clone::Clone for FILE_PIPE_PEEK_BUFFER {
@@ -3489,7 +3489,7 @@ impl ::core::clone::Clone for FILE_TIMESTAMPS {
34893489
pub struct FILE_TRACKING_INFORMATION {
34903490
pub DestinationFile: super::super::super::Win32::Foundation::HANDLE,
34913491
pub ObjectInformationLength: u32,
3492-
pub ObjectInformation: [u8; 1],
3492+
pub ObjectInformation: [i8; 1],
34933493
}
34943494
impl ::core::marker::Copy for FILE_TRACKING_INFORMATION {}
34953495
impl ::core::clone::Clone for FILE_TRACKING_INFORMATION {

crates/libs/sys/src/Windows/Wdk/System/SystemServices/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@
15751575
::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);
15761576
::windows_targets::link!("ntdll.dll" "system" fn RtlUpcaseUnicodeChar(sourcecharacter : u16) -> u16);
15771577
::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);
1578-
::windows_targets::link!("ntdll.dll" "system" fn RtlUpperChar(character : u8) -> u8);
1578+
::windows_targets::link!("ntdll.dll" "system" fn RtlUpperChar(character : i8) -> i8);
15791579
#[cfg(feature = "Win32_System_Kernel")]
15801580
::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));
15811581
#[cfg(feature = "Win32_Security")]
@@ -5269,7 +5269,7 @@ impl ::core::clone::Clone for CM_EISA_SLOT_INFORMATION {
52695269
pub struct CM_FLOPPY_DEVICE_DATA {
52705270
pub Version: u16,
52715271
pub Revision: u16,
5272-
pub Size: [u8; 8],
5272+
pub Size: [i8; 8],
52735273
pub MaxDensity: u32,
52745274
pub MountDensity: u32,
52755275
pub StepRateHeadUnloadTime: u8,
@@ -14885,7 +14885,7 @@ pub struct RTL_BALANCED_LINKS {
1488514885
pub Parent: *mut RTL_BALANCED_LINKS,
1488614886
pub LeftChild: *mut RTL_BALANCED_LINKS,
1488714887
pub RightChild: *mut RTL_BALANCED_LINKS,
14888-
pub Balance: u8,
14888+
pub Balance: i8,
1488914889
pub Reserved: [u8; 3],
1489014890
}
1489114891
impl ::core::marker::Copy for RTL_BALANCED_LINKS {}
@@ -15156,7 +15156,7 @@ pub struct SOC_SUBSYSTEM_FAILURE_DETAILS {
1515615156
pub FirmwareVersion: u64,
1515715157
pub HardwareVersion: u64,
1515815158
pub UnifiedFailureRegionSize: u32,
15159-
pub UnifiedFailureRegion: [u8; 1],
15159+
pub UnifiedFailureRegion: [i8; 1],
1516015160
}
1516115161
impl ::core::marker::Copy for SOC_SUBSYSTEM_FAILURE_DETAILS {}
1516215162
impl ::core::clone::Clone for SOC_SUBSYSTEM_FAILURE_DETAILS {
@@ -15582,8 +15582,8 @@ impl ::core::clone::Clone for WHEA128A {
1558215582
#[repr(C)]
1558315583
pub struct WHEAP_ACPI_TIMEOUT_EVENT {
1558415584
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
15585-
pub TableType: [u8; 32],
15586-
pub TableRequest: [u8; 32],
15585+
pub TableType: [i8; 32],
15586+
pub TableRequest: [i8; 32],
1558715587
}
1558815588
impl ::core::marker::Copy for WHEAP_ACPI_TIMEOUT_EVENT {}
1558915589
impl ::core::clone::Clone for WHEAP_ACPI_TIMEOUT_EVENT {
@@ -15692,7 +15692,7 @@ impl ::core::clone::Clone for WHEAP_CMCI_RESTART_EVENT {
1569215692
#[repr(C, packed(1))]
1569315693
pub struct WHEAP_CREATE_GENERIC_RECORD_EVENT {
1569415694
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
15695-
pub Error: [u8; 32],
15695+
pub Error: [i8; 32],
1569615696
pub EntryCount: u32,
1569715697
pub Status: super::super::super::Win32::Foundation::NTSTATUS,
1569815698
}
@@ -15720,7 +15720,7 @@ impl ::core::clone::Clone for WHEAP_DEFERRED_EVENT {
1572015720
#[repr(C)]
1572115721
pub struct WHEAP_DEVICE_DRV_EVENT {
1572215722
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
15723-
pub Function: [u8; 32],
15723+
pub Function: [i8; 32],
1572415724
}
1572515725
impl ::core::marker::Copy for WHEAP_DEVICE_DRV_EVENT {}
1572615726
impl ::core::clone::Clone for WHEAP_DEVICE_DRV_EVENT {
@@ -15814,7 +15814,7 @@ impl ::core::clone::Clone for WHEAP_ERR_SRC_ARRAY_INVALID_EVENT {
1581415814
pub struct WHEAP_ERR_SRC_INVALID_EVENT {
1581515815
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
1581615816
pub ErrDescriptor: super::super::super::Win32::System::Diagnostics::Debug::WHEA_ERROR_SOURCE_DESCRIPTOR,
15817-
pub Error: [u8; 32],
15817+
pub Error: [i8; 32],
1581815818
}
1581915819
#[cfg(feature = "Win32_System_Diagnostics_Debug")]
1582015820
impl ::core::marker::Copy for WHEAP_ERR_SRC_INVALID_EVENT {}
@@ -15841,7 +15841,7 @@ impl ::core::clone::Clone for WHEAP_FOUND_ERROR_IN_BANK_EVENT {
1584115841
#[repr(C, packed(1))]
1584215842
pub struct WHEAP_GENERIC_ERR_MEM_MAP_EVENT {
1584315843
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
15844-
pub MapReason: [u8; 32],
15844+
pub MapReason: [i8; 32],
1584515845
pub PhysicalAddress: u64,
1584615846
pub Length: u64,
1584715847
}
@@ -16002,7 +16002,7 @@ impl ::core::clone::Clone for WHEAP_PLUGIN_PFA_EVENT {
1600216002
#[repr(C, packed(1))]
1600316003
pub struct WHEAP_PROCESS_EINJ_EVENT {
1600416004
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
16005-
pub Error: [u8; 32],
16005+
pub Error: [i8; 32],
1600616006
pub InjectionActionTableValid: super::super::super::Win32::Foundation::BOOLEAN,
1600716007
pub BeginInjectionInstructionCount: u32,
1600816008
pub GetTriggerErrorActionTableInstructionCount: u32,
@@ -16024,8 +16024,8 @@ impl ::core::clone::Clone for WHEAP_PROCESS_EINJ_EVENT {
1602416024
#[repr(C, packed(1))]
1602516025
pub struct WHEAP_PROCESS_HEST_EVENT {
1602616026
pub WheaEventLogEntry: WHEA_EVENT_LOG_ENTRY,
16027-
pub Error: [u8; 32],
16028-
pub EntryType: [u8; 32],
16027+
pub Error: [i8; 32],
16028+
pub EntryType: [i8; 32],
1602916029
pub EntryIndex: u32,
1603016030
pub HestValid: super::super::super::Win32::Foundation::BOOLEAN,
1603116031
pub CmcCount: u32,

crates/libs/sys/src/Windows/Win32/Devices/Bluetooth/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ pub struct BTH_DEVICE_INFO {
11981198
pub flags: u32,
11991199
pub address: u64,
12001200
pub classOfDevice: u32,
1201-
pub name: [u8; 248],
1201+
pub name: [i8; 248],
12021202
}
12031203
impl ::core::marker::Copy for BTH_DEVICE_INFO {}
12041204
impl ::core::clone::Clone for BTH_DEVICE_INFO {
@@ -1572,7 +1572,7 @@ pub union SDP_ELEMENT_DATA_0 {
15721572
pub int64: i64,
15731573
pub int32: i32,
15741574
pub int16: i16,
1575-
pub int8: u8,
1575+
pub int8: i8,
15761576
pub uint128: SDP_ULARGE_INTEGER_16,
15771577
pub uint64: u64,
15781578
pub uint32: u32,

crates/libs/sys/src/Windows/Win32/Devices/Communication/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
::windows_targets::link!("kernel32.dll" "system" fn SetDefaultCommConfigA(lpszname : ::windows_sys::core::PCSTR, lpcc : *const COMMCONFIG, dwsize : u32) -> super::super::Foundation:: BOOL);
2727
::windows_targets::link!("kernel32.dll" "system" fn SetDefaultCommConfigW(lpszname : ::windows_sys::core::PCWSTR, lpcc : *const COMMCONFIG, dwsize : u32) -> super::super::Foundation:: BOOL);
2828
::windows_targets::link!("kernel32.dll" "system" fn SetupComm(hfile : super::super::Foundation:: HANDLE, dwinqueue : u32, dwoutqueue : u32) -> super::super::Foundation:: BOOL);
29-
::windows_targets::link!("kernel32.dll" "system" fn TransmitCommChar(hfile : super::super::Foundation:: HANDLE, cchar : u8) -> super::super::Foundation:: BOOL);
29+
::windows_targets::link!("kernel32.dll" "system" fn TransmitCommChar(hfile : super::super::Foundation:: HANDLE, cchar : i8) -> super::super::Foundation:: BOOL);
3030
#[cfg(feature = "Win32_System_IO")]
3131
::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);
3232
pub const CE_BREAK: CLEAR_COMM_ERROR_FLAGS = 16u32;
@@ -282,11 +282,11 @@ pub struct DCB {
282282
pub ByteSize: u8,
283283
pub Parity: DCB_PARITY,
284284
pub StopBits: DCB_STOP_BITS,
285-
pub XonChar: u8,
286-
pub XoffChar: u8,
287-
pub ErrorChar: u8,
288-
pub EofChar: u8,
289-
pub EvtChar: u8,
285+
pub XonChar: i8,
286+
pub XoffChar: i8,
287+
pub ErrorChar: i8,
288+
pub EofChar: i8,
289+
pub EvtChar: i8,
290290
pub wReserved1: u16,
291291
}
292292
impl ::core::marker::Copy for DCB {}

0 commit comments

Comments
 (0)