diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index 0b9ad0e65..416fccaa5 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -941,8 +941,7 @@ error_out: static rdpPrinterDriver* printer_load_backend(const char* backend) { typedef rdpPrinterDriver* (*backend_load_t)(void); - union - { + union { PVIRTUALCHANNELENTRY entry; backend_load_t backend; } fktconv; diff --git a/channels/rdpdr/client/devman.c b/channels/rdpdr/client/devman.c index e2639a600..af3cdd6b2 100644 --- a/channels/rdpdr/client/devman.c +++ b/channels/rdpdr/client/devman.c @@ -183,8 +183,7 @@ UINT devman_load_device_service(DEVMAN* devman, const RDPDR_DEVICE* device, rdpC const char* ServiceName = NULL; DEVICE_SERVICE_ENTRY_POINTS ep; PDEVICE_SERVICE_ENTRY entry = NULL; - union - { + union { const RDPDR_DEVICE* cdp; RDPDR_DEVICE* dp; } devconv; diff --git a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c index 22ba77377..3481d9130 100644 --- a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c +++ b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c @@ -257,8 +257,7 @@ static BOOL rdpsnd_opensles_set_volume(rdpsndDevicePlugin* device, UINT32 value) static UINT rdpsnd_opensles_play(rdpsndDevicePlugin* device, const BYTE* data, size_t size) { - union - { + union { const BYTE* b; const short* s; } src; diff --git a/channels/rdpsnd/client/proxy/rdpsnd_proxy.c b/channels/rdpsnd/client/proxy/rdpsnd_proxy.c index 88f7bf5d7..58e3019a4 100644 --- a/channels/rdpsnd/client/proxy/rdpsnd_proxy.c +++ b/channels/rdpsnd/client/proxy/rdpsnd_proxy.c @@ -95,6 +95,7 @@ static UINT rdpsnd_proxy_play(rdpsndDevicePlugin* device, const BYTE* data, size return GetTickCount() - start; } + /** * Function description * diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index 3444cb69d..afe67b4d3 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -145,7 +145,7 @@ static UINT serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp) if (!Stream_SafeSeek(irp->input, PathLength)) /* Path (variable) */ return ERROR_INVALID_DATA; - assert(PathLength == 0); /* MS-RDPESP 2.2.2.2 */ + assert(PathLength == 0); /* MS-RDPESP 2.2.2.2 */ #ifndef _WIN32 /* Windows 2012 server sends on a first call : * DesiredAccess = 0x00100080: SYNCHRONIZE | FILE_READ_ATTRIBUTES diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 91ce31acd..4639b1778 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -699,14 +699,12 @@ static LONG smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_O DWORD cchReaders = 0; IRP* irp = operation->irp; ListReaders_Call* call = &operation->call.listReaders; - union - { + union { const BYTE* bp; const char* sz; const WCHAR* wz; } string; - union - { + union { WCHAR** ppw; WCHAR* pw; CHAR* pc; diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index 84d31ebcd..66e1aa01c 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -517,6 +517,7 @@ static LIBUSB_DEVICE_DESCRIPTOR* udev_new_descript(URBDRC_PLUGIN* urbdrc, LIBUSB return descriptor; } + static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BYTE AlternateSetting) { int error = 0, diff = 0; diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index 3a875e51d..8ad777286 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -434,8 +434,7 @@ static void xf_input_touch_end(xfContext* xfc, XIDeviceEvent* event) static int xf_input_handle_event_local(xfContext* xfc, const XEvent* event) { - union - { + union { const XGenericEventCookie* cc; XGenericEventCookie* vc; } cookie; @@ -609,8 +608,7 @@ static int xf_input_event(xfContext* xfc, XIDeviceEvent* event, int evtype) static int xf_input_handle_event_remote(xfContext* xfc, const XEvent* event) { - union - { + union { const XGenericEventCookie* cc; XGenericEventCookie* vc; } cookie; diff --git a/libfreerdp/codec/dsp.c b/libfreerdp/codec/dsp.c index d8a583b69..a5039cea5 100644 --- a/libfreerdp/codec/dsp.c +++ b/libfreerdp/codec/dsp.c @@ -61,8 +61,7 @@ #if !defined(WITH_DSP_FFMPEG) -union _ADPCM -{ +union _ADPCM { struct { INT16 last_sample[2]; diff --git a/libfreerdp/codec/nsc_encode.c b/libfreerdp/codec/nsc_encode.c index 5f21984fa..fd9626a6d 100644 --- a/libfreerdp/codec/nsc_encode.c +++ b/libfreerdp/codec/nsc_encode.c @@ -289,7 +289,7 @@ static BOOL nsc_encode_subsampling(NSC_CONTEXT* context) if (tempWidth > context->priv->PlaneBuffersLength / tempHeight) return FALSE; - for (y = 0; y < tempHeight >> 1; y++) + for (y = 0; y> 1; y++) { UINT32 x; BYTE* co_dst = context->priv->PlaneBuffers[1] + y * (tempWidth >> 1); @@ -299,7 +299,7 @@ static BOOL nsc_encode_subsampling(NSC_CONTEXT* context) const INT8* cg_src0 = (INT8*)context->priv->PlaneBuffers[2] + (y << 1) * tempWidth; const INT8* cg_src1 = cg_src0 + tempWidth; - for (x = 0; x < tempWidth >> 1; x++) + for (x = 0; x> 1; x++) { *co_dst++ = (BYTE)(((INT16)*co_src0 + (INT16) * (co_src0 + 1) + (INT16)*co_src1 + (INT16) * (co_src1 + 1)) >> diff --git a/libfreerdp/codec/nsc_sse2.c b/libfreerdp/codec/nsc_sse2.c index 8e3e649d5..7f101652d 100644 --- a/libfreerdp/codec/nsc_sse2.c +++ b/libfreerdp/codec/nsc_sse2.c @@ -335,7 +335,7 @@ static void nsc_encode_subsampling_sse2(NSC_CONTEXT* context) tempWidth = ROUND_UP_TO(context->width, 8); tempHeight = ROUND_UP_TO(context->height, 2); - for (y = 0; y < tempHeight >> 1; y++) + for (y = 0; y> 1; y++) { UINT32 x; co_dst = context->priv->PlaneBuffers[1] + y * (tempWidth >> 1); @@ -345,7 +345,7 @@ static void nsc_encode_subsampling_sse2(NSC_CONTEXT* context) cg_src0 = (INT8*)context->priv->PlaneBuffers[2] + (y << 1) * tempWidth; cg_src1 = cg_src0 + tempWidth; - for (x = 0; x < tempWidth >> 1; x += 8) + for (x = 0; x> 1; x += 8) { t = _mm_loadu_si128((__m128i*)co_src0); t = _mm_avg_epu8(t, _mm_loadu_si128((__m128i*)co_src1)); diff --git a/libfreerdp/codec/planar.c b/libfreerdp/codec/planar.c index 618246862..f31c2d46a 100644 --- a/libfreerdp/codec/planar.c +++ b/libfreerdp/codec/planar.c @@ -20,7 +20,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +# include "config.h" #endif #include diff --git a/libfreerdp/core/capabilities.c b/libfreerdp/core/capabilities.c index 1a6c823ac..30edcbb1c 100644 --- a/libfreerdp/core/capabilities.c +++ b/libfreerdp/core/capabilities.c @@ -251,15 +251,15 @@ static BOOL rdp_write_general_capability_set(wStream* s, const rdpSettings* sett settings->OsMajorType, settings->OsMinorType, UINT16_MAX); return FALSE; } - Stream_Write_UINT16(s, (UINT16)settings->OsMajorType); /* osMajorType (2 bytes) */ - Stream_Write_UINT16(s, (UINT16)settings->OsMinorType); /* osMinorType (2 bytes) */ - Stream_Write_UINT16(s, CAPS_PROTOCOL_VERSION); /* protocolVersion (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ - Stream_Write_UINT16(s, 0); /* generalCompressionTypes (2 bytes) */ - Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ - Stream_Write_UINT16(s, 0); /* updateCapabilityFlag (2 bytes) */ - Stream_Write_UINT16(s, 0); /* remoteUnshareFlag (2 bytes) */ - Stream_Write_UINT16(s, 0); /* generalCompressionLevel (2 bytes) */ + Stream_Write_UINT16(s, (UINT16)settings->OsMajorType); /* osMajorType (2 bytes) */ + Stream_Write_UINT16(s, (UINT16)settings->OsMinorType); /* osMinorType (2 bytes) */ + Stream_Write_UINT16(s, CAPS_PROTOCOL_VERSION); /* protocolVersion (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */ + Stream_Write_UINT16(s, 0); /* generalCompressionTypes (2 bytes) */ + Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ + Stream_Write_UINT16(s, 0); /* updateCapabilityFlag (2 bytes) */ + Stream_Write_UINT16(s, 0); /* remoteUnshareFlag (2 bytes) */ + Stream_Write_UINT16(s, 0); /* generalCompressionLevel (2 bytes) */ Stream_Write_UINT8(s, settings->RefreshRect ? 1 : 0); /* refreshRectSupport (1 byte) */ Stream_Write_UINT8(s, settings->SuppressOutput ? 1 : 0); /* suppressOutputSupport (1 byte) */ return rdp_capability_set_finish(s, (UINT16)header, CAPSET_TYPE_GENERAL); @@ -420,19 +420,19 @@ static BOOL rdp_write_bitmap_capability_set(wStream* s, const rdpSettings* setti else preferredBitsPerPixel = 8; - Stream_Write_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ - Stream_Write_UINT16(s, 1); /* receive1BitPerPixel (2 bytes) */ - Stream_Write_UINT16(s, 1); /* receive4BitsPerPixel (2 bytes) */ - Stream_Write_UINT16(s, 1); /* receive8BitsPerPixel (2 bytes) */ + Stream_Write_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */ + Stream_Write_UINT16(s, 1); /* receive1BitPerPixel (2 bytes) */ + Stream_Write_UINT16(s, 1); /* receive4BitsPerPixel (2 bytes) */ + Stream_Write_UINT16(s, 1); /* receive8BitsPerPixel (2 bytes) */ Stream_Write_UINT16(s, (UINT16)settings->DesktopWidth); /* desktopWidth (2 bytes) */ Stream_Write_UINT16(s, (UINT16)settings->DesktopHeight); /* desktopHeight (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ Stream_Write_UINT16(s, (UINT16)settings->DesktopResize); /* desktopResizeFlag (2 bytes) */ - Stream_Write_UINT16(s, 1); /* bitmapCompressionFlag (2 bytes) */ - Stream_Write_UINT8(s, 0); /* highColorFlags (1 byte) */ - Stream_Write_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ - Stream_Write_UINT16(s, 1); /* multipleRectangleSupport (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2OctetsB (2 bytes) */ + Stream_Write_UINT16(s, 1); /* bitmapCompressionFlag (2 bytes) */ + Stream_Write_UINT8(s, 0); /* highColorFlags (1 byte) */ + Stream_Write_UINT8(s, drawingFlags); /* drawingFlags (1 byte) */ + Stream_Write_UINT16(s, 1); /* multipleRectangleSupport (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2OctetsB (2 bytes) */ return rdp_capability_set_finish(s, (UINT16)header, CAPSET_TYPE_BITMAP); } @@ -767,12 +767,12 @@ static BOOL rdp_write_bitmap_cache_capability_set(wStream* s, const rdpSettings* size = bpp * 256; if (size > UINT16_MAX) return FALSE; - Stream_Write_UINT16(s, 200); /* Cache0Entries (2 bytes) */ + Stream_Write_UINT16(s, 200); /* Cache0Entries (2 bytes) */ Stream_Write_UINT16(s, (UINT16)size); /* Cache0MaximumCellSize (2 bytes) */ size = bpp * 1024; if (size > UINT16_MAX) return FALSE; - Stream_Write_UINT16(s, 600); /* Cache1Entries (2 bytes) */ + Stream_Write_UINT16(s, 600); /* Cache1Entries (2 bytes) */ Stream_Write_UINT16(s, (UINT16)size); /* Cache1MaximumCellSize (2 bytes) */ size = bpp * 4096; if (size > UINT16_MAX) @@ -1026,7 +1026,7 @@ static BOOL rdp_write_pointer_capability_set(wStream* s, const rdpSettings* sett return FALSE; colorPointerFlag = (settings->ColorPointerFlag) ? 1 : 0; - Stream_Write_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ + Stream_Write_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ Stream_Write_UINT16(s, (UINT16)settings->PointerCacheSize); /* colorPointerCacheSize (2 bytes) */ @@ -1581,7 +1581,7 @@ static BOOL rdp_write_glyph_cache_capability_set(wStream* s, const rdpSettings* rdp_write_cache_definition(s, &(settings->GlyphCache[9])); /* glyphCache9 (4 bytes) */ rdp_write_cache_definition(s, settings->FragCache); /* fragCache (4 bytes) */ Stream_Write_UINT16(s, (UINT16)settings->GlyphSupportLevel); /* glyphSupportLevel (2 bytes) */ - Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ + Stream_Write_UINT16(s, 0); /* pad2Octets (2 bytes) */ return rdp_capability_set_finish(s, (UINT16)header, CAPSET_TYPE_GLYPH_CACHE); } @@ -3225,7 +3225,7 @@ static BOOL rdp_print_bitmap_codecs_capability_set(wStream* s) return FALSE; if (Stream_GetRemainingLength(s) < 3) return FALSE; - Stream_Read_UINT8(s, codecId); /* codecId (1 byte) */ + Stream_Read_UINT8(s, codecId); /* codecId (1 byte) */ WLog_INFO(TAG, "\tcodecGuid: 0x"); rdp_print_bitmap_codec_guid(&codecGuid); WLog_INFO(TAG, " (%s)", rdp_get_bitmap_codec_guid_name(&codecGuid)); @@ -4011,9 +4011,9 @@ static BOOL rdp_write_demand_active(wStream* s, rdpSettings* settings) if (lengthCombinedCapabilities > UINT16_MAX) return FALSE; Stream_Write_UINT16( - s, (UINT16)lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ - Stream_SetPosition(s, bm); /* go back to numberCapabilities */ - Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ + s, (UINT16)lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ + Stream_SetPosition(s, bm); /* go back to numberCapabilities */ + Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ #ifdef WITH_DEBUG_CAPABILITIES Stream_Seek_UINT16(s); rdp_print_capability_sets(s, numberCapabilities, FALSE); @@ -4243,9 +4243,9 @@ static BOOL rdp_write_confirm_active(wStream* s, rdpSettings* settings) if (lengthCombinedCapabilities > UINT16_MAX) return FALSE; Stream_Write_UINT16( - s, (UINT16)lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ - Stream_SetPosition(s, bm); /* go back to numberCapabilities */ - Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ + s, (UINT16)lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */ + Stream_SetPosition(s, bm); /* go back to numberCapabilities */ + Stream_Write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */ #ifdef WITH_DEBUG_CAPABILITIES Stream_Seek_UINT16(s); rdp_print_capability_sets(s, numberCapabilities, FALSE); diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index a8f2719f7..b8ecb4e33 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -448,8 +448,7 @@ BOOL freerdp_channels_data(freerdp* instance, UINT16 channelId, const BYTE* cdat rdpChannels* channels; rdpMcsChannel* channel = NULL; CHANNEL_OPEN_DATA* pChannelOpenData; - union - { + union { const BYTE* pcb; BYTE* pb; } data; diff --git a/libfreerdp/core/gateway/rpc.h b/libfreerdp/core/gateway/rpc.h index 81b86135c..1a58fe450 100644 --- a/libfreerdp/core/gateway/rpc.h +++ b/libfreerdp/core/gateway/rpc.h @@ -525,8 +525,7 @@ typedef struct rpcconn_common_hdr_t header; } rpcconn_shutdown_hdr_t; -typedef union -{ +typedef union { rpcconn_common_hdr_t common; rpcconn_alter_context_hdr_t alter_context; rpcconn_alter_context_response_hdr_t alter_context_response; diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 88301e743..3f8afaef2 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -466,8 +466,7 @@ fail: static BOOL rdp_read_info_string(UINT32 flags, wStream* s, size_t cbLenNonNull, CHAR** dst, size_t max) { - union - { + union { char c; WCHAR w; BYTE b[2]; @@ -714,8 +713,7 @@ static BOOL rdp_write_info_packet(rdpRdp* rdp, wStream* s) { if (settings->RedirectionPassword && settings->RedirectionPasswordLength > 0) { - union - { + union { BYTE* bp; WCHAR* wp; } ptrconv; @@ -918,8 +916,7 @@ static BOOL rdp_recv_logon_info_v1(rdpRdp* rdp, wStream* s, logon_info* info) { UINT32 cbDomain; UINT32 cbUserName; - union - { + union { BYTE* bp; WCHAR* wp; } ptrconv; diff --git a/server/proxy/pf_modules.c b/server/proxy/pf_modules.c index 103a78d0f..79ffb044c 100644 --- a/server/proxy/pf_modules.c +++ b/server/proxy/pf_modules.c @@ -204,8 +204,7 @@ BOOL pf_modules_run_filter(PF_FILTER_TYPE type, proxyData* pdata, void* param) */ static BOOL pf_modules_set_plugin_data(const char* plugin_name, proxyData* pdata, void* data) { - union - { + union { const char* ccp; char* cp; } ccharconv; @@ -234,8 +233,7 @@ static BOOL pf_modules_set_plugin_data(const char* plugin_name, proxyData* pdata */ static void* pf_modules_get_plugin_data(const char* plugin_name, proxyData* pdata) { - union - { + union { const char* ccp; char* cp; } ccharconv; diff --git a/uwac/include/uwac/uwac.h b/uwac/include/uwac/uwac.h index f0d2c50d9..819796105 100644 --- a/uwac/include/uwac/uwac.h +++ b/uwac/include/uwac/uwac.h @@ -276,8 +276,7 @@ struct uwac_output_geometry_event typedef struct uwac_output_geometry_event UwacOutputGeometryEvent; /** @brief */ -union uwac_event -{ +union uwac_event { int type; UwacOutputNewEvent output_new; UwacOutputGeometryEvent output_geometry; diff --git a/winpr/include/winpr/asn1.h b/winpr/include/winpr/asn1.h index 17b252c4d..6efe2e316 100644 --- a/winpr/include/winpr/asn1.h +++ b/winpr/include/winpr/asn1.h @@ -168,8 +168,7 @@ extern "C" { ASN1uint32_t length; - union - { + union { void* encoded; void* value; }; @@ -362,8 +361,7 @@ extern "C" { ASN1option_e eOption; - union - { + union { ASN1encodingrule_e eRule; ASN1uint32_t cbRequiredDecodedBufSize; diff --git a/winpr/include/winpr/file.h b/winpr/include/winpr/file.h index 2d64d45fb..b281a809e 100644 --- a/winpr/include/winpr/file.h +++ b/winpr/include/winpr/file.h @@ -180,8 +180,7 @@ #define MOVEFILE_CREATE_HARDLINK 0x10 #define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x20 -typedef union _FILE_SEGMENT_ELEMENT -{ +typedef union _FILE_SEGMENT_ELEMENT { PVOID64 Buffer; ULONGLONG Alignment; } FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT; diff --git a/winpr/include/winpr/interlocked.h b/winpr/include/winpr/interlocked.h index 714827fe7..5be208598 100644 --- a/winpr/include/winpr/interlocked.h +++ b/winpr/include/winpr/interlocked.h @@ -86,8 +86,7 @@ extern "C" #ifdef _WIN64 - typedef union DECLSPEC_ALIGN(16) _WINPR_SLIST_HEADER - { + typedef union DECLSPEC_ALIGN(16) _WINPR_SLIST_HEADER { struct { ULONGLONG Alignment; @@ -117,8 +116,7 @@ extern "C" #else /* _WIN64 */ - typedef union _WINPR_SLIST_HEADER - { + typedef union _WINPR_SLIST_HEADER { ULONGLONG Alignment; struct diff --git a/winpr/include/winpr/io.h b/winpr/include/winpr/io.h index 60464310d..aee1ee99a 100644 --- a/winpr/include/winpr/io.h +++ b/winpr/include/winpr/io.h @@ -35,8 +35,7 @@ typedef struct _OVERLAPPED { ULONG_PTR Internal; ULONG_PTR InternalHigh; - union - { + union { struct { DWORD Offset; diff --git a/winpr/include/winpr/ndr.h b/winpr/include/winpr/ndr.h index 0176d1fbc..2580a6ce6 100644 --- a/winpr/include/winpr/ndr.h +++ b/winpr/include/winpr/ndr.h @@ -28,8 +28,7 @@ #define __RPC_WIN32__ 1 #define TARGET_IS_NT50_OR_LATER 1 -typedef union _CLIENT_CALL_RETURN -{ +typedef union _CLIENT_CALL_RETURN { void* Pointer; LONG_PTR Simple; } CLIENT_CALL_RETURN; @@ -244,8 +243,7 @@ struct _MIDL_STUB_DESC void* (*pfnAllocate)(size_t); void (*pfnFree)(void*); - union - { + union { handle_t* pAutoHandle; handle_t* pPrimitiveHandle; PGENERIC_BINDING_INFO pGenericBindingInfo; @@ -352,8 +350,7 @@ typedef struct PARAM_ATTRIBUTES Attributes; unsigned short StackOffset; - union - { + union { unsigned char FormatChar; unsigned short Offset; } Type; diff --git a/winpr/include/winpr/nt.h b/winpr/include/winpr/nt.h index 59bc8cbf3..0cbcde0be 100644 --- a/winpr/include/winpr/nt.h +++ b/winpr/include/winpr/nt.h @@ -1431,8 +1431,7 @@ typedef OBJECT_ATTRIBUTES* POBJECT_ATTRIBUTES; typedef struct _IO_STATUS_BLOCK { - union - { + union { #ifdef _WIN32 NTSTATUS Status; #else diff --git a/winpr/include/winpr/pool.h b/winpr/include/winpr/pool.h index 8c194485a..62111dcdd 100644 --- a/winpr/include/winpr/pool.h +++ b/winpr/include/winpr/pool.h @@ -56,8 +56,7 @@ typedef struct _TP_CALLBACK_ENVIRON_V1 struct _ACTIVATION_CONTEXT* ActivationContext; PTP_SIMPLE_CALLBACK FinalizationCallback; - union - { + union { DWORD Flags; struct { diff --git a/winpr/include/winpr/rpc.h b/winpr/include/winpr/rpc.h index fff06e3c7..7f4be9902 100644 --- a/winpr/include/winpr/rpc.h +++ b/winpr/include/winpr/rpc.h @@ -308,8 +308,7 @@ typedef struct _RPC_SECURITY_QOS_V2_W unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials; } u; } RPC_SECURITY_QOS_V2_W, *PRPC_SECURITY_QOS_V2_W; @@ -321,8 +320,7 @@ typedef struct _RPC_SECURITY_QOS_V2_A unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials; } u; } RPC_SECURITY_QOS_V2_A, *PRPC_SECURITY_QOS_V2_A; @@ -336,8 +334,7 @@ typedef struct _RPC_SECURITY_QOS_V3_W unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_W* HttpCredentials; } u; void* Sid; @@ -350,8 +347,7 @@ typedef struct _RPC_SECURITY_QOS_V3_A unsigned long IdentityTracking; unsigned long ImpersonationType; unsigned long AdditionalSecurityInfoType; - union - { + union { RPC_HTTP_TRANSPORT_CREDENTIALS_A* HttpCredentials; } u; void* Sid; @@ -444,8 +440,7 @@ typedef struct _RPC_BINDING_HANDLE_TEMPLATE unsigned long ProtocolSequence; unsigned short* NetworkAddress; unsigned short* StringEndpoint; - union - { + union { unsigned short* Reserved; } u1; UUID ObjectUuid; diff --git a/winpr/include/winpr/smartcard.h b/winpr/include/winpr/smartcard.h index 4e6a4c3b5..e19a6ee02 100644 --- a/winpr/include/winpr/smartcard.h +++ b/winpr/include/winpr/smartcard.h @@ -250,8 +250,7 @@ typedef struct { SCARD_IO_REQUEST ioRequest; BYTE bSw1, bSw2; - union - { + union { SCARD_T0_COMMAND CmdBytes; BYTE rgbHeader[5]; } DUMMYUNIONNAME; @@ -473,8 +472,7 @@ typedef struct DWORD dwShareMode; DWORD dwPreferredProtocols; READER_SEL_REQUEST_MATCH_TYPE MatchType; - union - { + union { struct { DWORD cbReaderNameOffset; diff --git a/winpr/include/winpr/synch.h b/winpr/include/winpr/synch.h index 06f0fc4bd..4c75b17ae 100644 --- a/winpr/include/winpr/synch.h +++ b/winpr/include/winpr/synch.h @@ -202,8 +202,7 @@ extern "C" ULONG Version; DWORD Flags; - union - { + union { struct { HMODULE LocalizedReasonModule; diff --git a/winpr/include/winpr/sysinfo.h b/winpr/include/winpr/sysinfo.h index 38d0381db..c14e999d9 100644 --- a/winpr/include/winpr/sysinfo.h +++ b/winpr/include/winpr/sysinfo.h @@ -75,8 +75,7 @@ extern "C" typedef struct _SYSTEM_INFO { - union - { + union { DWORD dwOemId; struct diff --git a/winpr/include/winpr/winsock.h b/winpr/include/winpr/winsock.h index 4d3099321..167760920 100644 --- a/winpr/include/winpr/winsock.h +++ b/winpr/include/winpr/winsock.h @@ -178,8 +178,7 @@ struct sockaddr_in6_old IN6_ADDR sin6_addr; }; -typedef union sockaddr_gen -{ +typedef union sockaddr_gen { struct sockaddr Address; struct sockaddr_in AddressIn; struct sockaddr_in6_old AddressIn6; diff --git a/winpr/include/winpr/wtsapi.h b/winpr/include/winpr/wtsapi.h index 1e376e9a8..21d86fef7 100644 --- a/winpr/include/winpr/wtsapi.h +++ b/winpr/include/winpr/wtsapi.h @@ -549,13 +549,11 @@ typedef struct _WTSINFOEX_LEVEL1_A DWORD OutgoingCompressedBytes; } WTSINFOEX_LEVEL1_A, *PWTSINFOEX_LEVEL1_A; -typedef union _WTSINFOEX_LEVEL_W -{ +typedef union _WTSINFOEX_LEVEL_W { WTSINFOEX_LEVEL1_W WTSInfoExLevel1; } WTSINFOEX_LEVEL_W, *PWTSINFOEX_LEVEL_W; -typedef union _WTSINFOEX_LEVEL_A -{ +typedef union _WTSINFOEX_LEVEL_A { WTSINFOEX_LEVEL1_A WTSInfoExLevel1; } WTSINFOEX_LEVEL_A, *PWTSINFOEX_LEVEL_A; diff --git a/winpr/libwinpr/registry/registry_reg.h b/winpr/libwinpr/registry/registry_reg.h index a4e7e9a6d..90db136b4 100644 --- a/winpr/libwinpr/registry/registry_reg.h +++ b/winpr/libwinpr/registry/registry_reg.h @@ -44,8 +44,7 @@ struct _reg_val RegVal* prev; RegVal* next; - union reg_data - { + union reg_data { DWORD dword; char* string; } data; diff --git a/winpr/libwinpr/smartcard/smartcard_pcsc.c b/winpr/libwinpr/smartcard/smartcard_pcsc.c index ebf454d31..4cf5095ac 100644 --- a/winpr/libwinpr/smartcard/smartcard_pcsc.c +++ b/winpr/libwinpr/smartcard/smartcard_pcsc.c @@ -764,8 +764,7 @@ static LONG WINAPI PCSC_SCardListReaderGroups_Internal(SCARDCONTEXT hContext, LP PCSC_LONG status = SCARD_S_SUCCESS; BOOL pcchGroupsAlloc = FALSE; PCSC_DWORD pcsc_cchGroups = 0; - union - { + union { LPSTR lpstr; LPSTR* lppstr; } conv; @@ -836,8 +835,7 @@ static LONG WINAPI PCSC_SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR msz LPSTR mszGroupsA = NULL; LPSTR* pMszGroupsA = &mszGroupsA; LONG status = SCARD_S_SUCCESS; - union - { + union { LPWSTR lpstr; LPWSTR* lppstr; } conv; @@ -873,8 +871,7 @@ static LONG WINAPI PCSC_SCardListReaders_Internal(SCARDCONTEXT hContext, LPCSTR PCSC_LONG status = SCARD_S_SUCCESS; BOOL pcchReadersAlloc = FALSE; PCSC_DWORD pcsc_cchReaders = 0; - union - { + union { LPSTR lpstr; LPSTR* lppstr; } conv; @@ -966,8 +963,7 @@ static LONG WINAPI PCSC_SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGrou LPSTR* pMszReadersA = &mszReadersA; LONG status = SCARD_S_SUCCESS; BOOL nullCardContext = FALSE; - union - { + union { LPWSTR lpstr; LPWSTR* lppstr; } conv; @@ -1883,8 +1879,7 @@ static LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, LPSTR mszReaderN if (tATR) { - union - { + union { BYTE* pb; BYTE** ppb; } conv; @@ -1895,8 +1890,7 @@ static LONG WINAPI PCSC_SCardStatus_Internal(SCARDHANDLE hCard, LPSTR mszReaderN if (tReader) { - union - { + union { CHAR* pc; CHAR** ppc; WCHAR* pw; @@ -2021,8 +2015,7 @@ static LONG WINAPI PCSC_SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pio BYTE* pcsc_pbExtraBytes = NULL; PCSC_DWORD pcsc_cbSendLength = (PCSC_DWORD)cbSendLength; PCSC_DWORD pcsc_cbRecvLength = 0; - union - { + union { const PCSC_SCARD_IO_REQUEST* pcs; PCSC_SCARD_IO_REQUEST* ps; LPSCARD_IO_REQUEST lps; @@ -2230,8 +2223,7 @@ static LONG WINAPI PCSC_SCardGetAttrib_Internal(SCARDHANDLE hCard, DWORD dwAttrI PCSC_SCARDHANDLE* pCard = NULL; PCSC_DWORD pcsc_dwAttrId = (PCSC_DWORD)dwAttrId; PCSC_DWORD pcsc_cbAttrLen = 0; - union - { + union { BYTE* pb; BYTE** ppb; } conv; @@ -2303,8 +2295,7 @@ static LONG WINAPI PCSC_SCardGetAttrib_FriendlyName(SCARDHANDLE hCard, DWORD dwA WCHAR* pbAttrW = NULL; SCARDCONTEXT hContext; LONG status = SCARD_S_SUCCESS; - union - { + union { WCHAR** ppw; BYTE* pb; BYTE** ppb; @@ -2409,8 +2400,7 @@ static LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE SCARDCONTEXT hContext; BOOL pcbAttrLenAlloc = FALSE; LONG status = SCARD_S_SUCCESS; - union - { + union { BYTE* pb; BYTE** ppb; } conv; @@ -2495,8 +2485,7 @@ static LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE if (status == SCARD_S_SUCCESS) { - union - { + union { BYTE* pb; LPDWORD pd; } conv; @@ -2517,8 +2506,7 @@ static LONG WINAPI PCSC_SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE { UINT32 channelType = 0x20; /* USB */ UINT32 channelNumber = 0; - union - { + union { BYTE* pb; BYTE** ppb; DWORD* ppd; @@ -2701,8 +2689,7 @@ static LONG WINAPI PCSC_SCardReadCacheA(SCARDCONTEXT hContext, UUID* CardIdentif if (*DataLen == SCARD_AUTOALLOCATE) { BYTE* mem; - union - { + union { BYTE* pb; BYTE** ppb; } conv; @@ -2753,8 +2740,7 @@ static LONG WINAPI PCSC_SCardReadCacheW(SCARDCONTEXT hContext, UUID* CardIdentif if (*DataLen == SCARD_AUTOALLOCATE) { BYTE* mem; - union - { + union { BYTE* pb; BYTE** ppb; } conv; diff --git a/winpr/libwinpr/utils/trio/trio.c b/winpr/libwinpr/utils/trio/trio.c index d5fcf9562..b278f475b 100644 --- a/winpr/libwinpr/utils/trio/trio.c +++ b/winpr/libwinpr/utils/trio/trio.c @@ -795,15 +795,13 @@ typedef struct /* Position in the argument list that this parameter refers to */ int position; /* The data from the argument list */ - union - { + union { char* string; #if TRIO_FEATURE_WIDECHAR trio_wchar_t* wstring; #endif trio_pointer_t pointer; - union - { + union { trio_intmax_t as_signed; trio_uintmax_t as_unsigned; } number; @@ -817,8 +815,7 @@ typedef struct } data; #if TRIO_FEATURE_USER_DEFINED /* For the user-defined specifier */ - union - { + union { char namespace[MAX_USER_NAME]; int handler; /* if flags & FLAGS_USER_DEFINED_PARAMETER */ } user_defined; @@ -829,8 +826,7 @@ typedef struct /* Container for customized functions */ typedef struct { - union - { + union { trio_outstream_t out; trio_instream_t in; } stream; @@ -865,8 +861,7 @@ typedef struct _trio_class_t * if there had been sufficient space. */ int processed; - union - { + union { /* * The number of characters that are actually written. Processed and * committed will only differ for the *nprintf functions.