diff --git a/channels/ainput/server/ainput_main.c b/channels/ainput/server/ainput_main.c index 73abf3b33..5e5d4af75 100644 --- a/channels/ainput/server/ainput_main.c +++ b/channels/ainput/server/ainput_main.c @@ -191,8 +191,10 @@ static UINT ainput_server_send_version(ainput_server* ainput) static UINT ainput_server_recv_mouse_event(ainput_server* ainput, wStream* s) { UINT error = CHANNEL_RC_OK; - UINT64 flags, time; - INT32 x, y; + UINT64 flags; + UINT64 time; + INT32 x; + INT32 y; char buffer[128] = { 0 }; WINPR_ASSERT(ainput); @@ -437,7 +439,8 @@ static UINT ainput_process_message(ainput_server* ainput) { BOOL rc; UINT error = ERROR_INTERNAL_ERROR; - ULONG BytesReturned, ActualBytesReturned; + ULONG BytesReturned; + ULONG ActualBytesReturned; UINT16 MessageId; wStream* s; diff --git a/channels/audin/client/oss/audin_oss.c b/channels/audin/client/oss/audin_oss.c index b91188ba5..e28cd82f6 100644 --- a/channels/audin/client/oss/audin_oss.c +++ b/channels/audin/client/oss/audin_oss.c @@ -148,7 +148,8 @@ static DWORD WINAPI audin_oss_thread_func(LPVOID arg) { char dev_name[PATH_MAX] = "/dev/dsp"; char mixer_name[PATH_MAX] = "/dev/mixer"; - int pcm_handle = -1, mixer_handle; + int pcm_handle = -1; + int mixer_handle; BYTE* buffer = NULL; unsigned long tmp = 0; size_t buffer_size = 0; @@ -385,7 +386,8 @@ static UINT audin_oss_free(IAudinDevice* device) static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, const ADDIN_ARGV* args) { int status; - char *str_num, *eptr; + char* str_num; + char* eptr; DWORD flags; const COMMAND_LINE_ARGUMENT_A* arg; AudinOSSDevice* oss = (AudinOSSDevice*)device; diff --git a/channels/client/addin.c b/channels/client/addin.c index 9723e432a..c188fa2a6 100644 --- a/channels/client/addin.c +++ b/channels/client/addin.c @@ -87,7 +87,8 @@ static FREERDP_ADDIN** freerdp_channels_list_client_static_addins(LPCSTR pszName LPCSTR pszSubsystem, LPCSTR pszType, DWORD dwFlags) { - size_t i, j; + size_t i; + size_t j; DWORD nAddins; FREERDP_ADDIN** ppAddins = NULL; const STATIC_SUBSYSTEM_ENTRY* subsystems; diff --git a/channels/disp/server/disp_main.c b/channels/disp/server/disp_main.c index eba310705..e5ecdb758 100644 --- a/channels/disp/server/disp_main.c +++ b/channels/disp/server/disp_main.c @@ -214,7 +214,8 @@ out: static UINT disp_server_receive_pdu(DispServerContext* context, wStream* s) { UINT error = CHANNEL_RC_OK; - size_t beg, end; + size_t beg; + size_t end; DISPLAY_CONTROL_HEADER header = { 0 }; WINPR_ASSERT(s); diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index 9becad560..4a1c15a45 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -147,7 +147,9 @@ static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const ch static IWTSPlugin* dvcman_get_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name) { IWTSPlugin* plugin = NULL; - size_t i, nc, pc; + size_t i; + size_t nc; + size_t pc; WINPR_ASSERT(pEntryPoints); DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*)pEntryPoints)->dvcman; if (!dvcman || !pEntryPoints || !name) diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c index 60b21340b..cf5cb54d4 100644 --- a/channels/drive/client/drive_main.c +++ b/channels/drive/client/drive_main.c @@ -886,7 +886,8 @@ static void drive_message_free(void* obj) static UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, const char* name, const char* path, BOOL automount) { - size_t i, length; + size_t i; + size_t length; DRIVE_DEVICE* drive; UINT error = ERROR_INTERNAL_ERROR; diff --git a/channels/encomsp/server/encomsp_main.c b/channels/encomsp/server/encomsp_main.c index f3756b144..6f67e76db 100644 --- a/channels/encomsp/server/encomsp_main.c +++ b/channels/encomsp/server/encomsp_main.c @@ -86,7 +86,8 @@ static UINT encomsp_recv_change_participant_control_level_pdu(EncomspServerConte wStream* s, ENCOMSP_ORDER_HEADER* header) { - int beg, end; + int beg; + int end; ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU pdu; UINT error = CHANNEL_RC_OK; beg = ((int)Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; diff --git a/channels/geometry/client/geometry_main.c b/channels/geometry/client/geometry_main.c index 8b630b362..eed3aa13c 100644 --- a/channels/geometry/client/geometry_main.c +++ b/channels/geometry/client/geometry_main.c @@ -65,9 +65,14 @@ static void freerdp_rgndata_reset(FREERDP_RGNDATA* data) static UINT32 geometry_read_RGNDATA(wLog* logger, wStream* s, UINT32 len, FREERDP_RGNDATA* rgndata) { - UINT32 dwSize, iType; - INT32 right, bottom; - INT32 x, y, w, h; + UINT32 dwSize; + UINT32 iType; + INT32 right; + INT32 bottom; + INT32 x; + INT32 y; + INT32 w; + INT32 h; if (len < 32) { @@ -157,12 +162,14 @@ static UINT32 geometry_read_RGNDATA(wLog* logger, wStream* s, UINT32 len, FREERD */ static UINT geometry_recv_pdu(GENERIC_CHANNEL_CALLBACK* callback, wStream* s) { - UINT32 length, cbGeometryBuffer; + UINT32 length; + UINT32 cbGeometryBuffer; MAPPED_GEOMETRY* mappedGeometry; GEOMETRY_PLUGIN* geometry; GeometryClientContext* context; UINT ret = CHANNEL_RC_OK; - UINT32 updateType, geometryType; + UINT32 updateType; + UINT32 geometryType; UINT64 id; wLog* logger; diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index ce8694cc8..39874fbcb 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -156,7 +156,8 @@ static BOOL printer_config_valid(const char* path) static BOOL printer_read_setting(const char* path, prn_conf_t type, void** data, UINT32* length) { - DWORD lowSize, highSize; + DWORD lowSize; + DWORD highSize; DWORD read = 0; BOOL rc = FALSE; HANDLE file; @@ -394,7 +395,8 @@ static BOOL printer_save_default_config(const rdpSettings* settings, rdpPrinter* BOOL res = FALSE; WCHAR* wname = NULL; WCHAR* driver = NULL; - size_t wlen, dlen; + size_t wlen; + size_t dlen; char* path = NULL; if (!settings || !printer || !printer->name || !printer->driver) @@ -715,8 +717,13 @@ static UINT printer_custom_component(DEVICE* device, UINT16 component, UINT16 pa case RDPDR_ADD_PRINTER_EVENT: { char PortDosName[8]; - UINT32 PnPNameLen, DriverNameLen, PrintNameLen, CacheFieldsLen; - const WCHAR *PnPName, *DriverName, *PrinterName; + UINT32 PnPNameLen; + UINT32 DriverNameLen; + UINT32 PrintNameLen; + UINT32 CacheFieldsLen; + const WCHAR* PnPName; + const WCHAR* DriverName; + const WCHAR* PrinterName; const BYTE* CachedPrinterConfigData; if (!Stream_CheckAndLogRequiredLength(TAG, s, 24)) @@ -762,7 +769,8 @@ static UINT printer_custom_component(DEVICE* device, UINT16 component, UINT16 pa case RDPDR_UPDATE_PRINTER_EVENT: { - UINT32 PrinterNameLen, ConfigDataLen; + UINT32 PrinterNameLen; + UINT32 ConfigDataLen; const WCHAR* PrinterName; const BYTE* ConfigData; @@ -811,7 +819,8 @@ static UINT printer_custom_component(DEVICE* device, UINT16 component, UINT16 pa case RDPDR_RENAME_PRINTER_EVENT: { - UINT32 OldPrinterNameLen, NewPrinterNameLen; + UINT32 OldPrinterNameLen; + UINT32 NewPrinterNameLen; const WCHAR* OldPrinterName; const WCHAR* NewPrinterName; diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index 85a4c7ea6..522ddc2f3 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -416,7 +416,8 @@ static UINT rail_recv_compartmentinfo_order(railPlugin* rail, wStream* s) BOOL rail_is_feature_supported(const rdpContext* context, UINT32 featureMask) { - UINT32 supported, masked; + UINT32 supported; + UINT32 masked; if (!context || !context->settings) return FALSE; diff --git a/channels/rail/server/rail_main.c b/channels/rail/server/rail_main.c index 23bcfb505..85aba168c 100644 --- a/channels/rail/server/rail_main.c +++ b/channels/rail/server/rail_main.c @@ -653,7 +653,9 @@ static UINT rail_read_client_status_order(wStream* s, RAIL_CLIENT_STATUS_ORDER* static UINT rail_read_exec_order(wStream* s, RAIL_EXEC_ORDER* exec) { RAIL_EXEC_ORDER order = { 0 }; - UINT16 exeLen, workLen, argLen; + UINT16 exeLen; + UINT16 workLen; + UINT16 argLen; if (!Stream_CheckAndLogRequiredLength(TAG, s, RAIL_EXEC_ORDER_LENGTH)) return ERROR_INVALID_DATA; diff --git a/channels/rdpdr/server/rdpdr_main.c b/channels/rdpdr/server/rdpdr_main.c index a39846471..456974c0a 100644 --- a/channels/rdpdr/server/rdpdr_main.c +++ b/channels/rdpdr/server/rdpdr_main.c @@ -1166,8 +1166,13 @@ static UINT rdpdr_server_receive_io_create_request(RdpdrServerContext* context, UINT32 CompletionId) { const WCHAR* path; - UINT32 DesiredAccess, AllocationSize, FileAttributes, SharedAccess, CreateDisposition, - CreateOptions, PathLength; + UINT32 DesiredAccess; + UINT32 AllocationSize; + UINT32 FileAttributes; + UINT32 SharedAccess; + UINT32 CreateDisposition; + UINT32 CreateOptions; + UINT32 PathLength; WINPR_ASSERT(context); if (!Stream_CheckAndLogRequiredLengthWLog(context->priv->log, s, 32)) diff --git a/channels/rdpgfx/client/rdpgfx_codec.c b/channels/rdpgfx/client/rdpgfx_codec.c index a099d7560..588493dc8 100644 --- a/channels/rdpgfx/client/rdpgfx_codec.c +++ b/channels/rdpgfx/client/rdpgfx_codec.c @@ -170,7 +170,8 @@ static UINT rdpgfx_decode_AVC444(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd { UINT error = 0; UINT32 tmp = 0; - size_t pos1 = 0, pos2 = 0; + size_t pos1 = 0; + size_t pos2 = 0; RDPGFX_AVC444_BITMAP_STREAM h264 = { 0 }; RdpgfxClientContext* context = gfx->context; diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index d70db2085..4662694ad 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -630,7 +630,8 @@ static UINT rdpgfx_recv_evict_cache_entry_pdu(GENERIC_CHANNEL_CALLBACK* callback */ static UINT rdpgfx_load_cache_import_offer(RDPGFX_PLUGIN* gfx, RDPGFX_CACHE_IMPORT_OFFER_PDU* offer) { - int idx, count; + int idx; + int count; UINT error = CHANNEL_RC_OK; PERSISTENT_CACHE_ENTRY entry; rdpPersistentCache* persistent = NULL; @@ -843,7 +844,8 @@ fail: */ static UINT rdpgfx_send_cache_offer(RDPGFX_PLUGIN* gfx) { - int idx, count; + int idx; + int count; UINT error = CHANNEL_RC_OK; PERSISTENT_CACHE_ENTRY entry; RDPGFX_CACHE_IMPORT_OFFER_PDU* offer = NULL; diff --git a/channels/rdpgfx/server/rdpgfx_main.c b/channels/rdpgfx/server/rdpgfx_main.c index 91962169b..f0a41347f 100644 --- a/channels/rdpgfx/server/rdpgfx_main.c +++ b/channels/rdpgfx/server/rdpgfx_main.c @@ -1390,7 +1390,8 @@ rdpgfx_send_map_surface_to_scaled_output_pdu(RdpgfxServerContext* context, */ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s) { - size_t beg, end; + size_t beg; + size_t end; RDPGFX_HEADER header; UINT error = CHANNEL_RC_OK; beg = Stream_GetPosition(s); diff --git a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c index 8bfa6b59b..f4b2f47c2 100644 --- a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c +++ b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c @@ -451,7 +451,8 @@ static UINT rdpsnd_alsa_play(rdpsndDevicePlugin* device, const BYTE* data, size_ } { - snd_pcm_sframes_t available, delay; + snd_pcm_sframes_t available; + snd_pcm_sframes_t delay; int rc = snd_pcm_avail_delay(alsa->pcm_handle, &available, &delay); if (rc != 0) diff --git a/channels/rdpsnd/client/oss/rdpsnd_oss.c b/channels/rdpsnd/client/oss/rdpsnd_oss.c index 0a72ffcd6..dc9aca742 100644 --- a/channels/rdpsnd/client/oss/rdpsnd_oss.c +++ b/channels/rdpsnd/client/oss/rdpsnd_oss.c @@ -300,7 +300,8 @@ static UINT32 rdpsnd_oss_get_volume(rdpsndDevicePlugin* device) { int vol; UINT32 dwVolume; - UINT16 dwVolumeLeft, dwVolumeRight; + UINT16 dwVolumeLeft; + UINT16 dwVolumeRight; rdpsndOssPlugin* oss = (rdpsndOssPlugin*)device; /* On error return 50% volume. */ dwVolumeLeft = ((50 * 0xFFFF) / 100); /* 50% */ @@ -324,7 +325,8 @@ static UINT32 rdpsnd_oss_get_volume(rdpsndDevicePlugin* device) static BOOL rdpsnd_oss_set_volume(rdpsndDevicePlugin* device, UINT32 value) { - int left, right; + int left; + int right; rdpsndOssPlugin* oss = (rdpsndOssPlugin*)device; if (device == NULL || oss->mixer_handle == -1) @@ -387,7 +389,8 @@ static UINT rdpsnd_oss_play(rdpsndDevicePlugin* device, const BYTE* data, size_t static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, const ADDIN_ARGV* args) { int status; - char *str_num, *eptr; + char* str_num; + char* eptr; DWORD flags; const COMMAND_LINE_ARGUMENT_A* arg; rdpsndOssPlugin* oss = (rdpsndOssPlugin*)device; diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index ce325fe92..346bd9174 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -601,7 +601,8 @@ static UINT rdpsnd_treat_wave(rdpsndPlugin* rdpsnd, wStream* s, size_t size) { AUDIO_FORMAT* format; UINT64 end; - UINT64 diffMS, ts; + UINT64 diffMS; + UINT64 ts; UINT latency = 0; UINT error; diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index c33a54f02..59493fd6a 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -177,7 +177,8 @@ static UINT rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, wStrea */ static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) { - UINT16 i, num_known_format = 0; + UINT16 i; + UINT16 num_known_format = 0; UINT16 udpPort; BYTE lastblock; UINT error = CHANNEL_RC_OK; @@ -265,7 +266,8 @@ out_free: static DWORD WINAPI rdpsnd_server_thread(LPVOID arg) { - DWORD nCount = 0, status; + DWORD nCount = 0; + DWORD status; HANDLE events[2] = { 0 }; RdpsndServerContext* context = (RdpsndServerContext*)arg; UINT error = CHANNEL_RC_OK; @@ -492,7 +494,8 @@ static BOOL rdpsnd_server_align_wave_pdu(wStream* s, UINT32 alignment) static UINT rdpsnd_server_send_wave_pdu(RdpsndServerContext* context, UINT16 wTimestamp) { size_t length; - size_t start, end = 0; + size_t start; + size_t end = 0; const BYTE* src; AUDIO_FORMAT* format; ULONG written; diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index 0f39086ec..e5e81d331 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -820,7 +820,8 @@ FREERDP_ENTRY_POINT(UINT serial_DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS char* driver; RDPDR_SERIAL* device; #if defined __linux__ && !defined ANDROID - size_t i, len; + size_t i; + size_t len; SERIAL_DEVICE* serial; #endif /* __linux__ */ UINT error = CHANNEL_RC_OK; diff --git a/channels/tsmf/client/tsmf_codec.c b/channels/tsmf/client/tsmf_codec.c index 5e4e1e13a..75c0d9b8f 100644 --- a/channels/tsmf/client/tsmf_codec.c +++ b/channels/tsmf/client/tsmf_codec.c @@ -365,7 +365,8 @@ static UINT32 tsmf_codec_parse_VIDEOINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, wStr static BOOL tsmf_read_format_type(TS_AM_MEDIA_TYPE* mediatype, wStream* s, UINT32 cbFormat) { - UINT32 i, j; + UINT32 i; + UINT32 j; switch (mediatype->FormatType) { diff --git a/channels/tsmf/client/tsmf_ifman.c b/channels/tsmf/client/tsmf_ifman.c index f2018a290..b0d17c7e8 100644 --- a/channels/tsmf/client/tsmf_ifman.c +++ b/channels/tsmf/client/tsmf_ifman.c @@ -328,8 +328,10 @@ static float tsmf_stream_read_float(wStream* s) UINT tsmf_ifman_set_source_video_rect(TSMF_IFMAN* ifman) { UINT status = CHANNEL_RC_OK; - float Left, Top; - float Right, Bottom; + float Left; + float Top; + float Right; + float Bottom; TSMF_PRESENTATION* presentation; DEBUG_TSMF(""); diff --git a/channels/urbdrc/client/data_transfer.c b/channels/urbdrc/client/data_transfer.c index 1c75134c7..40f91de65 100644 --- a/channels/urbdrc/client/data_transfer.c +++ b/channels/urbdrc/client/data_transfer.c @@ -318,8 +318,12 @@ static UINT urbdrc_process_internal_io_control(IUDEVICE* pdev, GENERIC_CHANNEL_C wStream* s, UINT32 MessageId, IUDEVMAN* udevman) { wStream* out; - UINT32 IoControlCode, InterfaceId, InputBufferSize; - UINT32 OutputBufferSize, RequestId, frames; + UINT32 IoControlCode; + UINT32 InterfaceId; + UINT32 InputBufferSize; + UINT32 OutputBufferSize; + UINT32 RequestId; + UINT32 frames; if (!pdev || !callback || !s || !udevman) return ERROR_INVALID_PARAMETER; @@ -397,7 +401,8 @@ static void func_select_all_interface_for_msconfig(IUDEVICE* pdev, { UINT32 inum; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces = MsConfig->MsInterfaces; - BYTE InterfaceNumber, AlternateSetting; + BYTE InterfaceNumber; + BYTE AlternateSetting; UINT32 NumInterfaces = MsConfig->NumInterfaces; for (inum = 0; inum < NumInterfaces; inum++) @@ -414,7 +419,9 @@ static UINT urb_select_configuration(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK* c { MSUSB_CONFIG_DESCRIPTOR* MsConfig = NULL; size_t out_size; - UINT32 InterfaceId, NumInterfaces, usbd_status = 0; + UINT32 InterfaceId; + UINT32 NumInterfaces; + UINT32 usbd_status = 0; BYTE ConfigurationDescriptorIsValid; wStream* out; int MsOutSize = 0; @@ -531,7 +538,9 @@ static UINT urb_select_interface(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK* callb { MSUSB_CONFIG_DESCRIPTOR* MsConfig; MSUSB_INTERFACE_DESCRIPTOR* MsInterface; - UINT32 out_size, InterfaceId, ConfigurationHandle; + UINT32 out_size; + UINT32 InterfaceId; + UINT32 ConfigurationHandle; UINT32 OutputBufferSize; BYTE InterfaceNumber; wStream* out; @@ -618,10 +627,19 @@ static UINT urb_control_transfer(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK* callb UINT32 RequestField, UINT32 MessageId, IUDEVMAN* udevman, int transferDir, int External) { - UINT32 out_size, InterfaceId, EndpointAddress, PipeHandle; - UINT32 TransferFlags, OutputBufferSize, usbd_status, Timeout; - BYTE bmRequestType, Request; - UINT16 Value, Index, length; + UINT32 out_size; + UINT32 InterfaceId; + UINT32 EndpointAddress; + UINT32 PipeHandle; + UINT32 TransferFlags; + UINT32 OutputBufferSize; + UINT32 usbd_status; + UINT32 Timeout; + BYTE bmRequestType; + BYTE Request; + UINT16 Value; + UINT16 Index; + UINT16 length; BYTE* buffer; wStream* out; URBDRC_PLUGIN* urbdrc; @@ -722,8 +740,10 @@ static UINT urb_bulk_or_interrupt_transfer(IUDEVICE* pdev, GENERIC_CHANNEL_CALLB wStream* s, UINT32 RequestField, UINT32 MessageId, IUDEVMAN* udevman, int transferDir) { - UINT32 EndpointAddress, PipeHandle; - UINT32 TransferFlags, OutputBufferSize; + UINT32 EndpointAddress; + UINT32 PipeHandle; + UINT32 TransferFlags; + UINT32 OutputBufferSize; const BOOL noAck = (RequestField & 0x80000000U) != 0; const UINT32 RequestId = RequestField & 0x7FFFFFFF; @@ -806,8 +826,12 @@ static UINT urb_isoch_transfer(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK* callbac { int rc; UINT32 EndpointAddress; - UINT32 PipeHandle, TransferFlags, StartFrame, NumberOfPackets; - UINT32 ErrorCount, OutputBufferSize; + UINT32 PipeHandle; + UINT32 TransferFlags; + UINT32 StartFrame; + UINT32 NumberOfPackets; + UINT32 ErrorCount; + UINT32 OutputBufferSize; BYTE* packetDescriptorData; const BOOL noAck = (RequestField & 0x80000000U) != 0; const UINT32 RequestId = RequestField & 0x7FFFFFFF; @@ -857,8 +881,12 @@ static UINT urb_control_descriptor_request(IUDEVICE* pdev, GENERIC_CHANNEL_CALLB IUDEVMAN* udevman, BYTE func_recipient, int transferDir) { size_t out_size; - UINT32 InterfaceId, OutputBufferSize, usbd_status; - BYTE bmRequestType, desc_index, desc_type; + UINT32 InterfaceId; + UINT32 OutputBufferSize; + UINT32 usbd_status; + BYTE bmRequestType; + BYTE desc_index; + BYTE desc_type; UINT16 langId; wStream* out; URBDRC_PLUGIN* urbdrc; @@ -937,7 +965,9 @@ static UINT urb_control_get_status_request(IUDEVICE* pdev, GENERIC_CHANNEL_CALLB IUDEVMAN* udevman, BYTE func_recipient, int transferDir) { size_t out_size; - UINT32 InterfaceId, OutputBufferSize, usbd_status; + UINT32 InterfaceId; + UINT32 OutputBufferSize; + UINT32 usbd_status; UINT16 Index; BYTE bmRequestType; wStream* out; @@ -996,10 +1026,17 @@ static UINT urb_control_vendor_or_class_request(IUDEVICE* pdev, GENERIC_CHANNEL_ IUDEVMAN* udevman, BYTE func_type, BYTE func_recipient, int transferDir) { - UINT32 out_size, InterfaceId, TransferFlags, usbd_status; + UINT32 out_size; + UINT32 InterfaceId; + UINT32 TransferFlags; + UINT32 usbd_status; UINT32 OutputBufferSize; - BYTE ReqTypeReservedBits, Request, bmRequestType; - UINT16 Value, Index, Padding; + BYTE ReqTypeReservedBits; + BYTE Request; + BYTE bmRequestType; + UINT16 Value; + UINT16 Index; + UINT16 Padding; wStream* out; URBDRC_PLUGIN* urbdrc; const BOOL noAck = (RequestField & 0x80000000U) != 0; @@ -1079,8 +1116,12 @@ static UINT urb_os_feature_descriptor_request(IUDEVICE* pdev, GENERIC_CHANNEL_CA IUDEVMAN* udevman, int transferDir) { size_t out_size; - UINT32 InterfaceId, OutputBufferSize, usbd_status; - BYTE Recipient, InterfaceNumber, Ms_PageIndex; + UINT32 InterfaceId; + UINT32 OutputBufferSize; + UINT32 usbd_status; + BYTE Recipient; + BYTE InterfaceNumber; + BYTE Ms_PageIndex; UINT16 Ms_featureDescIndex; wStream* out; int ret; @@ -1163,8 +1204,12 @@ static UINT urb_pipe_request(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK* callback, UINT32 RequestField, UINT32 MessageId, IUDEVMAN* udevman, int transferDir, int action) { - UINT32 out_size, InterfaceId, PipeHandle, EndpointAddress; - UINT32 OutputBufferSize, usbd_status = 0; + UINT32 out_size; + UINT32 InterfaceId; + UINT32 PipeHandle; + UINT32 EndpointAddress; + UINT32 OutputBufferSize; + UINT32 usbd_status = 0; wStream* out; UINT32 ret = USBD_STATUS_REQUEST_FAILED; int rc; @@ -1242,7 +1287,9 @@ static UINT urb_get_current_frame_number(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBAC wStream* s, UINT32 RequestField, UINT32 MessageId, IUDEVMAN* udevman, int transferDir) { - UINT32 out_size, InterfaceId, OutputBufferSize; + UINT32 out_size; + UINT32 InterfaceId; + UINT32 OutputBufferSize; UINT32 dummy_frames; wStream* out; URBDRC_PLUGIN* urbdrc; @@ -1306,7 +1353,9 @@ static UINT urb_control_get_configuration_request(IUDEVICE* pdev, IUDEVMAN* udevman, int transferDir) { size_t out_size; - UINT32 InterfaceId, OutputBufferSize, usbd_status; + UINT32 InterfaceId; + UINT32 OutputBufferSize; + UINT32 usbd_status; wStream* out; URBDRC_PLUGIN* urbdrc; const BOOL noAck = (RequestField & 0x80000000U) != 0; @@ -1362,7 +1411,9 @@ static UINT urb_control_get_interface_request(IUDEVICE* pdev, GENERIC_CHANNEL_CA IUDEVMAN* udevman, int transferDir) { size_t out_size; - UINT32 InterfaceId, OutputBufferSize, usbd_status; + UINT32 InterfaceId; + UINT32 OutputBufferSize; + UINT32 usbd_status; UINT16 InterfaceNr; wStream* out; URBDRC_PLUGIN* urbdrc; @@ -1419,9 +1470,13 @@ static UINT urb_control_feature_request(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK IUDEVMAN* udevman, BYTE func_recipient, BYTE command, int transferDir) { - UINT32 InterfaceId, OutputBufferSize, usbd_status; - UINT16 FeatureSelector, Index; - BYTE bmRequestType, bmRequest; + UINT32 InterfaceId; + UINT32 OutputBufferSize; + UINT32 usbd_status; + UINT16 FeatureSelector; + UINT16 Index; + BYTE bmRequestType; + BYTE bmRequest; wStream* out; URBDRC_PLUGIN* urbdrc; const BOOL noAck = (RequestField & 0x80000000U) != 0; diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index b5732aeb5..9c5c88ade 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -84,7 +84,8 @@ static void request_free(void* value); static struct libusb_transfer* list_contains(wArrayList* list, UINT32 streamID) { - size_t x, count; + size_t x; + size_t count; if (!list) return NULL; count = ArrayList_Count(list); @@ -328,7 +329,8 @@ static const LIBUSB_ENDPOINT_DESCEIPTOR* func_get_ep_desc(LIBUSB_CONFIG_DESCRIPT UINT32 EndpointAddress) { BYTE alt; - UINT32 inum, pnum; + UINT32 inum; + UINT32 pnum; MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces; const LIBUSB_INTERFACE* interface; const LIBUSB_ENDPOINT_DESCEIPTOR* endpoint; @@ -483,7 +485,8 @@ static int func_config_release_all_interface(URBDRC_PLUGIN* urbdrc, static int func_claim_all_interface(URBDRC_PLUGIN* urbdrc, LIBUSB_DEVICE_HANDLE* libusb_handle, int NumInterfaces) { - int i, ret; + int i; + int ret; for (i = 0; i < NumInterfaces; i++) { @@ -538,7 +541,8 @@ static LIBUSB_DEVICE_DESCRIPTOR* udev_new_descript(URBDRC_PLUGIN* urbdrc, LIBUSB static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BYTE AlternateSetting) { - int error = 0, diff = 0; + int error = 0; + int diff = 0; UDEVICE* pdev = (UDEVICE*)idev; URBDRC_PLUGIN* urbdrc; MSUSB_CONFIG_DESCRIPTOR* MsConfig; @@ -595,7 +599,9 @@ libusb_udev_complete_msconfig_setup(IUDEVICE* idev, MSUSB_CONFIG_DESCRIPTOR* MsC const LIBUSB_ENDPOINT_DESCEIPTOR* LibusbEndpoint; BYTE LibusbNumEndpoint; URBDRC_PLUGIN* urbdrc; - UINT32 inum = 0, pnum = 0, MsOutSize = 0; + UINT32 inum = 0; + UINT32 pnum = 0; + UINT32 MsOutSize = 0; if (!pdev || !pdev->LibusbConfig || !pdev->urbdrc || !MsConfig) return NULL; @@ -831,10 +837,12 @@ static UINT32 libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextT BYTE bus_number; BYTE device_address; int ret = 0; - size_t i, len; + size_t i; + size_t len; URBDRC_PLUGIN* urbdrc; WCHAR* text = (WCHAR*)Buffer; - BYTE slen, locale; + BYTE slen; + BYTE locale; const UINT8 inSize = *BufferSize; *BufferSize = 0; @@ -1022,7 +1030,8 @@ static int libusb_udev_query_device_descriptor(IUDEVICE* idev, int offset) static BOOL libusb_udev_detach_kernel_driver(IUDEVICE* idev) { - int i, err = 0; + int i; + int err = 0; UDEVICE* pdev = (UDEVICE*)idev; URBDRC_PLUGIN* urbdrc; @@ -1057,7 +1066,8 @@ static BOOL libusb_udev_detach_kernel_driver(IUDEVICE* idev) static BOOL libusb_udev_attach_kernel_driver(IUDEVICE* idev) { - int i, err = 0; + int i; + int err = 0; UDEVICE* pdev = (UDEVICE*)idev; if (!pdev || !pdev->LibusbConfig || !pdev->libusb_handle || !pdev->urbdrc) @@ -1177,7 +1187,8 @@ static int libusb_udev_query_device_port_status(IUDEVICE* idev, UINT32* UsbdStat UINT32* BufferSize, BYTE* Buffer) { UDEVICE* pdev = (UDEVICE*)idev; - int success = 0, ret; + int success = 0; + int ret; URBDRC_PLUGIN* urbdrc; if (!pdev || !pdev->urbdrc) @@ -1416,7 +1427,8 @@ static int func_cancel_xact_request(URBDRC_PLUGIN* urbdrc, struct libusb_transfe static void libusb_udev_cancel_all_transfer_request(IUDEVICE* idev) { UDEVICE* pdev = (UDEVICE*)idev; - size_t count, x; + size_t count; + size_t x; if (!pdev || !pdev->request_queue || !pdev->urbdrc) return; @@ -1798,7 +1810,8 @@ size_t udev_new_by_id(URBDRC_PLUGIN* urbdrc, libusb_context* ctx, UINT16 idVendo { LIBUSB_DEVICE** libusb_list; UDEVICE** array; - ssize_t i, total_device; + ssize_t i; + ssize_t total_device; size_t num = 0; if (!urbdrc || !devArray) diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c index 552b70b3d..6cfb19dea 100644 --- a/channels/urbdrc/client/libusb/libusb_udevman.c +++ b/channels/urbdrc/client/libusb/libusb_udevman.c @@ -145,7 +145,9 @@ static size_t udevman_register_udevice(IUDEVMAN* idevman, BYTE bus_number, BYTE IUDEVICE* pdev = NULL; IUDEVICE** devArray; URBDRC_PLUGIN* urbdrc; - size_t i, num, addnum = 0; + size_t i; + size_t num; + size_t addnum = 0; if (!idevman || !idevman->plugin) return 0; @@ -675,7 +677,8 @@ static BOOL urbdrc_udevman_register_devices(UDEVMAN* udevman, const char* device { const char* pos = devices; VID_PID_PAIR* idpair; - UINT16 id1, id2; + UINT16 id1; + UINT16 id2; while (*pos != '\0') { diff --git a/channels/urbdrc/client/urbdrc_main.c b/channels/urbdrc/client/urbdrc_main.c index 52cc71a4b..2512261b5 100644 --- a/channels/urbdrc/client/urbdrc_main.c +++ b/channels/urbdrc/client/urbdrc_main.c @@ -66,9 +66,11 @@ static IWTSVirtualChannel* get_channel(IUDEVMAN* idevman) static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId) { - char *p, *path; + char* p; + char* path; UINT8 containerId[17] = { 0 }; - UINT16 idVendor, idProduct; + UINT16 idVendor; + UINT16 idProduct; idVendor = (UINT16)pdev->query_device_descriptor(pdev, ID_VENDOR); idProduct = (UINT16)pdev->query_device_descriptor(pdev, ID_PRODUCT); path = pdev->getPath(pdev); @@ -233,7 +235,8 @@ static UINT urdbrc_send_usb_device_add(GENERIC_CHANNEL_CALLBACK* callback, IUDEV size_t size; size_t CompatibilityIdLen[3]; size_t HardwareIdsLen[2]; - size_t ContainerIdLen, InstanceIdLen; + size_t ContainerIdLen; + size_t InstanceIdLen; size_t cchCompatIds; UINT32 bcdUSB; InterfaceId = ((STREAM_ID_PROXY << 30) | CLIENT_DEVICE_SINK); @@ -851,7 +854,8 @@ BOOL add_device(IUDEVMAN* idevman, UINT32 flags, BYTE busnum, BYTE devnum, UINT1 { size_t success = 0; URBDRC_PLUGIN* urbdrc; - UINT32 mask, regflags = 0; + UINT32 mask; + UINT32 regflags = 0; if (!idevman) return FALSE; diff --git a/channels/urbdrc/common/msusb.c b/channels/urbdrc/common/msusb.c index 98d219276..2b2f40ad1 100644 --- a/channels/urbdrc/common/msusb.c +++ b/channels/urbdrc/common/msusb.c @@ -315,7 +315,8 @@ void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig) MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(wStream* s, UINT32 NumInterfaces) { MSUSB_CONFIG_DESCRIPTOR* MsConfig; - BYTE lenConfiguration, typeConfiguration; + BYTE lenConfiguration; + BYTE typeConfiguration; if (!Stream_CheckAndLogRequiredCapacityOfSize(TAG, (s), 3ULL + NumInterfaces, 2ULL)) return NULL; @@ -356,7 +357,8 @@ void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig) MSUSB_INTERFACE_DESCRIPTOR* MsInterface; MSUSB_PIPE_DESCRIPTOR** MsPipes; MSUSB_PIPE_DESCRIPTOR* MsPipe; - UINT32 inum = 0, pnum = 0; + UINT32 inum = 0; + UINT32 pnum = 0; WLog_INFO(TAG, "=================MsConfig:========================"); WLog_INFO(TAG, "wTotalLength:%" PRIu16 "", MsConfig->wTotalLength); WLog_INFO(TAG, "bConfigurationValue:%" PRIu8 "", MsConfig->bConfigurationValue); diff --git a/channels/urbdrc/common/urbdrc_helpers.c b/channels/urbdrc/common/urbdrc_helpers.c index 09d8cfa0c..9c55a4904 100644 --- a/channels/urbdrc/common/urbdrc_helpers.c +++ b/channels/urbdrc/common/urbdrc_helpers.c @@ -386,8 +386,11 @@ const char* urb_function_string(UINT16 urb) void urbdrc_dump_message(wLog* log, BOOL client, BOOL write, wStream* s) { const char* type = write ? "WRITE" : "READ"; - UINT32 InterfaceId, MessageId, FunctionId; - size_t length, pos; + UINT32 InterfaceId; + UINT32 MessageId; + UINT32 FunctionId; + size_t length; + size_t pos; pos = Stream_GetPosition(s); if (write) diff --git a/channels/video/client/video_main.c b/channels/video/client/video_main.c index 5173d8fe5..22403a225 100644 --- a/channels/video/client/video_main.c +++ b/channels/video/client/video_main.c @@ -575,7 +575,8 @@ static UINT video_control_on_data_received(IWTSVirtualChannelCallback* pChannelC VIDEO_PLUGIN* video; VideoClientContext* context; UINT ret = CHANNEL_RC_OK; - UINT32 cbSize, packetType; + UINT32 cbSize; + UINT32 packetType; WINPR_ASSERT(callback); WINPR_ASSERT(s); @@ -676,7 +677,8 @@ static void video_timer(VideoClientContext* video, UINT64 now) { PresentationContext* presentation; VideoClientContextPriv* priv; - VideoFrame *peekFrame, *frame = NULL; + VideoFrame* peekFrame; + VideoFrame* frame = NULL; WINPR_ASSERT(video); @@ -839,7 +841,8 @@ static UINT video_VideoData(VideoClientContext* context, const TSMM_VIDEO_DATA* { VideoSurface* surface = presentation->surface; H264_CONTEXT* h264 = presentation->h264; - UINT64 startTime = GetTickCount64(), timeAfterH264; + UINT64 startTime = GetTickCount64(); + UINT64 timeAfterH264; MAPPED_GEOMETRY* geom = presentation->geometry; const RECTANGLE_16 rect = { 0, 0, surface->alignedWidth, surface->alignedHeight }; @@ -932,7 +935,8 @@ static UINT video_data_on_data_received(IWTSVirtualChannelCallback* pChannelCall GENERIC_CHANNEL_CALLBACK* callback = (GENERIC_CHANNEL_CALLBACK*)pChannelCallback; VIDEO_PLUGIN* video; VideoClientContext* context; - UINT32 cbSize, packetType; + UINT32 cbSize; + UINT32 packetType; TSMM_VIDEO_DATA data; video = (VIDEO_PLUGIN*)callback->plugin; diff --git a/client/SDL/aad/wrapper/webview_impl.cpp b/client/SDL/aad/wrapper/webview_impl.cpp index 405200ba3..5f4d3d597 100644 --- a/client/SDL/aad/wrapper/webview_impl.cpp +++ b/client/SDL/aad/wrapper/webview_impl.cpp @@ -31,7 +31,8 @@ static std::vector split(const std::string& input, const std::strin { // passing -1 as the submatch index parameter performs splitting std::regex re(regex); - std::sregex_token_iterator first{ input.begin(), input.end(), re, -1 }, last; + std::sregex_token_iterator first{ input.begin(), input.end(), re, -1 }; + std::sregex_token_iterator last; return { first, last }; } diff --git a/client/SDL/sdl_freerdp.cpp b/client/SDL/sdl_freerdp.cpp index ea5545c5f..bcc6b211b 100644 --- a/client/SDL/sdl_freerdp.cpp +++ b/client/SDL/sdl_freerdp.cpp @@ -391,7 +391,8 @@ static BOOL sdl_draw_to_window(SdlContext* sdl, SdlWindow& window, SDL_Surface* screen = SDL_GetWindowSurface(window.window()); - int w, h; + int w; + int h; SDL_GetWindowSize(window.window(), &w, &h); if (!freerdp_settings_get_bool(context->settings, FreeRDP_SmartSizing)) diff --git a/client/SDL/sdl_pointer.cpp b/client/SDL/sdl_pointer.cpp index a99f7e3ec..f137e9a3c 100644 --- a/client/SDL/sdl_pointer.cpp +++ b/client/SDL/sdl_pointer.cpp @@ -107,7 +107,12 @@ static BOOL sdl_Pointer_Set(rdpContext* context, rdpPointer* pointer) BOOL sdl_Pointer_Set_Process(SDL_UserEvent* uptr) { - INT32 w, h, x, y, sw, sh; + INT32 w; + INT32 h; + INT32 x; + INT32 y; + INT32 sw; + INT32 sh; WINPR_ASSERT(uptr); diff --git a/client/SDL/sdl_touch.cpp b/client/SDL/sdl_touch.cpp index f9d1c12a2..b95e55dac 100644 --- a/client/SDL/sdl_touch.cpp +++ b/client/SDL/sdl_touch.cpp @@ -56,7 +56,8 @@ BOOL sdl_scale_coordinates(SdlContext* sdl, Uint32 windowId, INT32* px, INT32* p int offset_y = 0; for (const auto& window : sdl->windows) { - int w, h; + int w; + int h; const Uint32 id = SDL_GetWindowID(window.window()); if (id != windowId) { @@ -162,7 +163,8 @@ BOOL sdl_handle_touch_up(SdlContext* sdl, const SDL_TouchFingerEvent* ev) WINPR_ASSERT(sdl); WINPR_ASSERT(ev); - INT32 x, y; + INT32 x; + INT32 y; if (!sdl_get_touch_scaled(sdl, ev, &x, &y, TRUE)) return FALSE; return freerdp_client_handle_touch(sdl->common(), FREERDP_TOUCH_UP | FREERDP_TOUCH_HAS_PRESSURE, @@ -175,7 +177,8 @@ BOOL sdl_handle_touch_down(SdlContext* sdl, const SDL_TouchFingerEvent* ev) WINPR_ASSERT(sdl); WINPR_ASSERT(ev); - INT32 x, y; + INT32 x; + INT32 y; if (!sdl_get_touch_scaled(sdl, ev, &x, &y, TRUE)) return FALSE; return freerdp_client_handle_touch( @@ -188,7 +191,8 @@ BOOL sdl_handle_touch_motion(SdlContext* sdl, const SDL_TouchFingerEvent* ev) WINPR_ASSERT(sdl); WINPR_ASSERT(ev); - INT32 x, y; + INT32 x; + INT32 y; if (!sdl_get_touch_scaled(sdl, ev, &x, &y, TRUE)) return FALSE; return freerdp_client_handle_touch( diff --git a/client/Wayland/wlf_disp.c b/client/Wayland/wlf_disp.c index 095a1a17b..de03faa9d 100644 --- a/client/Wayland/wlf_disp.c +++ b/client/Wayland/wlf_disp.c @@ -435,7 +435,8 @@ BOOL wlf_disp_uninit(wlfDispContext* wlfDisp, DispClientContext* disp) int wlf_list_monitors(wlfContext* wlc) { - uint32_t i, nmonitors = UwacDisplayGetNbOutputs(wlc->display); + uint32_t i; + uint32_t nmonitors = UwacDisplayGetNbOutputs(wlc->display); for (i = 0; i < nmonitors; i++) { diff --git a/client/Wayland/wlf_input.c b/client/Wayland/wlf_input.c index b3a42111a..9747b2f4b 100644 --- a/client/Wayland/wlf_input.c +++ b/client/Wayland/wlf_input.c @@ -61,7 +61,8 @@ static BOOL scale_signed_coordinates(rdpContext* context, int32_t* x, int32_t* y BOOL wlf_handle_pointer_enter(freerdp* instance, const UwacPointerEnterLeaveEvent* ev) { - uint32_t x, y; + uint32_t x; + uint32_t y; rdpClientContext* cctx; if (!instance || !ev) @@ -81,7 +82,8 @@ BOOL wlf_handle_pointer_enter(freerdp* instance, const UwacPointerEnterLeaveEven BOOL wlf_handle_pointer_motion(freerdp* instance, const UwacPointerMotionEvent* ev) { - uint32_t x, y; + uint32_t x; + uint32_t y; rdpClientContext* cctx; if (!instance || !ev) @@ -106,7 +108,8 @@ BOOL wlf_handle_pointer_buttons(freerdp* instance, const UwacPointerButtonEvent* rdpClientContext* cctx; UINT16 flags = 0; UINT16 xflags = 0; - uint32_t x, y; + uint32_t x; + uint32_t y; if (!instance || !ev) return FALSE; @@ -397,7 +400,8 @@ BOOL wlf_keyboard_modifiers(freerdp* instance, const UwacKeyboardModifiersEvent* BOOL wlf_handle_touch_up(freerdp* instance, const UwacTouchUp* ev) { - int32_t x, y; + int32_t x; + int32_t y; WINPR_ASSERT(instance); WINPR_ASSERT(ev); @@ -416,7 +420,8 @@ BOOL wlf_handle_touch_up(freerdp* instance, const UwacTouchUp* ev) BOOL wlf_handle_touch_down(freerdp* instance, const UwacTouchDown* ev) { - int32_t x, y; + int32_t x; + int32_t y; WINPR_ASSERT(instance); WINPR_ASSERT(ev); @@ -435,7 +440,8 @@ BOOL wlf_handle_touch_down(freerdp* instance, const UwacTouchDown* ev) BOOL wlf_handle_touch_motion(freerdp* instance, const UwacTouchMotion* ev) { - int32_t x, y; + int32_t x; + int32_t y; WINPR_ASSERT(instance); WINPR_ASSERT(ev); diff --git a/client/Wayland/wlf_pointer.c b/client/Wayland/wlf_pointer.c index 2cbd143aa..0185ec04c 100644 --- a/client/Wayland/wlf_pointer.c +++ b/client/Wayland/wlf_pointer.c @@ -71,7 +71,10 @@ static BOOL wlf_Pointer_Set(rdpContext* context, rdpPointer* pointer) wlfContext* wlf = (wlfContext*)context; wlfPointer* ptr = (wlfPointer*)pointer; void* data; - UINT32 w, h, x, y; + UINT32 w; + UINT32 h; + UINT32 x; + UINT32 y; size_t size; UwacReturnCode rc; BOOL res = FALSE; diff --git a/client/Wayland/wlfreerdp.c b/client/Wayland/wlfreerdp.c index 73452935d..c1678ff22 100644 --- a/client/Wayland/wlfreerdp.c +++ b/client/Wayland/wlfreerdp.c @@ -51,7 +51,10 @@ static BOOL wl_update_buffer(wlfContext* context_w, INT32 ix, INT32 iy, INT32 iw BOOL res = FALSE; rdpGdi* gdi; char* data; - UINT32 x, y, w, h; + UINT32 x; + UINT32 y; + UINT32 w; + UINT32 h; UwacSize geometry; size_t stride; UwacReturnCode rc; @@ -119,8 +122,10 @@ static BOOL wl_end_paint(rdpContext* context) { rdpGdi* gdi; wlfContext* context_w; - INT32 x, y; - INT32 w, h; + INT32 x; + INT32 y; + INT32 w; + INT32 h; if (!context || !context->gdi || !context->gdi->primary) return FALSE; @@ -224,7 +229,8 @@ static BOOL wl_post_connect(freerdp* instance) rdpSettings* settings; char* title = "FreeRDP"; char* app_id = "wlfreerdp"; - UINT32 w, h; + UINT32 w; + UINT32 h; if (!instance || !instance->context) return FALSE; @@ -770,7 +776,8 @@ BOOL wlf_scale_coordinates(rdpContext* context, UINT32* px, UINT32* py, BOOL fro wlfContext* wlf = (wlfContext*)context; rdpGdi* gdi; UwacSize geometry; - double sx, sy; + double sx; + double sy; if (!context || !px || !py || !context->gdi) return FALSE; diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index eda8899c2..e0bc90cab 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -880,7 +880,9 @@ static BOOL xf_play_sound(rdpContext* context, const PLAY_SOUND_UPDATE* play_sou static void xf_check_extensions(xfContext* context) { - int xkb_opcode, xkb_event, xkb_error; + int xkb_opcode; + int xkb_event; + int xkb_error; int xkb_major = XkbMajorVersion; int xkb_minor = XkbMinorVersion; @@ -914,12 +916,15 @@ static const size_t TEST_PTR_LEN = sizeof(TEST_PTR_STR) / sizeof(char); static void xf_get_x11_button_map(xfContext* xfc, unsigned char* x11_map) { #ifdef WITH_XI - int opcode, event, error; + int opcode; + int event; + int error; XDevice* ptr_dev; XExtensionVersion* version; XDeviceInfo* devices1; XIDeviceInfo* devices2; - int i, num_devices; + int i; + int num_devices; if (XQueryExtension(xfc->display, "XInputExtension", &opcode, &event, &error)) { @@ -1683,7 +1688,8 @@ static void xf_TerminateEventHandler(void* context, const TerminateEventArgs* e) #ifdef WITH_XRENDER static void xf_ZoomingChangeEventHandler(void* context, const ZoomingChangeEventArgs* e) { - int w, h; + int w; + int h; rdpSettings* settings; xfContext* xfc = (xfContext*)context; @@ -1876,7 +1882,8 @@ BOOL xf_setup_x11(xfContext* xfc) { Atom actual_type = 0; int actual_format = 0; - unsigned long nitems = 0, after = 0; + unsigned long nitems = 0; + unsigned long after = 0; unsigned char* data = NULL; int status = LogTagAndXGetWindowProperty( TAG, xfc->display, RootWindowOfScreen(xfc->screen), xfc->_NET_SUPPORTED, 0, 1024, False, diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index 9687386df..fcc0d3261 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -709,7 +709,8 @@ static BOOL xf_clipboard_format_equal(const CLIPRDR_FORMAT* a, const CLIPRDR_FOR static BOOL xf_clipboard_changed(xfClipboard* clipboard, const CLIPRDR_FORMAT* formats, UINT32 numFormats) { - UINT32 x, y; + UINT32 x; + UINT32 y; WINPR_ASSERT(clipboard); WINPR_ASSERT(formats || (numFormats == 0)); @@ -2276,7 +2277,8 @@ xfClipboard* xf_clipboard_new(xfContext* xfc, BOOL relieveFilenameRestriction) if (XFixesQueryExtension(xfc->display, &clipboard->xfixes_event_base, &clipboard->xfixes_error_base)) { - int xfmajor, xfminor; + int xfmajor; + int xfminor; if (XFixesQueryVersion(xfc->display, &xfmajor, &xfminor)) { diff --git a/client/X11/xf_disp.c b/client/X11/xf_disp.c index 4af1054a2..077e2511d 100644 --- a/client/X11/xf_disp.c +++ b/client/X11/xf_disp.c @@ -433,7 +433,8 @@ BOOL xf_disp_handle_xevent(xfContext* xfc, const XEvent* event) { xfDispContext* xfDisp; rdpSettings* settings; - UINT32 maxWidth, maxHeight; + UINT32 maxWidth; + UINT32 maxHeight; if (!xfc || !event) return FALSE; diff --git a/client/X11/xf_event.c b/client/X11/xf_event.c index bee5098f9..a7ed8244e 100644 --- a/client/X11/xf_event.c +++ b/client/X11/xf_event.c @@ -280,7 +280,8 @@ static BOOL xf_event_execute_action_script(xfContext* xfc, const XEvent* event) void xf_adjust_coordinates_to_screen(xfContext* xfc, UINT32* x, UINT32* y) { rdpSettings* settings; - INT64 tx, ty; + INT64 tx; + INT64 ty; if (!xfc || !xfc->common.context.settings || !y || !x) return; @@ -337,8 +338,10 @@ void xf_event_adjust_coordinates(xfContext* xfc, int* x, int* y) static BOOL xf_event_Expose(xfContext* xfc, const XExposeEvent* event, BOOL app) { - int x, y; - int w, h; + int x; + int y; + int w; + int h; rdpSettings* settings; WINPR_ASSERT(xfc); @@ -809,7 +812,8 @@ static BOOL xf_event_ConfigureNotify(xfContext* xfc, const XConfigureEvent* even if (freerdp_settings_get_bool(settings, FreeRDP_DynamicResolutionUpdate)) { - int alignedWidth, alignedHeight; + int alignedWidth; + int alignedHeight; alignedWidth = (xfc->window->width / 2) * 2; alignedHeight = (xfc->window->height / 2) * 2; /* ask the server to resize using the display channel */ diff --git a/client/X11/xf_floatbar.c b/client/X11/xf_floatbar.c index 4008e1c1d..2ed47d4ee 100644 --- a/client/X11/xf_floatbar.c +++ b/client/X11/xf_floatbar.c @@ -222,7 +222,8 @@ static BOOL create_floatbar(xfFloatbar* floatbar) BOOL xf_floatbar_toggle_fullscreen(xfFloatbar* floatbar, bool fullscreen) { - int i, size; + int i; + int size; bool visible = False; xfContext* xfc; @@ -388,9 +389,11 @@ static unsigned long xf_floatbar_get_color(xfFloatbar* floatbar, char* rgb_value static void xf_floatbar_event_expose(xfFloatbar* floatbar) { - GC gc, shape_gc; + GC gc; + GC shape_gc; Pixmap pmap; - XPoint shape[5] = { 0 }, border[5] = { 0 }; + XPoint shape[5] = { 0 }; + XPoint border[5] = { 0 }; int len; WINPR_ASSERT(floatbar); @@ -638,7 +641,9 @@ static void xf_floatbar_event_buttonrelease(xfFloatbar* floatbar, const XButtonE static void xf_floatbar_resize(xfFloatbar* floatbar, const XMotionEvent* event) { - int x, width, movement; + int x; + int width; + int movement; WINPR_ASSERT(floatbar); WINPR_ASSERT(event); @@ -673,7 +678,8 @@ static void xf_floatbar_resize(xfFloatbar* floatbar, const XMotionEvent* event) static void xf_floatbar_dragging(xfFloatbar* floatbar, const XMotionEvent* event) { - int x, movement; + int x; + int movement; WINPR_ASSERT(floatbar); WINPR_ASSERT(event); @@ -892,7 +898,8 @@ static void xf_floatbar_button_free(xfContext* xfc, xfFloatbarButton* button) void xf_floatbar_free(xfFloatbar* floatbar) { - size_t i, size; + size_t i; + size_t size; xfContext* xfc; if (!floatbar) diff --git a/client/X11/xf_gfx.c b/client/X11/xf_gfx.c index 441a33f0c..1280c3f41 100644 --- a/client/X11/xf_gfx.c +++ b/client/X11/xf_gfx.c @@ -33,12 +33,15 @@ static UINT xf_OutputUpdate(xfContext* xfc, xfGfxSurface* surface) { UINT rc = ERROR_INTERNAL_ERROR; - UINT32 surfaceX, surfaceY; + UINT32 surfaceX; + UINT32 surfaceY; RECTANGLE_16 surfaceRect; rdpGdi* gdi; const rdpSettings* settings; - UINT32 nbRects, x; - double sx, sy; + UINT32 nbRects; + UINT32 x; + double sx; + double sy; const RECTANGLE_16* rects; WINPR_ASSERT(xfc); diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c index 58f0c763a..4644cc9a1 100644 --- a/client/X11/xf_graphics.c +++ b/client/X11/xf_graphics.c @@ -48,7 +48,10 @@ static BOOL xf_Pointer_Set(rdpContext* context, rdpPointer* pointer); BOOL xf_decode_color(xfContext* xfc, const UINT32 srcColor, XColor* color) { UINT32 SrcFormat = 0; - BYTE r = 0, g = 0, b = 0, a = 0; + BYTE r = 0; + BYTE g = 0; + BYTE b = 0; + BYTE a = 0; if (!xfc || !color) return FALSE; diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index 82f6f99fb..41b9741ef 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -243,7 +243,9 @@ int xf_input_init(xfContext* xfc, Window window) { int major = XI_2_Major; int minor = XI_2_Minor; - int opcode = 0, event = 0, error = 0; + int opcode = 0; + int event = 0; + int error = 0; WINPR_ASSERT(xfc); @@ -656,7 +658,8 @@ static void xf_input_show_cursor(xfContext* xfc) static int xf_input_touch_remote(xfContext* xfc, XIDeviceEvent* event, int evtype) { - int x, y; + int x; + int y; int touchId; RdpeiClientContext* rdpei = xfc->common.rdpei; @@ -689,7 +692,8 @@ static int xf_input_touch_remote(xfContext* xfc, XIDeviceEvent* event, int evtyp static BOOL xf_input_pen_remote(xfContext* xfc, XIDeviceEvent* event, int evtype, int deviceid) { - int x, y; + int x; + int y; RdpeiClientContext* rdpei = xfc->common.rdpei; if (!rdpei) diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c index c0609f755..bcf6bf8c2 100644 --- a/client/X11/xf_keyboard.c +++ b/client/X11/xf_keyboard.c @@ -422,7 +422,9 @@ void xf_keyboard_focus_in(xfContext* xfc) { UINT32 state = 0; Window w = None; - int d = 0, x = 0, y = 0; + int d = 0; + int x = 0; + int y = 0; WINPR_ASSERT(xfc); if (!xfc->display || !xfc->window) diff --git a/client/X11/xf_monitor.c b/client/X11/xf_monitor.c index 69355f8a1..ec32463f5 100644 --- a/client/X11/xf_monitor.c +++ b/client/X11/xf_monitor.c @@ -56,8 +56,10 @@ int xf_list_monitors(xfContext* xfc) { Display* display; - int major, minor; - int i, nmonitors = 0; + int major; + int minor; + int i; + int nmonitors = 0; display = XOpenDisplay(NULL); if (!display) @@ -144,12 +146,15 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) BOOL primaryMonitorFound = FALSE; VIRTUAL_SCREEN* vscreen = NULL; rdpSettings* settings = NULL; - int mouse_x = 0, mouse_y = 0, _dummy_i = 0; + int mouse_x = 0; + int mouse_y = 0; + int _dummy_i = 0; Window _dummy_w = 0; int current_monitor = 0; Screen* screen = NULL; #if defined WITH_XINERAMA || defined WITH_XRANDR - int major = 0, minor = 0; + int major = 0; + int minor = 0; #endif #if defined(USABLE_XRANDR) XRRMonitorInfo* rrmonitors = NULL; @@ -429,7 +434,8 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) if (useXRandr && rrmonitors) { - Rotation rot, ret; + Rotation rot; + Rotation ret; attrs = &monitor->attributes; attrs->physicalWidth = rrmonitors[i].mwidth; attrs->physicalHeight = rrmonitors[i].mheight; @@ -457,7 +463,8 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) * to go fullscreen on the current monitor only */ if (nmonitors == 0 && vscreen->nmonitors > 0) { - INT32 width, height; + INT32 width; + INT32 height; if (!vscreen->monitors) goto fail; diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index bd123aef2..76400c754 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -155,7 +155,8 @@ void xf_rail_adjust_position(xfContext* xfc, xfAppWindow* appWindow) void xf_rail_end_local_move(xfContext* xfc, xfAppWindow* appWindow) { - int x, y; + int x; + int y; int child_x; int child_y; unsigned int mask; @@ -902,7 +903,8 @@ static UINT xf_rail_server_handshake_ex(RailClientContext* context, static UINT xf_rail_server_local_move_size(RailClientContext* context, const RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { - int x = 0, y = 0; + int x = 0; + int y = 0; int direction = 0; Window child_window; xfContext* xfc = (xfContext*)context->custom; diff --git a/client/X11/xf_tsmf.c b/client/X11/xf_tsmf.c index 585c5ba42..e198e8de7 100644 --- a/client/X11/xf_tsmf.c +++ b/client/X11/xf_tsmf.c @@ -73,7 +73,8 @@ static BOOL xf_tsmf_is_format_supported(xfXvContext* xv, UINT32 pixfmt) static int xf_tsmf_xv_video_frame_event(TsmfClientContext* tsmf, TSMF_VIDEO_FRAME_EVENT* event) { int i; - int x, y; + int x; + int y; UINT32 width; UINT32 height; BYTE* data1; diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index c71988806..187dda8b5 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -161,7 +161,8 @@ void xf_SetWindowFullscreen(xfContext* xfc, xfWindow* window, BOOL fullscreen) { UINT32 i; const rdpSettings* settings; - int startX, startY; + int startX; + int startY; UINT32 width = window->width; UINT32 height = window->height; @@ -1112,7 +1113,8 @@ void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, UINT32 void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int width, int height) { - int ax, ay; + int ax; + int ay; const rdpSettings* settings; WINPR_ASSERT(xfc); diff --git a/client/common/client.c b/client/common/client.c index d1c2dfa4f..06be04a56 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -364,7 +364,8 @@ out: int freerdp_client_settings_parse_assistance_file(rdpSettings* settings, int argc, char* argv[]) { - int status, x; + int status; + int x; int ret = -1; char* filename; char* password = NULL; @@ -1514,7 +1515,8 @@ BOOL freerdp_client_send_wheel_event(rdpClientContext* cctx, UINT16 mflags) { UINT rc; UINT64 flags = 0; - INT32 x = 0, y = 0; + INT32 x = 0; + INT32 y = 0; INT32 value = mflags & 0xFF; if (mflags & PTR_FLAGS_WHEEL_NEGATIVE) diff --git a/client/common/client_cliprdr_file.c b/client/common/client_cliprdr_file.c index 9ca914be3..9314b1ba6 100644 --- a/client/common/client_cliprdr_file.c +++ b/client/common/client_cliprdr_file.c @@ -783,7 +783,8 @@ static void write_file_attributes(CliprdrFuseFile* fuse_file, struct stat* attr) static void cliprdr_file_fuse_lookup(fuse_req_t fuse_req, fuse_ino_t parent_ino, const char* name) { CliprdrFileContext* file_context = fuse_req_userdata(fuse_req); - CliprdrFuseFile *parent, *fuse_file; + CliprdrFuseFile* parent; + CliprdrFuseFile* fuse_file; struct fuse_entry_param entry = { 0 }; WINPR_ASSERT(file_context); @@ -1020,9 +1021,11 @@ static void cliprdr_file_fuse_readdir(fuse_req_t fuse_req, fuse_ino_t fuse_ino, off_t offset, struct fuse_file_info* file_info) { CliprdrFileContext* file_context = fuse_req_userdata(fuse_req); - CliprdrFuseFile *fuse_file, *child; + CliprdrFuseFile* fuse_file; + CliprdrFuseFile* child; struct stat attr = { 0 }; - size_t written_size, entry_size; + size_t written_size; + size_t entry_size; char* filename; char* buf; off_t i; diff --git a/client/common/cmdline.c b/client/common/cmdline.c index fa576e06c..3485936d2 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -1395,7 +1395,8 @@ BOOL freerdp_set_connection_type(rdpSettings* settings, UINT32 type) static UINT32 freerdp_get_keyboard_layout_for_type(const char* name, DWORD type) { - size_t count = 0, x; + size_t count = 0; + size_t x; RDP_KEYBOARD_LAYOUT* layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_STANDARD, &count); @@ -1598,7 +1599,8 @@ int freerdp_client_settings_command_line_status_print(rdpSettings* settings, int static void freerdp_client_print_keyboard_type_list(const char* msg, DWORD type) { - size_t x, count = 0; + size_t x; + size_t count = 0; RDP_KEYBOARD_LAYOUT* layouts; layouts = freerdp_keyboard_get_layouts(type, &count); @@ -2136,7 +2138,8 @@ static int parse_tls_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_ WINPR_ASSERT(settings); WINPR_ASSERT(arg); - size_t count, x; + size_t count; + size_t x; char** ptr = CommandLineParseCommaSeparatedValues(arg->Value, &count); for (x = 0; x < count; x++) { @@ -2346,7 +2349,8 @@ static int parse_codec_cache_options(rdpSettings* settings, const COMMAND_LINE_A static BOOL check_kbd_remap_valid(const char* token) { - DWORD key, value; + DWORD key; + DWORD value; WINPR_ASSERT(token); /* The remapping is only allowed for scancodes, so maximum is 999=999 */ @@ -2545,7 +2549,8 @@ static int parse_size_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT if (p) { - unsigned long w, h; + unsigned long w; + unsigned long h; if (!parseSizeValue(arg->Value, &w, &h) || (w > UINT16_MAX) || (h > UINT16_MAX)) return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; @@ -2691,7 +2696,8 @@ static int parse_smart_sizing_options(rdpSettings* settings, const COMMAND_LINE_ if (arg->Value) { - unsigned long w, h; + unsigned long w; + unsigned long h; if (!parseSizeValue(arg->Value, &w, &h) || (w > UINT16_MAX) || (h > UINT16_MAX)) return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; @@ -2939,7 +2945,8 @@ static int parse_clipboard_options(rdpSettings* settings, const COMMAND_LINE_ARG char** p; const char** pc; } ptr; - size_t count, x; + size_t count; + size_t x; ptr.p = CommandLineParseCommaSeparatedValues(arg->Value, &count); for (x = 0; (x < count) && (rc == 0); x++) { @@ -3105,7 +3112,8 @@ static int parse_sec_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_ WINPR_ASSERT(settings); WINPR_ASSERT(arg); - size_t count = 0, x; + size_t count = 0; + size_t x; char** ptr = CommandLineParseCommaSeparatedValues(arg->Value, &count); if (count == 0) return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; @@ -3224,7 +3232,8 @@ static int parse_cert_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT char** p; const char** pc; } ptr; - size_t count, x; + size_t count; + size_t x; ptr.p = CommandLineParseCommaSeparatedValues(arg->Value, &count); for (x = 0; (x < count) && (rc == 0); x++) { @@ -3521,7 +3530,8 @@ static int parse_tune_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT WINPR_ASSERT(settings); WINPR_ASSERT(arg); - size_t x, count; + size_t x; + size_t count; union { char** p; @@ -4558,7 +4568,8 @@ static int freerdp_client_settings_parse_command_line_arguments_int( } CommandLineSwitchCase(arg, "window-position") { - unsigned long x, y; + unsigned long x; + unsigned long y; if (!arg->Value) return COMMAND_LINE_ERROR_MISSING_ARGUMENT; diff --git a/client/common/file.c b/client/common/file.c index 3de54ef8c..83f27358f 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -884,9 +884,11 @@ BOOL freerdp_client_parse_rdp_file_buffer_ex(rdpFile* file, const BYTE* buffer, char* line; char* type; char* context; - char *d1, *d2; + char* d1; + char* d2; char* beg; - char *name, *value; + char* name; + char* value; char* copy = NULL; if (!file) @@ -1316,7 +1318,8 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett { size_t offset = 0; - UINT32 x, count = freerdp_settings_get_uint32(settings, FreeRDP_NumMonitorIds); + UINT32 x; + UINT32 count = freerdp_settings_get_uint32(settings, FreeRDP_NumMonitorIds); const UINT32* MonitorIds = freerdp_settings_get_pointer(settings, FreeRDP_MonitorIds); /* String size: 10 char UINT32 max string length, 1 char separator, one element NULL */ size_t size = count * (10 + 1) + 1; @@ -1622,7 +1625,8 @@ size_t freerdp_client_write_rdp_file_buffer(const rdpFile* file, char* buffer, s static ADDIN_ARGV* rdp_file_to_args(const char* channel, const char* values) { - size_t count, x; + size_t count; + size_t x; char** p = NULL; ADDIN_ARGV* args = freerdp_addin_argv_new(0, NULL); if (!args) @@ -2419,7 +2423,8 @@ BOOL freerdp_client_populate_settings_from_rdp_file(const rdpFile* file, rdpSett if (~(size_t)file->SelectedMonitors) { - size_t count = 0, x; + size_t count = 0; + size_t x; char** args = CommandLineParseCommaSeparatedValues(file->SelectedMonitors, &count); UINT32* list; diff --git a/libfreerdp/cache/glyph.c b/libfreerdp/cache/glyph.c index 3653b7ebf..ad3c4925a 100644 --- a/libfreerdp/cache/glyph.c +++ b/libfreerdp/cache/glyph.c @@ -75,8 +75,10 @@ static BOOL update_process_glyph(rdpContext* context, const BYTE* data, UINT32 c INT32* y, UINT32 cacheId, UINT32 flAccel, BOOL fOpRedundant, const RDP_RECT* bound) { - INT32 sx = 0, sy = 0; - INT32 dx, dy; + INT32 sx = 0; + INT32 sy = 0; + INT32 dx; + INT32 dy; rdpGlyph* glyph; rdpGlyphCache* glyph_cache; @@ -286,7 +288,10 @@ static BOOL update_process_glyph_fragments(rdpContext* context, const BYTE* data static BOOL update_gdi_glyph_index(rdpContext* context, GLYPH_INDEX_ORDER* glyphIndex) { - INT32 bkWidth = 0, bkHeight = 0, opWidth = 0, opHeight = 0; + INT32 bkWidth = 0; + INT32 bkHeight = 0; + INT32 opWidth = 0; + INT32 opHeight = 0; if (!context || !glyphIndex || !context->cache) return FALSE; @@ -312,11 +317,16 @@ static BOOL update_gdi_glyph_index(rdpContext* context, GLYPH_INDEX_ORDER* glyph static BOOL update_gdi_fast_index(rdpContext* context, const FAST_INDEX_ORDER* fastIndex) { - INT32 x, y; - INT32 opLeft, opTop; - INT32 opRight, opBottom; - INT32 opWidth = 0, opHeight = 0; - INT32 bkWidth = 0, bkHeight = 0; + INT32 x; + INT32 y; + INT32 opLeft; + INT32 opTop; + INT32 opRight; + INT32 opBottom; + INT32 opWidth = 0; + INT32 opHeight = 0; + INT32 bkWidth = 0; + INT32 bkHeight = 0; if (!context || !fastIndex || !context->cache) return FALSE; @@ -383,12 +393,17 @@ static BOOL update_gdi_fast_index(rdpContext* context, const FAST_INDEX_ORDER* f static BOOL update_gdi_fast_glyph(rdpContext* context, const FAST_GLYPH_ORDER* fastGlyph) { - INT32 x, y; + INT32 x; + INT32 y; BYTE text_data[4] = { 0 }; - INT32 opLeft, opTop; - INT32 opRight, opBottom; - INT32 opWidth = 0, opHeight = 0; - INT32 bkWidth = 0, bkHeight = 0; + INT32 opLeft; + INT32 opTop; + INT32 opRight; + INT32 opBottom; + INT32 opWidth = 0; + INT32 opHeight = 0; + INT32 bkWidth = 0; + INT32 bkHeight = 0; rdpCache* cache; if (!context || !fastGlyph || !context->cache) diff --git a/libfreerdp/codec/clear.c b/libfreerdp/codec/clear.c index bdfeb8084..1ab56317d 100644 --- a/libfreerdp/codec/clear.c +++ b/libfreerdp/codec/clear.c @@ -149,7 +149,8 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, UINT32 bitmapDataByteCount UINT32 nDstStep, UINT32 nXDstRel, UINT32 nYDstRel, UINT32 nDstWidth, UINT32 nDstHeight) { - UINT32 x = 0, y = 0; + UINT32 x = 0; + UINT32 y = 0; UINT32 i; UINT32 pixelCount; UINT32 bitmapDataOffset; @@ -181,7 +182,9 @@ static BOOL clear_decompress_subcode_rlex(wStream* s, UINT32 bitmapDataByteCount for (i = 0; i < paletteCount; i++) { - BYTE r, g, b; + BYTE r; + BYTE g; + BYTE b; Stream_Read_UINT8(s, b); Stream_Read_UINT8(s, g); Stream_Read_UINT8(s, r); @@ -374,7 +377,9 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear, wStream* s, while (suboffset < residualByteCount) { - BYTE r, g, b; + BYTE r; + BYTE g; + BYTE b; UINT32 runLengthFactor; UINT32 color; @@ -587,7 +592,9 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, wStream* s, UINT32 while (suboffset < bandsByteCount) { - BYTE cr, cg, cb; + BYTE cr; + BYTE cg; + BYTE cb; UINT16 xStart; UINT16 xEnd; UINT16 yStart; @@ -706,7 +713,9 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear, wStream* s, UINT32 for (UINT32 y = 0; y < vBarShortPixelCount; y++) { - BYTE r = 0, g = 0, b = 0; + BYTE r = 0; + BYTE g = 0; + BYTE b = 0; BYTE* dstBuffer = &vBarShortEntry->pixels[y * FreeRDPGetBytesPerPixel(clear->format)]; UINT32 color = 0; diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index 2a7621f89..071797ce0 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -43,7 +43,8 @@ BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height, const BYTE* data) { - UINT32 x, y; + UINT32 x; + UINT32 y; const BYTE* srcp; BYTE* dstp; BYTE* dstData; @@ -87,7 +88,8 @@ BOOL freerdp_image_copy_from_monochrome(BYTE* WINPR_RESTRICT pDstData, UINT32 Ds UINT32 backColor, UINT32 foreColor, const gdiPalette* WINPR_RESTRICT palette) { - UINT32 x, y; + UINT32 x; + UINT32 y; BOOL vFlip; UINT32 monoStep; const UINT32 dstBytesPerPixel = FreeRDPGetBytesPerPixel(DstFormat); @@ -258,9 +260,12 @@ BOOL freerdp_image_copy_from_icon_data(BYTE* WINPR_RESTRICT pDstData, UINT32 Dst { BYTE nextBit; const BYTE* maskByte; - UINT32 x, y; + UINT32 x; + UINT32 y; UINT32 stride; - BYTE r, g, b; + BYTE r; + BYTE g; + BYTE b; BYTE* dstBuf = pDstData; UINT32 dstBpp = FreeRDPGetBytesPerPixel(DstFormat); @@ -306,7 +311,8 @@ static BOOL freerdp_image_copy_from_pointer_data_1bpp( UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT xorMask, UINT32 xorMaskLength, const BYTE* WINPR_RESTRICT andMask, UINT32 andMaskLength, UINT32 xorBpp) { - UINT32 x, y; + UINT32 x; + UINT32 y; BOOL vFlip; UINT32 xorStep; UINT32 andStep; @@ -394,7 +400,8 @@ static BOOL freerdp_image_copy_from_pointer_data_xbpp( const BYTE* WINPR_RESTRICT andMask, UINT32 andMaskLength, UINT32 xorBpp, const gdiPalette* palette) { - UINT32 x, y; + UINT32 x; + UINT32 y; BOOL vFlip; UINT32 xorStep; UINT32 andStep; diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c index 49c194602..39efd764f 100644 --- a/libfreerdp/codec/dsp_ffmpeg.c +++ b/libfreerdp/codec/dsp_ffmpeg.c @@ -500,7 +500,8 @@ static BOOL ffmpeg_encode_frame(AVCodecContext* context, AVFrame* in, AVPacket* static BOOL ffmpeg_fill_frame(AVFrame* frame, const AUDIO_FORMAT* inputFormat, const BYTE* data, size_t size) { - int ret, bpp; + int ret; + int bpp; #if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100) frame->channels = inputFormat->nChannels; frame->channel_layout = av_get_default_channel_layout(frame->channels); @@ -674,7 +675,8 @@ static BOOL freerdp_dsp_channel_mix(FREERDP_DSP_CONTEXT* context, const BYTE* sr { UINT32 bpp; size_t samples; - size_t x, y; + size_t x; + size_t y; if (!context || !data || !length || !dstFormat) return FALSE; diff --git a/libfreerdp/codec/h264.c b/libfreerdp/codec/h264.c index 4bfc3c0b7..a9d83cd1e 100644 --- a/libfreerdp/codec/h264.c +++ b/libfreerdp/codec/h264.c @@ -155,7 +155,8 @@ static BOOL allocate_h264_metablock(UINT32 QP, RECTANGLE_16* rectangles, static INLINE BOOL diff_tile(const RECTANGLE_16* regionRect, BYTE* pYUVData[3], BYTE* pOldYUVData[3], UINT32 const iStride[3]) { - size_t size, y; + size_t size; + size_t y; if (!regionRect || !pYUVData || !pOldYUVData || !iStride) return FALSE; size = regionRect->right - regionRect->left; @@ -189,7 +190,9 @@ static BOOL detect_changes(BOOL firstFrameDone, const UINT32 QP, const RECTANGLE BYTE* pYUVData[3], BYTE* pOldYUVData[3], UINT32 const iStride[3], RDPGFX_H264_METABLOCK* meta) { - size_t count = 0, wc, hc; + size_t count = 0; + size_t wc; + size_t hc; RECTANGLE_16* rectangles; if (!regionRect || !pYUVData || !pOldYUVData || !iStride || !meta) @@ -207,7 +210,8 @@ static BOOL detect_changes(BOOL firstFrameDone, const UINT32 QP, const RECTANGLE } else { - size_t x, y; + size_t x; + size_t y; for (y = regionRect->top; y < regionRect->bottom; y += 64) { for (x = regionRect->left; x < regionRect->right; x += 64) diff --git a/libfreerdp/codec/h264_openh264.c b/libfreerdp/codec/h264_openh264.c index c1dd7d040..3c199da0d 100644 --- a/libfreerdp/codec/h264_openh264.c +++ b/libfreerdp/codec/h264_openh264.c @@ -182,7 +182,8 @@ static int openh264_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 static int openh264_compress(H264_CONTEXT* h264, const BYTE** pYUVData, const UINT32* iStride, BYTE** ppDstData, UINT32* pDstSize) { - int i, j; + int i; + int j; int status; SFrameBSInfo info = { 0 }; SSourcePicture pic = { 0 }; diff --git a/libfreerdp/codec/mppc.c b/libfreerdp/codec/mppc.c index 69b72e7d3..a30895dee 100644 --- a/libfreerdp/codec/mppc.c +++ b/libfreerdp/codec/mppc.c @@ -450,7 +450,9 @@ int mppc_compress(MPPC_CONTEXT* mppc, const BYTE* pSrcData, UINT32 SrcSize, BYTE BYTE* HistoryPtr; UINT32 HistoryOffset; UINT32 HistoryBufferSize; - BYTE Sym1, Sym2, Sym3; + BYTE Sym1; + BYTE Sym2; + BYTE Sym3; UINT32 CompressionLevel; wBitStream* bs; diff --git a/libfreerdp/codec/ncrush.c b/libfreerdp/codec/ncrush.c index 9cdb02bb3..4ffa2db5f 100644 --- a/libfreerdp/codec/ncrush.c +++ b/libfreerdp/codec/ncrush.c @@ -2337,7 +2337,8 @@ static int ncrush_hash_table_add(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, U static int ncrush_find_match_length(const BYTE* Ptr1, const BYTE* Ptr2, BYTE* HistoryPtr) { - BYTE val1, val2; + BYTE val1; + BYTE val2; const BYTE* Ptr = Ptr1; WINPR_ASSERT(Ptr1); @@ -2362,7 +2363,8 @@ static int ncrush_find_match_length(const BYTE* Ptr1, const BYTE* Ptr2, BYTE* Hi static int ncrush_find_best_match(NCRUSH_CONTEXT* ncrush, UINT16 HistoryOffset, UINT32* pMatchOffset) { - int i, j; + int i; + int j; int Length; int MatchLength; BYTE* MatchPtr; @@ -2480,7 +2482,8 @@ static int ncrush_find_best_match(NCRUSH_CONTEXT* ncrush, UINT16 HistoryOffset, static int ncrush_move_encoder_windows(NCRUSH_CONTEXT* ncrush, BYTE* HistoryPtr) { - int i, j; + int i; + int j; int NewHash; int NewMatch; UINT32 HistoryOffset; @@ -2939,8 +2942,10 @@ int ncrush_compress(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, UINT32 SrcSize static int ncrush_generate_tables(NCRUSH_CONTEXT* context) { - UINT32 k, i; - int j, l; + UINT32 k; + UINT32 i; + int j; + int l; k = 0; WINPR_ASSERT(context); diff --git a/libfreerdp/codec/planar.c b/libfreerdp/codec/planar.c index 619e46031..5f3be67a2 100644 --- a/libfreerdp/codec/planar.c +++ b/libfreerdp/codec/planar.c @@ -167,7 +167,8 @@ static INLINE INT32 planar_skip_plane_rle(const BYTE* pSrcData, UINT32 SrcSize, UINT32 nHeight) { UINT32 used = 0; - UINT32 x, y; + UINT32 x; + UINT32 y; BYTE controlByte; WINPR_ASSERT(pSrcData); @@ -231,7 +232,8 @@ static INLINE INT32 planar_skip_plane_rle(const BYTE* pSrcData, UINT32 SrcSize, static INLINE INT32 planar_decompress_plane_rle_only(const BYTE* pSrcData, UINT32 SrcSize, BYTE* pDstData, UINT32 nWidth, UINT32 nHeight) { - INT32 x, y; + INT32 x; + INT32 y; UINT32 pixel; UINT32 cRawBytes; UINT32 nRunLength; @@ -353,12 +355,15 @@ static INLINE INT32 planar_decompress_plane_rle(const BYTE* pSrcData, UINT32 Src UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 nChannel, BOOL vFlip) { - INT32 x, y; + INT32 x; + INT32 y; UINT32 pixel; UINT32 cRawBytes; UINT32 nRunLength; INT32 deltaValue; - INT32 beg, end, inc; + INT32 beg; + INT32 end; + INT32 inc; BYTE controlByte; BYTE* currentScanline; BYTE* previousScanline; @@ -489,8 +494,11 @@ static INLINE INT32 planar_set_plane(BYTE bValue, BYTE* pDstData, INT32 nDstStep UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 nChannel, BOOL vFlip) { - INT32 x, y; - INT32 beg, end, inc; + INT32 x; + INT32 y; + INT32 beg; + INT32 end; + INT32 inc; WINPR_ASSERT(nHeight <= INT32_MAX); WINPR_ASSERT(nWidth <= INT32_MAX); @@ -592,7 +600,9 @@ static INLINE BOOL planar_decompress_planes_raw(const BYTE* pSrcData[4], BYTE* p BOOL vFlip, UINT32 totalHeight) { INT32 y; - INT32 beg, end, inc; + INT32 beg; + INT32 end; + INT32 inc; const BYTE* pR = pSrcData[0]; const BYTE* pG = pSrcData[1]; const BYTE* pB = pSrcData[2]; @@ -1095,7 +1105,9 @@ static INLINE BOOL freerdp_split_color_planes(BITMAP_PLANAR_CONTEXT* planar, con if (planar->topdown) { - UINT32 i, j, k = 0; + UINT32 i; + UINT32 j; + UINT32 k = 0; for (i = 0; i < height; i++) { const BYTE* pixel = &data[scanline * (UINT32)i]; @@ -1113,7 +1125,8 @@ static INLINE BOOL freerdp_split_color_planes(BITMAP_PLANAR_CONTEXT* planar, con else { INT64 i; - UINT32 j, k = 0; + UINT32 j; + UINT32 k = 0; for (i = (INT64)height - 1; i >= 0; i--) { @@ -1421,9 +1434,11 @@ BYTE* freerdp_bitmap_planar_delta_encode_plane(const BYTE* inPlane, UINT32 width BYTE* outPlane) { char s2c; - UINT32 y, x; + UINT32 y; + UINT32 x; BYTE* outPtr; - const BYTE *srcPtr, *prevLinePtr; + const BYTE* srcPtr; + const BYTE* prevLinePtr; if (!outPlane) { diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 72f4a3e12..2bd643a14 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -605,8 +605,11 @@ static INLINE void progressive_rfx_idwt_x(const INT16* pLowBand, size_t nLowStep { size_t i; INT16 L0; - INT16 H0, H1; - INT16 X0, X1, X2; + INT16 H0; + INT16 H1; + INT16 X0; + INT16 X1; + INT16 X2; for (i = 0; i < nDstCount; i++) { @@ -677,8 +680,11 @@ static INLINE void progressive_rfx_idwt_y(const INT16* pLowBand, size_t nLowStep { size_t i; INT16 L0; - INT16 H0, H1; - INT16 X0, X1, X2; + INT16 H0; + INT16 H1; + INT16 X0; + INT16 X1; + INT16 X2; for (i = 0; i < nDstCount; i++) { @@ -766,9 +772,13 @@ static INLINE void progressive_rfx_dwt_2d_decode_block(INT16* buffer, INT16* tem { size_t nDstStepX; size_t nDstStepY; - INT16 *HL, *LH; - INT16 *HH, *LL; - INT16 *L, *H, *LLx; + INT16* HL; + INT16* LH; + INT16* HH; + INT16* LL; + INT16* L; + INT16* H; + INT16* LLx; const size_t nBandL = progressive_rfx_get_band_l_count(level); const size_t nBandH = progressive_rfx_get_band_h_count(level); @@ -913,7 +923,9 @@ static INLINE int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* progres const PROGRESSIVE_BLOCK_CONTEXT* context) { int rc; - BOOL diff, sub, extrapolate; + BOOL diff; + BOOL sub; + BOOL extrapolate; BYTE* pBuffer; INT16* pSign[3]; INT16* pSrcDst[3]; @@ -1315,7 +1327,9 @@ static INLINE int progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* progr const PROGRESSIVE_BLOCK_CONTEXT* context) { int status; - BOOL coeffDiff, sub, extrapolate; + BOOL coeffDiff; + BOOL sub; + BOOL extrapolate; BYTE* pBuffer; INT16* pSign[3] = { 0 }; INT16* pSrcDst[3] = { 0 }; @@ -2455,8 +2469,10 @@ int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, BOOL rc = FALSE; int res = -6; wStream* s = NULL; - UINT32 i = 0, numRects = 0; - UINT32 x = 0, y = 0; + UINT32 i = 0; + UINT32 numRects = 0; + UINT32 x = 0; + UINT32 y = 0; RFX_RECT* rects = NULL; RFX_MESSAGE* message = NULL; diff --git a/libfreerdp/codec/region.c b/libfreerdp/codec/region.c index f47a69f8b..0317f04f6 100644 --- a/libfreerdp/codec/region.c +++ b/libfreerdp/codec/region.c @@ -234,7 +234,8 @@ BOOL region16_copy(REGION16* dst, const REGION16* src) void region16_print(const REGION16* region) { const RECTANGLE_16* rects; - UINT32 nbRects, i; + UINT32 nbRects; + UINT32 i; int currentBandY = -1; rects = region16_rects(region, &nbRects); WLog_DBG(TAG, "nrects=%" PRIu32 "", nbRects); @@ -258,7 +259,8 @@ static void region16_copy_band_with_union(RECTANGLE_16* dst, const RECTANGLE_16* const RECTANGLE_16** srcPtr, RECTANGLE_16** dstPtr) { UINT16 refY = src->top; - const RECTANGLE_16 *startOverlap, *endOverlap; + const RECTANGLE_16* startOverlap; + const RECTANGLE_16* endOverlap; /* merges a band with the given rect * Input: @@ -419,8 +421,10 @@ static BOOL region16_simplify_bands(REGION16* region) * */ RECTANGLE_16* endBand; - int nbRects, finalNbRects; - int bandItems, toMove; + int nbRects; + int finalNbRects; + int bandItems; + int toMove; finalNbRects = nbRects = region16_n_rects(region); if (nbRects < 2) @@ -489,11 +493,14 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* { const RECTANGLE_16* srcExtents; RECTANGLE_16* dstExtents; - const RECTANGLE_16 *currentBand, *endSrcRect, *nextBand; + const RECTANGLE_16* currentBand; + const RECTANGLE_16* endSrcRect; + const RECTANGLE_16* nextBand; REGION16_DATA* newItems = NULL; REGION16_DATA* tmpItems = NULL; RECTANGLE_16* dstRect = NULL; - UINT32 usedRects, srcNbRects; + UINT32 usedRects; + UINT32 srcNbRects; UINT16 topInterBand; WINPR_ASSERT(src); WINPR_ASSERT(dst); @@ -680,7 +687,9 @@ BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* BOOL region16_intersects_rect(const REGION16* src, const RECTANGLE_16* arg2) { - const RECTANGLE_16 *rect, *endPtr, *srcExtents; + const RECTANGLE_16* rect; + const RECTANGLE_16* endPtr; + const RECTANGLE_16* srcExtents; UINT32 nbRects; if (!src || !src->data || !arg2) @@ -711,10 +720,14 @@ BOOL region16_intersects_rect(const REGION16* src, const RECTANGLE_16* arg2) BOOL region16_intersect_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* rect) { REGION16_DATA* newItems; - const RECTANGLE_16 *srcPtr, *endPtr, *srcExtents; + const RECTANGLE_16* srcPtr; + const RECTANGLE_16* endPtr; + const RECTANGLE_16* srcExtents; RECTANGLE_16* dstPtr; - UINT32 nbRects, usedRects; - RECTANGLE_16 common, newExtents; + UINT32 nbRects; + UINT32 usedRects; + RECTANGLE_16 common; + RECTANGLE_16 newExtents; WINPR_ASSERT(src); WINPR_ASSERT(src->data); srcPtr = region16_rects(src, &nbRects); diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index 38b9ae3bd..2a36c1d00 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -828,7 +828,8 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* messa BYTE quant; RFX_TILE* tile; UINT32* quants; - UINT16 subtype, numTiles; + UINT16 subtype; + UINT16 numTiles; UINT32 blockLen; UINT32 blockType; UINT32 tilesDataSize; @@ -1623,7 +1624,8 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* context, const RFX_RECT* rects, siz PTP_WORK* workObject = NULL; RFX_TILE_COMPOSE_WORK_PARAM* workParam = NULL; BOOL success = FALSE; - REGION16 rectsRegion = { 0 }, tilesRegion = { 0 }; + REGION16 rectsRegion = { 0 }; + REGION16 tilesRegion = { 0 }; RECTANGLE_16 currentTileRect = { 0 }; const RECTANGLE_16* regionRect = NULL; diff --git a/libfreerdp/codec/rfx_decode.c b/libfreerdp/codec/rfx_decode.c index a61a8ab5a..f07ddaca0 100644 --- a/libfreerdp/codec/rfx_decode.c +++ b/libfreerdp/codec/rfx_decode.c @@ -72,7 +72,9 @@ BOOL rfx_decode_rgb(RFX_CONTEXT* context, const RFX_TILE* tile, BYTE* rgb_buffer BOOL rc = TRUE; BYTE* pBuffer; INT16* pSrcDst[3]; - UINT32 *y_quants, *cb_quants, *cr_quants; + UINT32* y_quants; + UINT32* cb_quants; + UINT32* cr_quants; static const prim_size_t roi_64x64 = { 64, 64 }; const primitives_t* prims = primitives_get(); PROFILER_ENTER(context->priv->prof_rfx_decode_rgb) diff --git a/libfreerdp/codec/rfx_dwt.c b/libfreerdp/codec/rfx_dwt.c index d6fe2d482..caceb813d 100644 --- a/libfreerdp/codec/rfx_dwt.c +++ b/libfreerdp/codec/rfx_dwt.c @@ -27,9 +27,15 @@ static void rfx_dwt_2d_decode_block(INT16* buffer, INT16* idwt, size_t subband_width) { - INT16 *dst, *l, *h; - INT16 *l_dst, *h_dst; - INT16 *hl, *lh, *hh, *ll; + INT16* dst; + INT16* l; + INT16* h; + INT16* l_dst; + INT16* h_dst; + INT16* hl; + INT16* lh; + INT16* hh; + INT16* ll; const size_t total_width = subband_width << 1; @@ -120,9 +126,15 @@ void rfx_dwt_2d_decode(INT16* buffer, INT16* dwt_buffer) static void rfx_dwt_2d_encode_block(INT16* buffer, INT16* dwt, UINT32 subband_width) { - INT16 *src, *l, *h; - INT16 *l_src, *h_src; - INT16 *hl, *lh, *hh, *ll; + INT16* src; + INT16* l; + INT16* h; + INT16* l_src; + INT16* h_src; + INT16* hl; + INT16* lh; + INT16* hh; + INT16* ll; const UINT32 total_width = subband_width << 1; diff --git a/libfreerdp/codec/rfx_encode.c b/libfreerdp/codec/rfx_encode.c index 4bc7d503f..dc7866004 100644 --- a/libfreerdp/codec/rfx_encode.c +++ b/libfreerdp/codec/rfx_encode.c @@ -43,12 +43,19 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, i UINT32 pixel_format, const BYTE* palette, INT16* r_buf, INT16* g_buf, INT16* b_buf) { - int x, y; + int x; + int y; int x_exceed; int y_exceed; const BYTE* src; - INT16 r, g, b; - INT16 *r_last, *g_last, *b_last; + const UINT32* src_32; + const UINT16* src_16; + INT16 r; + INT16 g; + INT16 b; + INT16* r_last; + INT16* g_last; + INT16* b_last; x_exceed = 64 - width; y_exceed = 64 - height; @@ -261,8 +268,12 @@ void rfx_encode_rgb(RFX_CONTEXT* context, RFX_TILE* tile) } cnv; BYTE* pBuffer; INT16* pSrcDst[3]; - int YLen, CbLen, CrLen; - UINT32 *YQuant, *CbQuant, *CrQuant; + int YLen; + int CbLen; + int CrLen; + UINT32* YQuant; + UINT32* CbQuant; + UINT32* CrQuant; primitives_t* prims = primitives_get(); static const prim_size_t roi_64x64 = { 64, 64 }; diff --git a/libfreerdp/codec/rfx_sse2.c b/libfreerdp/codec/rfx_sse2.c index 7841656e2..301855c7a 100644 --- a/libfreerdp/codec/rfx_sse2.c +++ b/libfreerdp/codec/rfx_sse2.c @@ -146,7 +146,8 @@ static void rfx_quantization_encode_sse2(INT16* buffer, static __inline void __attribute__((ATTRIBUTES)) rfx_dwt_2d_decode_block_horiz_sse2(INT16* l, INT16* h, INT16* dst, int subband_width) { - int y, n; + int y; + int n; INT16* l_ptr = l; INT16* h_ptr = h; INT16* dst_ptr = dst; @@ -221,7 +222,8 @@ rfx_dwt_2d_decode_block_horiz_sse2(INT16* l, INT16* h, INT16* dst, int subband_w static __inline void __attribute__((ATTRIBUTES)) rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_width) { - int x, n; + int x; + int n; INT16* l_ptr = l; INT16* h_ptr = h; INT16* dst_ptr = dst; @@ -299,8 +301,12 @@ rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_wi static __inline void __attribute__((ATTRIBUTES)) rfx_dwt_2d_decode_block_sse2(INT16* buffer, INT16* idwt, int subband_width) { - INT16 *hl, *lh, *hh, *ll; - INT16 *l_dst, *h_dst; + INT16* hl; + INT16* lh; + INT16* hh; + INT16* ll; + INT16* l_dst; + INT16* h_dst; _mm_prefetch_buffer((char*)idwt, subband_width * 4 * sizeof(INT16)); /* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. */ @@ -436,8 +442,12 @@ rfx_dwt_2d_encode_block_horiz_sse2(INT16* src, INT16* l, INT16* h, int subband_w static __inline void __attribute__((ATTRIBUTES)) rfx_dwt_2d_encode_block_sse2(INT16* buffer, INT16* dwt, int subband_width) { - INT16 *hl, *lh, *hh, *ll; - INT16 *l_src, *h_src; + INT16* hl; + INT16* lh; + INT16* hh; + INT16* ll; + INT16* l_src; + INT16* h_src; _mm_prefetch_buffer((char*)dwt, subband_width * 4 * sizeof(INT16)); /* DWT in vertical direction, results in 2 sub-bands in L, H order in tmp buffer dwt. */ l_src = dwt; diff --git a/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c b/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c index dc97f1b89..722437c52 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c @@ -23,7 +23,8 @@ static BOOL run_encode_decode_single(UINT16 bpp, BITMAP_INTERLEAVED_CONTEXT* enc { BOOL rc2 = FALSE; BOOL rc; - UINT32 i, j; + UINT32 i; + UINT32 j; const UINT32 w = 64; const UINT32 h = 64; const UINT32 x = 0; @@ -69,7 +70,12 @@ static BOOL run_encode_decode_single(UINT16 bpp, BITMAP_INTERLEAVED_CONTEXT* enc for (j = 0; j < w; j++) { - BYTE r, g, b, dr, dg, db; + BYTE r; + BYTE g; + BYTE b; + BYTE dr; + BYTE dg; + BYTE db; const UINT32 srcColor = FreeRDPReadColor(&srcLine[j * bstep], format); const UINT32 dstColor = FreeRDPReadColor(&dstLine[j * bstep], format); FreeRDPSplitColor(srcColor, format, &r, &g, &b, NULL, NULL); @@ -168,7 +174,10 @@ static BOOL TestColorConversion(void) const UINT32 colorHigh = FreeRDPGetColor(format, 255, 255, 255, 255); const UINT32 colorLow32 = FreeRDPConvertColor(colorLow, format, dstFormat, NULL); const UINT32 colorHigh32 = FreeRDPConvertColor(colorHigh, format, dstFormat, NULL); - BYTE r, g, b, a; + BYTE r; + BYTE g; + BYTE b; + BYTE a; FreeRDPSplitColor(colorLow32, dstFormat, &r, &g, &b, &a, NULL); if ((r != 0) || (g != 0) || (b != 0)) return FALSE; @@ -183,7 +192,8 @@ static BOOL TestColorConversion(void) int TestFreeRDPCodecInterleaved(int argc, char* argv[]) { - BITMAP_INTERLEAVED_CONTEXT *encoder, *decoder; + BITMAP_INTERLEAVED_CONTEXT* encoder; + BITMAP_INTERLEAVED_CONTEXT* decoder; int rc = -1; WINPR_UNUSED(argc); WINPR_UNUSED(argv); diff --git a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c index 5c4e283a1..e6dee20a8 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c @@ -5427,7 +5427,8 @@ static BOOL CompareBitmap(const BYTE* srcA, UINT32 srcAFormat, const BYTE* srcB, const UINT32 srcABits = FreeRDPGetBitsPerPixel(srcAFormat); const UINT32 srcBBits = FreeRDPGetBitsPerPixel(srcBFormat); UINT32 diff = fabs((double)srcABits - srcBBits); - UINT32 x, y; + UINT32 x; + UINT32 y; /* No support for 8bpp */ if ((srcABits < 15) || (srcBBits < 15)) @@ -5469,7 +5470,14 @@ static BOOL CompareBitmap(const BYTE* srcA, UINT32 srcAFormat, const BYTE* srcB, for (x = 0; x < width; x++) { - BYTE sR, sG, sB, sA, dR, dG, dB, dA; + BYTE sR; + BYTE sG; + BYTE sB; + BYTE sA; + BYTE dR; + BYTE dG; + BYTE dB; + BYTE dA; const BYTE* a = &lineA[x * FreeRDPGetBytesPerPixel(srcAFormat)]; const BYTE* b = &lineB[x * FreeRDPGetBytesPerPixel(srcBFormat)]; UINT32 colorA = FreeRDPReadColor(a, srcAFormat); @@ -5541,7 +5549,10 @@ fail: static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar, const UINT32 srcFormat, const UINT32 dstFormat) { - UINT32 i, j, x, y; + UINT32 i; + UINT32 j; + UINT32 x; + UINT32 y; BOOL rc = FALSE; printf("%s: [%s] --> [%s]: ", __func__, FreeRDPGetColorFormatName(srcFormat), FreeRDPGetColorFormatName(dstFormat)); diff --git a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c index e6ebfa337..6fde846dc 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c @@ -151,7 +151,8 @@ static void sample_file_free(EGFX_SAMPLE_FILE* file) static void test_fill_image_alpha_channel(BYTE* data, int width, int height, BYTE value) { - int i, j; + int i; + int j; UINT32* pixel; for (i = 0; i < height; i++) @@ -817,7 +818,8 @@ static size_t test_memcmp_count(const BYTE* mem1, const BYTE* mem2, size_t size, static int test_progressive_decode(PROGRESSIVE_CONTEXT* progressive, EGFX_SAMPLE_FILE files[4], EGFX_SAMPLE_FILE bitmaps[4], int quarter, int count) { - int nXSrc, nYSrc; + int nXSrc; + int nYSrc; RECTANGLE_16 clippingRect = { 0 }; clippingRect.right = g_Width; @@ -903,7 +905,9 @@ static int test_progressive_decode(PROGRESSIVE_CONTEXT* progressive, EGFX_SAMPLE static int test_progressive_ms_sample(char* ms_sample_path) { - int i, j, k; + int i; + int j; + int k; int count; int status; EGFX_SAMPLE_FILE files[3][4][4] = { 0 }; @@ -1014,8 +1018,14 @@ static BOOL diff(BYTE a, BYTE b) static BOOL colordiff(UINT32 format, UINT32 a, UINT32 b) { - BYTE ar, ag, ab, aa; - BYTE br, bg, bb, ba; + BYTE ar; + BYTE ag; + BYTE ab; + BYTE aa; + BYTE br; + BYTE bg; + BYTE bb; + BYTE ba; FreeRDPSplitColor(a, format, &ar, &ag, &ab, &aa, NULL); FreeRDPSplitColor(b, format, &br, &bg, &bb, &ba, NULL); if (!diff(aa, ba) || !diff(ar, br) || !diff(ag, bg) || !diff(ab, bb)) diff --git a/libfreerdp/codec/test/TestFreeRDPRegion.c b/libfreerdp/codec/test/TestFreeRDPRegion.c index 1e427e016..e055aa4de 100644 --- a/libfreerdp/codec/test/TestFreeRDPRegion.c +++ b/libfreerdp/codec/test/TestFreeRDPRegion.c @@ -524,7 +524,8 @@ out: static int test_r1_inter_r3(void) { - REGION16 region, intersection; + REGION16 region; + REGION16 intersection; int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; @@ -570,7 +571,8 @@ out: static int test_r1_r3_inter_r11(void) { - REGION16 region, intersection; + REGION16 region; + REGION16 intersection; int retCode = -1; const RECTANGLE_16* rects; UINT32 nbRects; @@ -629,10 +631,12 @@ out: static int test_norbert_case(void) { - REGION16 region, intersection; + REGION16 region; + REGION16 intersection; int retCode = -1; const RECTANGLE_16* rects; - UINT32 nbRects, i; + UINT32 nbRects; + UINT32 i; RECTANGLE_16 inRectangles[5] = { { 1680, 0, 1920, 242 }, { 294, 242, 971, 776 }, { 1680, 242, 1920, 776 }, @@ -770,7 +774,8 @@ out: static int test_empty_rectangle(void) { - REGION16 region, intersection; + REGION16 region; + REGION16 intersection; int retCode = -1; int i; RECTANGLE_16 emptyRectangles[3] = { { 0, 0, 0, 0 }, { 10, 10, 10, 11 }, { 10, 10, 11, 10 } }; @@ -840,7 +845,8 @@ static struct UnitaryTest tests[] = { { "Basic trivial tests", test_basic }, int TestFreeRDPRegion(int argc, char* argv[]) { - int i, testNb = 0; + int i; + int testNb = 0; int retCode = -1; WINPR_UNUSED(argc); WINPR_UNUSED(argv); diff --git a/libfreerdp/codec/xcrush.c b/libfreerdp/codec/xcrush.c index 1dd8a12d7..60bac3aed 100644 --- a/libfreerdp/codec/xcrush.c +++ b/libfreerdp/codec/xcrush.c @@ -605,7 +605,8 @@ static int xcrush_find_all_matches(XCRUSH_CONTEXT* xcrush, UINT32 SignatureIndex static int xcrush_optimize_matches(XCRUSH_CONTEXT* xcrush) { - UINT32 i, j = 0; + UINT32 i; + UINT32 j = 0; UINT32 MatchDiff = 0; UINT32 PrevMatchEnd = 0; UINT32 TotalMatchLength = 0; diff --git a/libfreerdp/codec/yuv.c b/libfreerdp/codec/yuv.c index c256d555c..f609c8851 100644 --- a/libfreerdp/codec/yuv.c +++ b/libfreerdp/codec/yuv.c @@ -786,7 +786,8 @@ static BOOL pool_encode(YUV_CONTEXT* context, PTP_WORK_CALLBACK cb, const BYTE* { BOOL rc = FALSE; primitives_t* prims = primitives_get(); - UINT32 x, y; + UINT32 x; + UINT32 y; UINT32 waitCount = 0; WINPR_ASSERT(context); diff --git a/libfreerdp/common/addin.c b/libfreerdp/common/addin.c index fb323267d..899bbb35a 100644 --- a/libfreerdp/common/addin.c +++ b/libfreerdp/common/addin.c @@ -51,7 +51,8 @@ LPSTR freerdp_get_library_install_path(void) size_t cchPath; size_t cchLibraryPath; size_t cchInstallPrefix; - BOOL needLibPath, needInstallPath; + BOOL needLibPath; + BOOL needInstallPath; LPCSTR pszLibraryPath = FREERDP_LIBRARY_PATH; LPCSTR pszInstallPrefix = FREERDP_INSTALL_PREFIX; cchLibraryPath = strlen(pszLibraryPath) + 1; @@ -95,7 +96,8 @@ LPSTR freerdp_get_dynamic_addin_install_path(void) size_t cchPath; size_t cchAddinPath; size_t cchInstallPrefix; - BOOL needLibPath, needInstallPath; + BOOL needLibPath; + BOOL needInstallPath; LPCSTR pszAddinPath = FREERDP_ADDIN_PATH; LPCSTR pszInstallPrefix = FREERDP_INSTALL_PREFIX; cchAddinPath = strlen(pszAddinPath) + 1; diff --git a/libfreerdp/common/assistance.c b/libfreerdp/common/assistance.c index bb9eaa2d6..75d9bd1f1 100644 --- a/libfreerdp/common/assistance.c +++ b/libfreerdp/common/assistance.c @@ -836,7 +836,9 @@ BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* pas WINPR_CIPHER_CTX* rc4Ctx = NULL; BYTE* pbIn = NULL; BYTE* pbOut = NULL; - size_t cbOut, cbIn, cbFinal; + size_t cbOut; + size_t cbIn; + size_t cbFinal; WCHAR* PasswordW = ConvertUtf8ToWCharAlloc(password, &cbPasswordW); WCHAR* PassStubW = ConvertUtf8ToWCharAlloc(passStub, &cbPassStubW); @@ -907,7 +909,9 @@ static BOOL freerdp_assistance_decrypt2(rdpAssistanceFile* file) WCHAR* PasswordW = NULL; BYTE* pbIn = NULL; BYTE* pbOut = NULL; - size_t cbOut, cbIn, cbFinal; + size_t cbOut; + size_t cbIn; + size_t cbFinal; BYTE DerivedKey[WINPR_AES_BLOCK_SIZE] = { 0 }; BYTE InitializationVector[WINPR_AES_BLOCK_SIZE] = { 0 }; BYTE PasswordHash[WINPR_SHA1_DIGEST_LENGTH] = { 0 }; diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index 29efeacdb..72b7abbe2 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -211,7 +211,8 @@ int freerdp_addin_replace_argument_value(ADDIN_ARGV* args, const char* previous, BOOL freerdp_device_collection_add(rdpSettings* settings, RDPDR_DEVICE* device) { - UINT32 count, old; + UINT32 count; + UINT32 old; WINPR_ASSERT(settings); WINPR_ASSERT(device); @@ -698,7 +699,8 @@ BOOL freerdp_dynamic_channel_collection_del(rdpSettings* settings, const char* n BOOL freerdp_dynamic_channel_collection_add(rdpSettings* settings, ADDIN_ARGV* channel) { - UINT32 count, oldSize; + UINT32 count; + UINT32 oldSize; WINPR_ASSERT(settings); WINPR_ASSERT(channel); diff --git a/libfreerdp/common/test/TestAddinArgv.c b/libfreerdp/common/test/TestAddinArgv.c index a4c70b8b3..94bb9b04a 100644 --- a/libfreerdp/common/test/TestAddinArgv.c +++ b/libfreerdp/common/test/TestAddinArgv.c @@ -6,7 +6,8 @@ static BOOL test_alloc(void) { BOOL rc = FALSE; - int rng, x; + int rng; + int x; const char* param[] = { "foo:", "bar", "bla", "rdp", NULL }; ADDIN_ARGV* arg1 = NULL; ADDIN_ARGV* arg2 = NULL; @@ -94,7 +95,8 @@ fail: static BOOL test_add_remove(void) { - size_t x, y; + size_t x; + size_t y; const char* args[] = { "foo", "bar", "bla", "gaga" }; BOOL rc = FALSE; ADDIN_ARGV* arg = NULL; diff --git a/libfreerdp/core/aad.c b/libfreerdp/core/aad.c index cafad7694..72204d712 100644 --- a/libfreerdp/core/aad.c +++ b/libfreerdp/core/aad.c @@ -675,7 +675,8 @@ BOOL generate_pop_key(rdpAad* aad) BOOL ret = FALSE; char* buffer = NULL; char* b64_hash = NULL; - char *e = NULL, *n = NULL; + char* e = NULL; + char* n = NULL; WINPR_ASSERT(aad); diff --git a/libfreerdp/core/activation.c b/libfreerdp/core/activation.c index f61b23895..866a4165b 100644 --- a/libfreerdp/core/activation.c +++ b/libfreerdp/core/activation.c @@ -45,7 +45,8 @@ static BOOL rdp_write_synchronize_pdu(wStream* s, const rdpSettings* settings) static BOOL rdp_recv_sync_pdu(rdpRdp* rdp, wStream* s, const char* what) { - UINT16 msgType, targetUser; + UINT16 msgType; + UINT16 targetUser; WINPR_UNUSED(rdp); if (!Stream_CheckAndLogRequiredLengthEx(TAG, WLOG_WARN, s, 4, 1, "%s(%s:%" PRIuz ") %s", @@ -141,7 +142,8 @@ static BOOL rdp_write_client_control_pdu(wStream* s, UINT16 action, UINT16 grant BOOL rdp_recv_server_control_pdu(rdpRdp* rdp, wStream* s) { - UINT16 action, grantId; + UINT16 action; + UINT16 grantId; UINT32 controlId; WINPR_ASSERT(rdp); @@ -425,7 +427,8 @@ BOOL rdp_recv_client_persistent_key_list_pdu(wStream* s) BYTE flags; size_t count = 0; size_t total = 0; - UINT16 cache, x; + UINT16 cache; + UINT16 x; WINPR_ASSERT(s); @@ -515,7 +518,10 @@ BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, UINT16 flags) BOOL rdp_recv_font_map_pdu(rdpRdp* rdp, wStream* s) { - UINT16 numberEntries, totalNumEntries, mapFlags, entrySize; + UINT16 numberEntries; + UINT16 totalNumEntries; + UINT16 mapFlags; + UINT16 entrySize; WINPR_ASSERT(rdp); WINPR_ASSERT(rdp->settings); diff --git a/libfreerdp/core/capabilities.c b/libfreerdp/core/capabilities.c index a7c183aee..5caca0ce0 100644 --- a/libfreerdp/core/capabilities.c +++ b/libfreerdp/core/capabilities.c @@ -838,8 +838,12 @@ static BOOL rdp_write_bitmap_cache_capability_set(wStream* s, const rdpSettings* #ifdef WITH_DEBUG_CAPABILITIES static BOOL rdp_print_bitmap_cache_capability_set(wStream* s) { - UINT32 pad1, pad2, pad3; - UINT32 pad4, pad5, pad6; + UINT32 pad1; + UINT32 pad2; + UINT32 pad3; + UINT32 pad4; + UINT32 pad5; + UINT32 pad6; UINT16 Cache0Entries; UINT16 Cache0MaximumCellSize; UINT16 Cache1Entries; @@ -4166,7 +4170,9 @@ static BOOL rdp_read_capability_sets(wStream* s, rdpSettings* settings, rdpSetti UINT16 totalLength) { BOOL rc = FALSE; - size_t start, end, len; + size_t start; + size_t end; + size_t len; UINT16 numberCapabilities; UINT16 count; @@ -4317,7 +4323,9 @@ BOOL rdp_recv_demand_active(rdpRdp* rdp, wStream* s, UINT16 pduSource, UINT16 le static BOOL rdp_write_demand_active(wStream* s, rdpSettings* settings) { - size_t bm, em, lm; + size_t bm; + size_t em; + size_t lm; UINT16 numberCapabilities; size_t lengthCombinedCapabilities; @@ -4472,7 +4480,9 @@ BOOL rdp_recv_confirm_active(rdpRdp* rdp, wStream* s, UINT16 pduLength) static BOOL rdp_write_confirm_active(wStream* s, rdpSettings* settings) { - size_t bm, em, lm; + size_t bm; + size_t em; + size_t lm; UINT16 numberCapabilities; UINT16 lengthSourceDescriptor; size_t lengthCombinedCapabilities; diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index 87f5ae9cb..806f619df 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -1177,7 +1177,9 @@ state_run_t rdp_client_connect_license(rdpRdp* rdp, wStream* s) { state_run_t status = STATE_RUN_FAILED; LICENSE_STATE state; - UINT16 length, channelId, securityFlags; + UINT16 length; + UINT16 channelId; + UINT16 securityFlags; WINPR_ASSERT(rdp); if (!rdp_read_header(rdp, s, &length, &channelId)) diff --git a/libfreerdp/core/credssp_auth.c b/libfreerdp/core/credssp_auth.c index 8d788088a..738e8c847 100644 --- a/libfreerdp/core/credssp_auth.c +++ b/libfreerdp/core/credssp_auth.c @@ -749,7 +749,8 @@ void credssp_auth_free(rdpCredsspAuth* auth) static void auth_get_sspi_module_from_reg(char** sspi_module) { HKEY hKey; - DWORD dwType, dwSize; + DWORD dwType; + DWORD dwSize; WINPR_ASSERT(sspi_module); *sspi_module = NULL; diff --git a/libfreerdp/core/gateway/arm.c b/libfreerdp/core/gateway/arm.c index 9327bad5d..076c4e9d5 100644 --- a/libfreerdp/core/gateway/arm.c +++ b/libfreerdp/core/gateway/arm.c @@ -91,7 +91,8 @@ static BOOL arm_tls_connect(rdpArm* arm, rdpTls* tls, int timeout) return FALSE; UINT16 peerPort = (UINT16)freerdp_settings_get_uint32(settings, FreeRDP_GatewayPort); - const char *proxyUsername, *proxyPassword; + const char* proxyUsername; + const char* proxyPassword; BOOL isProxyConnection = proxy_prepare(settings, &peerHostname, &peerPort, &proxyUsername, &proxyPassword); diff --git a/libfreerdp/core/gateway/http.c b/libfreerdp/core/gateway/http.c index 874f43bc0..508f328e2 100644 --- a/libfreerdp/core/gateway/http.c +++ b/libfreerdp/core/gateway/http.c @@ -100,7 +100,8 @@ struct s_http_response static char* string_strnstr(char* str1, const char* str2, size_t slen) { - char c, sc; + char c; + char sc; size_t len; if ((c = *str2++) != '\0') @@ -556,7 +557,8 @@ static BOOL http_encode_print(wStream* s, WINPR_FORMAT_ARG const char* fmt, ...) { char* str; va_list ap; - int length, used; + int length; + int used; if (!s || !fmt) return FALSE; diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index 3f86ae436..73686dfc5 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -770,8 +770,10 @@ static BOOL rdg_skip_seed_payload(rdpTls* tls, SSIZE_T lastResponseLength, static BOOL rdg_process_handshake_response(rdpRdg* rdg, wStream* s) { UINT32 errorCode; - UINT16 serverVersion, extendedAuth; - BYTE verMajor, verMinor; + UINT16 serverVersion; + UINT16 extendedAuth; + BYTE verMajor; + BYTE verMinor; const char* error; WLog_DBG(TAG, "Handshake response received"); @@ -872,7 +874,8 @@ static BOOL rdg_process_tunnel_response_optional(rdpRdg* rdg, wStream* s, UINT16 static BOOL rdg_process_tunnel_response(rdpRdg* rdg, wStream* s) { - UINT16 serverVersion, fieldsPresent; + UINT16 serverVersion; + UINT16 fieldsPresent; UINT32 errorCode; const char* error; WLog_DBG(TAG, "Tunnel response received"); @@ -1225,7 +1228,8 @@ static BOOL rdg_tls_connect(rdpRdg* rdg, rdpTls* tls, const char* peerAddress, i rdpSettings* settings = rdg->settings; const char* peerHostname = settings->GatewayHostname; UINT16 peerPort = (UINT16)settings->GatewayPort; - const char *proxyUsername, *proxyPassword; + const char* proxyUsername; + const char* proxyPassword; BOOL isProxyConnection = proxy_prepare(settings, &peerHostname, &peerPort, &proxyUsername, &proxyPassword); diff --git a/libfreerdp/core/gateway/rpc_bind.c b/libfreerdp/core/gateway/rpc_bind.c index 528f2a1cd..2071fd604 100644 --- a/libfreerdp/core/gateway/rpc_bind.c +++ b/libfreerdp/core/gateway/rpc_bind.c @@ -324,7 +324,8 @@ BOOL rpc_recv_bind_ack_pdu(rdpRpc* rpc, wStream* s) { BOOL rc = FALSE; const BYTE* auth_data; - size_t pos, end; + size_t pos; + size_t end; rpcconn_hdr_t header = { 0 }; SecBuffer buffer = { 0 }; @@ -439,7 +440,8 @@ fail: enum RPC_BIND_STATE rpc_bind_state(rdpRpc* rpc) { - BOOL complete, have_token; + BOOL complete; + BOOL have_token; WINPR_ASSERT(rpc); complete = credssp_auth_is_complete(rpc->auth); diff --git a/libfreerdp/core/gateway/rts.c b/libfreerdp/core/gateway/rts.c index a36ab1de2..634bc0d36 100644 --- a/libfreerdp/core/gateway/rts.c +++ b/libfreerdp/core/gateway/rts.c @@ -177,7 +177,8 @@ static rpcconn_rts_hdr_t rts_pdu_header_init(void) static BOOL rts_align_stream(wStream* s, size_t alignment, BOOL silent) { - size_t pos, pad; + size_t pos; + size_t pad; WINPR_ASSERT(s); WINPR_ASSERT(alignment > 0); diff --git a/libfreerdp/core/gateway/rts_signature.c b/libfreerdp/core/gateway/rts_signature.c index 5796a31fd..9fbc9e608 100644 --- a/libfreerdp/core/gateway/rts_signature.c +++ b/libfreerdp/core/gateway/rts_signature.c @@ -366,7 +366,8 @@ fail: UINT32 rts_identify_pdu_signature(const RtsPduSignature* signature, const RTS_PDU_SIGNATURE_ENTRY** entry) { - size_t i, j; + size_t i; + size_t j; if (entry) *entry = NULL; diff --git a/libfreerdp/core/gateway/tsg.c b/libfreerdp/core/gateway/tsg.c index 636f9c37b..e2a33423e 100644 --- a/libfreerdp/core/gateway/tsg.c +++ b/libfreerdp/core/gateway/tsg.c @@ -1736,7 +1736,8 @@ static BOOL TsProxyAuthorizeTunnelReadResponse(wLog* log, RPC_PDU* pdu) UINT32 SwitchValue; UINT32 index = 0; TSG_PACKET packet = { 0 }; - UINT32 PacketPtr = 0, PacketResponsePtr = 0; + UINT32 PacketPtr = 0; + UINT32 PacketResponsePtr = 0; if (!pdu) return FALSE; @@ -1858,7 +1859,8 @@ static BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu) TSG_PACKET_MSG_RESPONSE packetMsgResponse = { 0 }; TSG_PACKET_STRING_MESSAGE packetStringMessage = { 0 }; TSG_PACKET_REAUTH_MESSAGE packetReauthMessage = { 0 }; - UINT32 PacketPtr = 0, PacketMsgResponsePtr = 0; + UINT32 PacketPtr = 0; + UINT32 PacketMsgResponsePtr = 0; WINPR_ASSERT(tsg); WINPR_ASSERT(tsg->rpc); diff --git a/libfreerdp/core/gateway/wst.c b/libfreerdp/core/gateway/wst.c index 94492a587..be85f4758 100644 --- a/libfreerdp/core/gateway/wst.c +++ b/libfreerdp/core/gateway/wst.c @@ -218,7 +218,8 @@ static BOOL wst_tls_connect(rdpWst* wst, rdpTls* tls, int timeout) rdpSettings* settings = wst->settings; const char* peerHostname = wst->gwhostname; UINT16 peerPort = wst->gwport; - const char *proxyUsername, *proxyPassword; + const char* proxyUsername; + const char* proxyPassword; BOOL isProxyConnection = proxy_prepare(settings, &peerHostname, &peerPort, &proxyUsername, &proxyPassword); diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index a056e3d9b..3d473f139 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -2097,7 +2097,11 @@ BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs) for (index = 0; index < monitorCount; index++) { - UINT32 left, top, right, bottom, flags; + UINT32 left; + UINT32 top; + UINT32 right; + UINT32 bottom; + UINT32 flags; rdpMonitor* current = &settings->MonitorDefArray[index]; Stream_Read_UINT32(s, left); /* left */ @@ -2128,7 +2132,8 @@ BOOL gcc_write_client_monitor_data(wStream* s, const rdpMcs* mcs) { UINT32 i; UINT16 length; - INT32 baseX = 0, baseY = 0; + INT32 baseX = 0; + INT32 baseY = 0; const rdpSettings* settings = mcs_get_const_settings(mcs); WINPR_ASSERT(s); diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 4a1d7c512..30fcd9bb6 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -1424,7 +1424,8 @@ static BOOL rdp_write_logon_info_v1(wStream* s, logon_info* info) static BOOL rdp_write_logon_info_v2(wStream* s, logon_info* info) { - size_t domainLen, usernameLen; + size_t domainLen; + size_t usernameLen; if (!Stream_EnsureRemainingCapacity(s, logonInfoV2TotalSize)) return FALSE; diff --git a/libfreerdp/core/input.c b/libfreerdp/core/input.c index e7cdf85a2..481ff3e70 100644 --- a/libfreerdp/core/input.c +++ b/libfreerdp/core/input.c @@ -644,7 +644,8 @@ static BOOL input_recv_sync_event(rdpInput* input, wStream* s) static BOOL input_recv_keyboard_event(rdpInput* input, wStream* s) { - UINT16 keyboardFlags, keyCode; + UINT16 keyboardFlags; + UINT16 keyCode; WINPR_ASSERT(input); WINPR_ASSERT(s); @@ -670,7 +671,8 @@ static BOOL input_recv_keyboard_event(rdpInput* input, wStream* s) static BOOL input_recv_unicode_keyboard_event(rdpInput* input, wStream* s) { - UINT16 keyboardFlags, unicodeCode; + UINT16 keyboardFlags; + UINT16 unicodeCode; WINPR_ASSERT(input); WINPR_ASSERT(s); @@ -692,7 +694,9 @@ static BOOL input_recv_unicode_keyboard_event(rdpInput* input, wStream* s) static BOOL input_recv_mouse_event(rdpInput* input, wStream* s) { - UINT16 pointerFlags, xPos, yPos; + UINT16 pointerFlags; + UINT16 xPos; + UINT16 yPos; WINPR_ASSERT(input); WINPR_ASSERT(s); @@ -709,7 +713,8 @@ static BOOL input_recv_mouse_event(rdpInput* input, wStream* s) static BOOL input_recv_relmouse_event(rdpInput* input, wStream* s) { UINT16 pointerFlags; - INT16 xDelta, yDelta; + INT16 xDelta; + INT16 yDelta; WINPR_ASSERT(input); WINPR_ASSERT(s); @@ -735,7 +740,9 @@ static BOOL input_recv_relmouse_event(rdpInput* input, wStream* s) static BOOL input_recv_extended_mouse_event(rdpInput* input, wStream* s) { - UINT16 pointerFlags, xPos, yPos; + UINT16 pointerFlags; + UINT16 xPos; + UINT16 yPos; WINPR_ASSERT(input); WINPR_ASSERT(s); @@ -822,7 +829,8 @@ static BOOL input_recv_event(rdpInput* input, wStream* s) BOOL input_recv(rdpInput* input, wStream* s) { - UINT16 i, numberEvents; + UINT16 i; + UINT16 numberEvents; WINPR_ASSERT(input); WINPR_ASSERT(s); diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c index c8cac1254..70475a29c 100644 --- a/libfreerdp/core/license.c +++ b/libfreerdp/core/license.c @@ -507,8 +507,10 @@ static BOOL saveCal(const rdpSettings* settings, const BYTE* data, size_t length char hash[41] = { 0 }; FILE* fp = NULL; char* licenseStorePath = NULL; - char filename[MAX_PATH] = { 0 }, filenameNew[MAX_PATH] = { 0 }; - char *filepath = NULL, *filepathNew = NULL; + char filename[MAX_PATH] = { 0 }; + char filenameNew[MAX_PATH] = { 0 }; + char* filepath = NULL; + char* filepathNew = NULL; size_t written; BOOL ret = FALSE; @@ -591,7 +593,8 @@ out: static BYTE* loadCalFile(const rdpSettings* settings, const char* hostname, size_t* dataLen) { - char *licenseStorePath = NULL, *calPath = NULL; + char* licenseStorePath = NULL; + char* calPath = NULL; char calFilename[MAX_PATH] = { 0 }; char hash[41] = { 0 }; INT64 length = 0; @@ -2049,7 +2052,8 @@ fail: static BOOL license_read_encrypted_blob(const rdpLicense* license, wStream* s, LICENSE_BLOB* target) { - UINT16 wBlobType = 0, wBlobLen = 0; + UINT16 wBlobType = 0; + UINT16 wBlobLen = 0; WINPR_ASSERT(license); WINPR_ASSERT(target); @@ -2090,7 +2094,10 @@ BOOL license_read_new_or_upgrade_license_packet(rdpLicense* license, wStream* s) { UINT32 os_major = 0; UINT32 os_minor = 0; - UINT32 cbScope = 0, cbCompanyName = 0, cbProductId = 0, cbLicenseInfo = 0; + UINT32 cbScope = 0; + UINT32 cbCompanyName = 0; + UINT32 cbProductId = 0; + UINT32 cbLicenseInfo = 0; wStream sbuffer = { 0 }; wStream* licenseStream = NULL; BOOL ret = FALSE; diff --git a/libfreerdp/core/mcs.c b/libfreerdp/core/mcs.c index a302427ba..3768f6242 100644 --- a/libfreerdp/core/mcs.c +++ b/libfreerdp/core/mcs.c @@ -821,7 +821,8 @@ static BOOL mcs_send_connect_initial(rdpMcs* mcs) int status = -1; size_t length; wStream* s = NULL; - size_t bm, em; + size_t bm; + size_t em; wStream* gcc_CCrq = NULL; wStream* client_data = NULL; rdpContext* context; @@ -942,7 +943,8 @@ BOOL mcs_send_connect_response(rdpMcs* mcs) size_t length; int status = -1; wStream* s = NULL; - size_t bm, em; + size_t bm; + size_t em; wStream* gcc_CCrsp = NULL; wStream* server_data = NULL; @@ -1315,7 +1317,8 @@ fail: BOOL mcs_recv_disconnect_provider_ultimatum(rdpMcs* mcs, wStream* s, int* reason) { - BYTE b1, b2; + BYTE b1; + BYTE b2; WINPR_ASSERT(mcs); WINPR_ASSERT(s); diff --git a/libfreerdp/core/message.c b/libfreerdp/core/message.c index f6fff0ae3..d73cf7fec 100644 --- a/libfreerdp/core/message.c +++ b/libfreerdp/core/message.c @@ -2976,7 +2976,8 @@ static int input_message_process_input_class(rdpInputProxy* proxy, wMessage* msg case Input_MouseEvent: { UINT32 pos; - UINT16 x, y; + UINT16 x; + UINT16 y; pos = (UINT32)(size_t)msg->lParam; x = ((pos & 0xFFFF0000) >> 16); y = (pos & 0x0000FFFF); @@ -2987,7 +2988,8 @@ static int input_message_process_input_class(rdpInputProxy* proxy, wMessage* msg case Input_ExtendedMouseEvent: { UINT32 pos; - UINT16 x, y; + UINT16 x; + UINT16 y; pos = (UINT32)(size_t)msg->lParam; x = ((pos & 0xFFFF0000) >> 16); y = (pos & 0x0000FFFF); diff --git a/libfreerdp/core/nego.c b/libfreerdp/core/nego.c index 4db48571f..db0fcf6e6 100644 --- a/libfreerdp/core/nego.c +++ b/libfreerdp/core/nego.c @@ -1064,7 +1064,8 @@ BOOL nego_send_negotiation_request(rdpNego* nego) BOOL rc = FALSE; wStream* s; size_t length; - size_t bm, em; + size_t bm; + size_t em; BYTE flags = 0; size_t cookie_length; s = Stream_New(NULL, 512); @@ -1152,7 +1153,9 @@ fail: static BOOL nego_process_correlation_info(rdpNego* nego, wStream* s) { - UINT8 type, flags, x; + UINT8 type; + UINT8 flags; + UINT8 x; UINT16 length; BYTE correlationId[16] = { 0 }; @@ -1397,7 +1400,8 @@ BOOL nego_process_negotiation_failure(rdpNego* nego, wStream* s) BOOL nego_send_negotiation_response(rdpNego* nego) { UINT16 length; - size_t bm, em; + size_t bm; + size_t em; BOOL status; wStream* s; BYTE flags; diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 41ba4e830..f3f6e4dd5 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -1103,7 +1103,7 @@ static BOOL set_creds_octetstring_to_settings(WinPrAsn1Decoder* dec, WinPrAsn1_t { if (optional) { - WinPrAsn1_tagId itemTag; + WinPrAsn1_tagId itemTag = 0; if (!WinPrAsn1DecPeekTag(dec, &itemTag) || (itemTag != tagId)) return TRUE; } @@ -1125,7 +1125,7 @@ static BOOL nla_read_TSCspDataDetail(WinPrAsn1Decoder* dec, rdpSettings* setting BOOL error = FALSE; /* keySpec [0] INTEGER */ - WinPrAsn1_INTEGER keyspec; + WinPrAsn1_INTEGER keyspec = 0; if (!WinPrAsn1DecReadContextualInteger(dec, 0, &error, &keyspec)) return FALSE; settings->KeySpec = (UINT32)keyspec; @@ -1455,7 +1455,7 @@ static BOOL nla_encode_ts_credentials(rdpNla* nla) goto out; /* pin [0] OCTET STRING */ - size_t ss; + size_t ss = 0; octet_string.data = (BYTE*)freerdp_settings_get_string_as_utf16(settings, FreeRDP_Password, &ss); octet_string.len = ss * sizeof(WCHAR); @@ -1475,7 +1475,7 @@ static BOOL nla_encode_ts_credentials(rdpNla* nla) for (size_t i = 0; i < ARRAYSIZE(cspData_fields); i++) { - size_t len; + size_t len = 0; octet_string.data = (BYTE*)freerdp_settings_get_string_as_utf16( settings, cspData_fields[i].setting_id, &len); @@ -1846,7 +1846,7 @@ int nla_recv_pdu(rdpNla* nla, wStream* s) if (nla_get_state(nla) == NLA_STATE_EARLY_USER_AUTH) { - UINT32 code; + UINT32 code = 0; Stream_Read_UINT32(s, code); if (code != AUTHZ_SUCCESS) { @@ -1865,7 +1865,7 @@ int nla_recv_pdu(rdpNla* nla, wStream* s) if (nla->errorCode) { - UINT32 code; + UINT32 code = 0; switch (nla->errorCode) { diff --git a/libfreerdp/core/orders.c b/libfreerdp/core/orders.c index dd19d9d9b..f6a0773dd 100644 --- a/libfreerdp/core/orders.c +++ b/libfreerdp/core/orders.c @@ -2864,7 +2864,8 @@ BOOL update_write_cache_glyph_v2_order(wStream* s, const CACHE_GLYPH_V2_ORDER* c } static BOOL update_decompress_brush(wStream* s, BYTE* output, size_t outSize, BYTE bpp) { - size_t x, k; + size_t x; + size_t k; INT8 y; BYTE byte = 0; const BYTE* palette = Stream_PointerAs(s, const BYTE) + 16; @@ -3918,7 +3919,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags) static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, BYTE flags) { BOOL rc = FALSE; - size_t start, end, pos, diff; + size_t start; + size_t end; + size_t pos; + size_t diff; BYTE orderType; UINT16 extraFlags; INT16 orderLength; diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index 5f2f4aca4..3556319af 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -474,7 +474,8 @@ static state_run_t peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s) if (channelId == MCS_GLOBAL_CHANNEL_ID) { char buffer[256] = { 0 }; - UINT16 pduLength, remain; + UINT16 pduLength; + UINT16 remain; if (!rdp_read_share_control_header(rdp, s, &pduLength, &remain, &pduType, &pduSource)) return STATE_RUN_FAILED; diff --git a/libfreerdp/core/proxy.c b/libfreerdp/core/proxy.c index 5a3eb770b..d43215e28 100644 --- a/libfreerdp/core/proxy.c +++ b/libfreerdp/core/proxy.c @@ -129,7 +129,9 @@ static BOOL value_to_int(const char* value, LONGLONG* result, LONGLONG min, LONG static BOOL cidr4_match(const struct in_addr* addr, const struct in_addr* net, BYTE bits) { - uint32_t mask, amask, nmask; + uint32_t mask; + uint32_t amask; + uint32_t nmask; if (bits == 0) return TRUE; @@ -145,7 +147,8 @@ static BOOL cidr6_match(const struct in6_addr* address, const struct in6_addr* n { const uint32_t* a = (const uint32_t*)address; const uint32_t* n = (const uint32_t*)network; - size_t bits_whole, bits_incomplete; + size_t bits_whole; + size_t bits_incomplete; bits_whole = bits >> 5; bits_incomplete = bits & 0x1F; @@ -712,7 +715,8 @@ static BOOL socks_proxy_connect(BIO* bufferedBio, const char* proxyUsername, const char* proxyPassword, const char* hostname, UINT16 port) { int status; - int nauthMethods = 1, writeLen = 3; + int nauthMethods = 1; + int writeLen = 3; BYTE buf[3 + 255 + 255]; /* biggest packet is user/pass auth */ size_t hostnlen = strnlen(hostname, 255); diff --git a/libfreerdp/core/smartcardlogon.c b/libfreerdp/core/smartcardlogon.c index 5a0bb0cd8..5ed74a1cb 100644 --- a/libfreerdp/core/smartcardlogon.c +++ b/libfreerdp/core/smartcardlogon.c @@ -610,7 +610,8 @@ static BOOL smartcard_hw_enumerateCerts(const rdpSettings* settings, LPCWSTR csp else { NCryptProviderName* names = NULL; - DWORD nproviders, i; + DWORD nproviders; + DWORD i; #ifdef _WIN32 /* On Windows, mstsc first enumerates the legacy CAPI providers for usable certificates. */ diff --git a/libfreerdp/core/test/TestConnect.c b/libfreerdp/core/test/TestConnect.c index 857ab76da..affb81c59 100644 --- a/libfreerdp/core/test/TestConnect.c +++ b/libfreerdp/core/test/TestConnect.c @@ -72,7 +72,9 @@ finish: static int testTimeout(int port) { const DWORD timeout = 200; - DWORD start, end, diff; + DWORD start; + DWORD end; + DWORD diff; char arg1[] = "/v:192.0.2.1:XXXXX"; char* argv[] = { "test", "/v:192.0.2.1:XXXXX" }; int rc; @@ -123,7 +125,9 @@ static DWORD WINAPI testThread(LPVOID arg) static int testAbort(int port) { DWORD status; - DWORD start, end, diff; + DWORD start; + DWORD end; + DWORD diff; HANDLE thread; struct testThreadArgs args; freerdp* instance = NULL; diff --git a/libfreerdp/core/test/TestSettings.c b/libfreerdp/core/test/TestSettings.c index 0f42df65d..c6eb38605 100644 --- a/libfreerdp/core/test/TestSettings.c +++ b/libfreerdp/core/test/TestSettings.c @@ -442,7 +442,9 @@ static BOOL check_key_helpers(size_t key, const char* stype) int test_rounds = 100; BOOL res = FALSE; rdpSettings* settings = NULL; - SSIZE_T rc, tkey, type; + SSIZE_T rc; + SSIZE_T tkey; + SSIZE_T type; size_t x; const size_t clear_keys[] = { FreeRDP_RdpServerCertificate, FreeRDP_RdpServerRsaKey, @@ -527,7 +529,8 @@ static BOOL check_key_helpers(size_t key, const char* stype) do { UINT16 intEntryType = 0; - BOOL expect, have; + BOOL expect; + BOOL have; char value[8192] = { 0 }; union { diff --git a/libfreerdp/core/test/TestStreamDump.c b/libfreerdp/core/test/TestStreamDump.c index 17dc15328..613b8d462 100644 --- a/libfreerdp/core/test/TestStreamDump.c +++ b/libfreerdp/core/test/TestStreamDump.c @@ -13,8 +13,10 @@ static BOOL test_entry_read_write(void) { BOOL rc = FALSE; FILE* fp = NULL; - wStream *sw = NULL, *sr = NULL; - size_t offset = 0, x; + wStream* sw = NULL; + wStream* sr = NULL; + size_t offset = 0; + size_t x; UINT64 ts = 0; UINT32 flags = 0; BYTE tmp[16] = { 0 }; diff --git a/libfreerdp/core/test/TestVersion.c b/libfreerdp/core/test/TestVersion.c index a555ae683..2a4bc5432 100644 --- a/libfreerdp/core/test/TestVersion.c +++ b/libfreerdp/core/test/TestVersion.c @@ -6,7 +6,9 @@ int TestVersion(int argc, char* argv[]) const char* version; const char* git; const char* build; - int major = 0, minor = 0, revision = 0; + int major = 0; + int minor = 0; + int revision = 0; WINPR_UNUSED(argc); WINPR_UNUSED(argv); freerdp_get_version(&major, &minor, &revision); diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index 9d193bbb0..96ff0b8f1 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -554,7 +554,9 @@ BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 por else { UINT16 peerPort; - const char *proxyHostname, *proxyUsername, *proxyPassword; + const char* proxyHostname; + const char* proxyUsername; + const char* proxyPassword; BOOL isProxyConnection = proxy_prepare(settings, &proxyHostname, &peerPort, &proxyUsername, &proxyPassword); diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index aa2fccb87..dd7f54c49 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -2055,7 +2055,9 @@ static BOOL update_send_create_offscreen_bitmap_order( rdpContext* context, const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { wStream* s; - size_t bm, em, inf; + size_t bm; + size_t em; + size_t inf; BYTE orderType; BYTE controlFlags; size_t headerLength; @@ -2098,7 +2100,9 @@ static BOOL update_send_switch_surface_order(rdpContext* context, const SWITCH_SURFACE_ORDER* switch_surface) { wStream* s; - size_t bm, em, inf; + size_t bm; + size_t em; + size_t inf; BYTE orderType; BYTE controlFlags; size_t headerLength; diff --git a/libfreerdp/crypto/base64.c b/libfreerdp/crypto/base64.c index 8b7b60faf..c9ec95f11 100644 --- a/libfreerdp/crypto/base64.c +++ b/libfreerdp/crypto/base64.c @@ -139,7 +139,9 @@ static void* base64_decode(const char* alphabet, const char* s, size_t length, s int n[4]; BYTE* q; BYTE* data; - size_t nBlocks, i, outputLen; + size_t nBlocks; + size_t i; + size_t outputLen; int remainder = length % 4; if ((pad && remainder > 0) || (remainder == 1)) diff --git a/libfreerdp/crypto/ber.c b/libfreerdp/crypto/ber.c index 3d085b677..eb2bd654e 100644 --- a/libfreerdp/crypto/ber.c +++ b/libfreerdp/crypto/ber.c @@ -391,7 +391,8 @@ size_t ber_write_octet_string(wStream* s, const BYTE* oct_str, size_t length) size_t ber_write_contextual_octet_string(wStream* s, BYTE tag, const BYTE* oct_str, size_t length) { size_t inner = ber_sizeof_octet_string(length); - size_t ret, r; + size_t ret; + size_t r; ret = ber_write_contextual_tag(s, tag, inner, TRUE); if (!ret) diff --git a/libfreerdp/crypto/certificate.c b/libfreerdp/crypto/certificate.c index 0e319e265..c7d367da6 100644 --- a/libfreerdp/crypto/certificate.c +++ b/libfreerdp/crypto/certificate.c @@ -1003,7 +1003,8 @@ BOOL freerdp_certificate_read_server_cert(rdpCertificate* certificate, const BYT size_t length) { BOOL ret = FALSE; - wStream *s, sbuffer; + wStream* s; + wStream sbuffer; UINT32 dwVersion = 0; WINPR_ASSERT(certificate); diff --git a/libfreerdp/crypto/crypto.c b/libfreerdp/crypto/crypto.c index 9d99b9726..98631f006 100644 --- a/libfreerdp/crypto/crypto.c +++ b/libfreerdp/crypto/crypto.c @@ -175,7 +175,8 @@ SSIZE_T crypto_rsa_private_decrypt(const BYTE* input, size_t length, const rdpPr void crypto_reverse(BYTE* data, size_t length) { - size_t i, j; + size_t i; + size_t j; if (length < 1) return; diff --git a/libfreerdp/crypto/per.c b/libfreerdp/crypto/per.c index 2765200e4..6c15a11cc 100644 --- a/libfreerdp/crypto/per.c +++ b/libfreerdp/crypto/per.c @@ -580,7 +580,9 @@ BOOL per_write_numeric_string(wStream* s, const BYTE* num_str, UINT16 length, UI { UINT16 i; UINT16 mlength; - BYTE num, c1, c2; + BYTE num; + BYTE c1; + BYTE c2; mlength = (length >= min) ? length - min : min; diff --git a/libfreerdp/crypto/test/TestBase64.c b/libfreerdp/crypto/test/TestBase64.c index 1c01df799..84b4d445b 100644 --- a/libfreerdp/crypto/test/TestBase64.c +++ b/libfreerdp/crypto/test/TestBase64.c @@ -52,7 +52,8 @@ static const struct Encode64test encodeTests_base64url[] = { int TestBase64(int argc, char* argv[]) { - int i, testNb = 0; + int i; + int testNb = 0; size_t outLen; BYTE* decoded; WINPR_UNUSED(argc); diff --git a/libfreerdp/crypto/x509_utils.c b/libfreerdp/crypto/x509_utils.c index e51ae20b4..cdbc40cd3 100644 --- a/libfreerdp/crypto/x509_utils.c +++ b/libfreerdp/crypto/x509_utils.c @@ -584,7 +584,9 @@ out_free_issuer: static BYTE* x509_utils_get_pem(const X509* xcert, const STACK_OF(X509) * chain, size_t* plength) { BIO* bio; - int status, count, x; + int status; + int count; + int x; size_t offset; size_t length = 0; BOOL rc = FALSE; @@ -761,7 +763,8 @@ static WINPR_MD_TYPE hash_nid_to_winpr(int hash_nid) static WINPR_MD_TYPE get_rsa_pss_digest(const X509_ALGOR* alg) { WINPR_MD_TYPE ret = WINPR_MD_NONE; - WINPR_MD_TYPE message_digest, mgf1_digest; + WINPR_MD_TYPE message_digest; + WINPR_MD_TYPE mgf1_digest; int param_type; const void* param_value; const ASN1_STRING* sequence; @@ -953,7 +956,8 @@ BOOL x509_utils_verify(X509* xcert, STACK_OF(X509) * chain, const char* certific for (size_t i = 0; i < ARRAYSIZE(purposes); i++) { - int err = -1, rc = -1; + int err = -1; + int rc = -1; int purpose = purposes[i]; csc = X509_STORE_CTX_new(); diff --git a/libfreerdp/emu/scard/smartcard_emulate.c b/libfreerdp/emu/scard/smartcard_emulate.c index 36f8994d8..5caff6f7f 100644 --- a/libfreerdp/emu/scard/smartcard_emulate.c +++ b/libfreerdp/emu/scard/smartcard_emulate.c @@ -1534,7 +1534,8 @@ SCardHandle* find_reader(SmartcardEmulationContext* smartcard, const void* szRea { SCardHandle* hdl = NULL; UINT_PTR* keys = NULL; - size_t x, count; + size_t x; + size_t count; WINPR_ASSERT(smartcard); count = HashTable_GetKeys(smartcard->handles, &keys); diff --git a/libfreerdp/emu/scard/smartcard_virtual_gids.c b/libfreerdp/emu/scard/smartcard_virtual_gids.c index a886d0607..9206e2c53 100644 --- a/libfreerdp/emu/scard/smartcard_virtual_gids.c +++ b/libfreerdp/emu/scard/smartcard_virtual_gids.c @@ -679,7 +679,9 @@ static void vgids_reset_context_command_data(vgidsContext* context) static BOOL vgids_ins_select(vgidsContext* context, wStream* s, BYTE** response, DWORD* responseSize) { - BYTE p1, p2, lc; + BYTE p1; + BYTE p2; + BYTE lc; DWORD resultDataSize = 0; const BYTE* resultData = NULL; UINT16 status = ISO_STATUS_SUCCESS; @@ -855,7 +857,9 @@ static BOOL vgids_ins_getdata(vgidsContext* context, wStream* s, BYTE** response { UINT16 doId; UINT16 fileId; - BYTE p1, p2, lc; + BYTE p1; + BYTE p2; + BYTE lc; DWORD resultDataSize = 0; const BYTE* resultData = NULL; UINT16 status = ISO_STATUS_SUCCESS; @@ -878,7 +882,8 @@ static BOOL vgids_ins_getdata(vgidsContext* context, wStream* s, BYTE** response { case 4: { - BYTE tag, length; + BYTE tag; + BYTE length; Stream_Read_UINT8(s, tag); Stream_Read_UINT8(s, length); if (tag != 0x5C && length != 0x02) @@ -894,7 +899,9 @@ static BOOL vgids_ins_getdata(vgidsContext* context, wStream* s, BYTE** response case 0xA: { UINT16 pubKeyDO; - BYTE tag, length, keyRef; + BYTE tag; + BYTE length; + BYTE keyRef; /* We want to retrieve the public key? */ if (p1 != 0x3F && p2 != 0xFF) @@ -966,8 +973,11 @@ static BOOL vgids_ins_getdata(vgidsContext* context, wStream* s, BYTE** response static BOOL vgids_ins_manage_security_environment(vgidsContext* context, wStream* s, BYTE** response, DWORD* responseSize) { - BYTE tag, length; - BYTE p1, p2, lc; + BYTE tag; + BYTE length; + BYTE p1; + BYTE p2; + BYTE lc; DWORD resultDataSize = 0; const BYTE* resultData = NULL; UINT16 status = ISO_STATUS_SUCCESS; @@ -1026,7 +1036,8 @@ create_response: static BOOL vgids_perform_digital_signature(vgidsContext* context) { - size_t sigSize, msgSize; + size_t sigSize; + size_t msgSize; EVP_PKEY_CTX* ctx = NULL; EVP_PKEY* pk = freerdp_key_get_evp_pkey(context->privateKey); const vgidsDigestInfoMap gidsDigestInfo[VGIDS_MAX_DIGEST_INFO] = { @@ -1203,7 +1214,10 @@ decrypt_failed: static BOOL vgids_ins_perform_security_operation(vgidsContext* context, wStream* s, BYTE** response, DWORD* responseSize) { - BYTE cla, p1, p2, lc; + BYTE cla; + BYTE p1; + BYTE p2; + BYTE lc; DWORD resultDataSize = 0; const BYTE* resultData = NULL; UINT16 status = ISO_STATUS_SUCCESS; @@ -1291,10 +1305,13 @@ create_response: static BOOL vgids_ins_getresponse(vgidsContext* context, wStream* s, BYTE** response, DWORD* responseSize) { - BYTE p1, p2, le; + BYTE p1; + BYTE p2; + BYTE le; DWORD resultDataSize = 0; const BYTE* resultData = NULL; - DWORD expectedLen, remainingSize; + DWORD expectedLen; + DWORD remainingSize; UINT16 status = ISO_STATUS_SUCCESS; /* Get response continues data transfer after a previous get data command */ @@ -1345,7 +1362,10 @@ create_response: static BOOL vgids_ins_verify(vgidsContext* context, wStream* s, BYTE** response, DWORD* responseSize) { - BYTE ins, p1, p2, lc; + BYTE ins; + BYTE p1; + BYTE p2; + BYTE lc; UINT16 status = ISO_STATUS_SUCCESS; char pin[VGIDS_MAX_PIN_SIZE + 1] = { 0 }; diff --git a/libfreerdp/gdi/bitmap.c b/libfreerdp/gdi/bitmap.c index 178f5fd41..64dddb809 100644 --- a/libfreerdp/gdi/bitmap.c +++ b/libfreerdp/gdi/bitmap.c @@ -348,7 +348,8 @@ static BOOL adjust_src_coordinates(HGDI_DC hdcSrc, INT32 nWidth, INT32 nHeight, INT32* py) { HGDI_BITMAP hSrcBmp; - INT32 nXSrc, nYSrc; + INT32 nXSrc; + INT32 nYSrc; if (!hdcSrc || (nWidth < 0) || (nHeight < 0) || !px || !py) return FALSE; @@ -390,9 +391,14 @@ static BOOL adjust_src_dst_coordinates(HGDI_DC hdcDest, INT32* pnXSrc, INT32* pn INT32* pnYDst, INT32* pnWidth, INT32* pnHeight) { HGDI_BITMAP hDstBmp; - volatile INT32 diffX, diffY; - volatile INT32 nXSrc, nYSrc; - volatile INT32 nXDst, nYDst, nWidth, nHeight; + volatile INT32 diffX; + volatile INT32 diffY; + volatile INT32 nXSrc; + volatile INT32 nYSrc; + volatile INT32 nXDst; + volatile INT32 nYDst; + volatile INT32 nWidth; + volatile INT32 nHeight; if (!hdcDest || !pnXSrc || !pnYSrc || !pnXDst || !pnYDst || !pnWidth || !pnHeight) return FALSE; @@ -453,7 +459,8 @@ static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, INT32 nW HGDI_DC hdcSrc, INT32 nXSrc, INT32 nYSrc, const char* rop, const gdiPalette* palette) { - INT32 x, y; + INT32 x; + INT32 y; UINT32 style = 0; BOOL useSrc = FALSE; BOOL usePat = FALSE; @@ -578,7 +585,8 @@ static BOOL BitBlt_process(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, INT32 nW BOOL gdi_BitBlt(HGDI_DC hdcDest, INT32 nXDest, INT32 nYDest, INT32 nWidth, INT32 nHeight, HGDI_DC hdcSrc, INT32 nXSrc, INT32 nYSrc, DWORD rop, const gdiPalette* palette) { - HGDI_BITMAP hSrcBmp, hDstBmp; + HGDI_BITMAP hSrcBmp; + HGDI_BITMAP hDstBmp; if (!hdcDest) return FALSE; diff --git a/libfreerdp/gdi/gdi.c b/libfreerdp/gdi/gdi.c index cd9ebdca1..3dcb35547 100644 --- a/libfreerdp/gdi/gdi.c +++ b/libfreerdp/gdi/gdi.c @@ -583,7 +583,8 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) UINT32 foreColor; UINT32 backColor; UINT32 originalColor; - HGDI_BRUSH originalBrush, hbrush = NULL; + HGDI_BRUSH originalBrush; + HGDI_BRUSH hbrush = NULL; rdpGdi* gdi = context->gdi; BOOL ret = FALSE; const DWORD rop = gdi_rop3_code(patblt->bRop); @@ -795,7 +796,8 @@ static BOOL gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline) HGDI_PEN hPen; DELTA_POINT* points; rdpGdi* gdi = context->gdi; - INT32 w = 0, h = 0; + INT32 w = 0; + INT32 h = 0; if (!gdi_decode_color(gdi, polyline->penColor, &color, NULL)) return FALSE; diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 4d3480539..8db35ff26 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -163,11 +163,14 @@ fail: static UINT gdi_OutputUpdate(rdpGdi* gdi, gdiGfxSurface* surface) { UINT rc = ERROR_INTERNAL_ERROR; - UINT32 surfaceX, surfaceY; + UINT32 surfaceX; + UINT32 surfaceY; RECTANGLE_16 surfaceRect; const RECTANGLE_16* rects; - UINT32 i, nbRects; - double sx, sy; + UINT32 i; + UINT32 nbRects; + double sx; + double sy; rdpUpdate* update; WINPR_ASSERT(gdi); @@ -400,7 +403,8 @@ static UINT gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, RdpgfxClientContext* contex gdiGfxSurface* surface; REGION16 invalidRegion; const RECTANGLE_16* rects; - UINT32 nrRects, x; + UINT32 nrRects; + UINT32 x; WINPR_ASSERT(gdi); WINPR_ASSERT(context); WINPR_ASSERT(cmd); @@ -770,7 +774,9 @@ static BOOL gdi_apply_alpha(BYTE* data, UINT32 format, UINT32 stride, RECTANGLE_ for (UINT32 x = first ? rect->left + startOffsetX : rect->left; x < rect->right; x++) { - BYTE r = 0, g = 0, b = 0; + BYTE r = 0; + BYTE g = 0; + BYTE b = 0; if (written == count) return TRUE; @@ -797,7 +803,8 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, const RDPGFX_SURFACE_COMMAND* cmd) { UINT status = CHANNEL_RC_OK; - UINT16 alphaSig, compressed; + UINT16 alphaSig; + UINT16 compressed; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; wStream buffer; @@ -842,7 +849,10 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, for (UINT32 x = cmd->left; x < cmd->left + cmd->width; x++) { UINT32 color; - BYTE r, g, b, a; + BYTE r; + BYTE g; + BYTE b; + BYTE a; BYTE* src = &line[x * FreeRDPGetBytesPerPixel(surface->format)]; Stream_Read_UINT8(s, a); color = FreeRDPReadColor(src, surface->format); @@ -936,7 +946,8 @@ static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, RdpgfxClientContext* con gdiGfxSurface* surface; REGION16 invalidRegion; const RECTANGLE_16* rects; - UINT32 nrRects, x; + UINT32 nrRects; + UINT32 x; /** * Note: Since this comes via a Wire-To-Surface-2 PDU the * cmd's top/left/right/bottom/width/height members are always zero! @@ -1315,7 +1326,8 @@ static UINT gdi_SurfaceToSurface(RdpgfxClientContext* context, UINT status = ERROR_INTERNAL_ERROR; UINT16 index; BOOL sameSurface; - UINT32 nWidth, nHeight; + UINT32 nWidth; + UINT32 nHeight; const RECTANGLE_16* rectSrc; RECTANGLE_16 invalidRect; gdiGfxSurface* surfaceSrc; diff --git a/libfreerdp/gdi/line.c b/libfreerdp/gdi/line.c index 7c600dc1f..6c9869571 100644 --- a/libfreerdp/gdi/line.c +++ b/libfreerdp/gdi/line.c @@ -137,7 +137,10 @@ BOOL gdi_LineTo(HGDI_DC hdc, UINT32 nXEnd, UINT32 nYEnd) INT32 y = y1; WINPR_ASSERT(hdc->clip); - INT32 bx1, by1, bx2, by2; + INT32 bx1; + INT32 by1; + INT32 bx2; + INT32 by2; if (hdc->clip->null) { bx1 = (x1 < x2) ? x1 : x2; diff --git a/libfreerdp/gdi/region.c b/libfreerdp/gdi/region.c index 49506060d..32b2d96e7 100644 --- a/libfreerdp/gdi/region.c +++ b/libfreerdp/gdi/region.c @@ -74,7 +74,8 @@ static char* gdi_regn_str(char* buffer, size_t size, const HGDI_RGN rgn) HGDI_RGN gdi_CreateRectRgn(INT32 nLeftRect, INT32 nTopRect, INT32 nRightRect, INT32 nBottomRect) { - INT64 w, h; + INT64 w; + INT64 h; HGDI_RGN hRgn; w = nRightRect - nLeftRect + 1ll; @@ -141,7 +142,8 @@ HGDI_RECT gdi_CreateRect(INT32 xLeft, INT32 yTop, INT32 xRight, INT32 yBottom) BOOL gdi_RectToRgn(const HGDI_RECT rect, HGDI_RGN rgn) { BOOL rc = TRUE; - INT64 w, h; + INT64 w; + INT64 h; w = rect->right - rect->left + 1ll; h = rect->bottom - rect->top + 1ll; @@ -176,7 +178,8 @@ BOOL gdi_RectToRgn(const HGDI_RECT rect, HGDI_RGN rgn) BOOL gdi_CRectToRgn(INT32 left, INT32 top, INT32 right, INT32 bottom, HGDI_RGN rgn) { BOOL rc = TRUE; - INT64 w, h; + INT64 w; + INT64 h; w = right - left + 1ll; h = bottom - top + 1ll; @@ -253,7 +256,8 @@ BOOL gdi_RectToCRgn(const HGDI_RECT rect, INT32* x, INT32* y, INT32* w, INT32* h BOOL gdi_CRectToCRgn(INT32 left, INT32 top, INT32 right, INT32 bottom, INT32* x, INT32* y, INT32* w, INT32* h) { - INT64 wl, hl; + INT64 wl; + INT64 hl; BOOL rc = TRUE; wl = right - left + 1ll; hl = bottom - top + 1ll; @@ -285,7 +289,8 @@ BOOL gdi_CRectToCRgn(INT32 left, INT32 top, INT32 right, INT32 bottom, INT32* x, BOOL gdi_RgnToRect(const HGDI_RGN rgn, HGDI_RECT rect) { - INT64 r, b; + INT64 r; + INT64 b; BOOL rc = TRUE; r = rgn->x + rgn->w - 1ll; b = rgn->y + rgn->h - 1ll; diff --git a/libfreerdp/gdi/shape.c b/libfreerdp/gdi/shape.c index a9c9b795f..ef21ff87e 100644 --- a/libfreerdp/gdi/shape.c +++ b/libfreerdp/gdi/shape.c @@ -41,9 +41,13 @@ static void Ellipse_Bresenham(HGDI_DC hdc, int x1, int y1, int x2, int y2) { - INT32 e, e2; - INT32 dx, dy; - INT32 a, b, c; + INT32 e; + INT32 e2; + INT32 dx; + INT32 dy; + INT32 a; + INT32 b; + INT32 c; a = (x1 < x2) ? x2 - x1 : x1 - x2; b = (y1 < y2) ? y2 - y1 : y1 - y2; c = b & 1; @@ -126,11 +130,15 @@ BOOL gdi_Ellipse(HGDI_DC hdc, int nLeftRect, int nTopRect, int nRightRect, int n BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, HGDI_BRUSH hbr) { - INT32 x, y; - UINT32 color, dstColor; + INT32 x; + INT32 y; + UINT32 color; + UINT32 dstColor; BOOL monochrome = FALSE; - INT32 nXDest, nYDest; - INT32 nWidth, nHeight; + INT32 nXDest; + INT32 nYDest; + INT32 nWidth; + INT32 nHeight; const BYTE* srcp; DWORD formatSize; gdi_RectToCRgn(rect, &nXDest, &nYDest, &nWidth, &nHeight); @@ -245,7 +253,8 @@ BOOL gdi_PolyPolygon(HGDI_DC hdc, GDI_POINT* lpPoints, int* lpPolyCounts, int nC BOOL gdi_Rectangle(HGDI_DC hdc, INT32 nXDst, INT32 nYDst, INT32 nWidth, INT32 nHeight) { - INT32 x, y; + INT32 x; + INT32 y; UINT32 color; if (!gdi_ClipCoords(hdc, &nXDst, &nYDst, &nWidth, &nHeight, NULL, NULL)) diff --git a/libfreerdp/gdi/test/TestGdiCreate.c b/libfreerdp/gdi/test/TestGdiCreate.c index e1f62df5a..0dd82644d 100644 --- a/libfreerdp/gdi/test/TestGdiCreate.c +++ b/libfreerdp/gdi/test/TestGdiCreate.c @@ -332,7 +332,8 @@ static BOOL test_gdi_GetPixel(void) for (x = 0; x < colorFormatCount; x++) { - UINT32 i, j; + UINT32 i; + UINT32 j; UINT32 bpp; HGDI_DC hdc; UINT32 width = 128; @@ -393,7 +394,9 @@ static BOOL test_gdi_SetPixel(void) for (x = 0; x < colorFormatCount; x++) { - UINT32 i, j, bpp; + UINT32 i; + UINT32 j; + UINT32 bpp; HGDI_DC hdc; UINT32 width = 128; UINT32 height = 64; diff --git a/libfreerdp/gdi/test/TestGdiEllipse.c b/libfreerdp/gdi/test/TestGdiEllipse.c index 50e5136f4..62120960c 100644 --- a/libfreerdp/gdi/test/TestGdiEllipse.c +++ b/libfreerdp/gdi/test/TestGdiEllipse.c @@ -77,7 +77,8 @@ static const BYTE ellipse_case_3[256] = { int TestGdiEllipse(int argc, char* argv[]) { int rc = -1; - UINT32 i, j; + UINT32 i; + UINT32 j; const UINT32 RawFormat = PIXEL_FORMAT_RGB8; const UINT32 colorFormats[] = { PIXEL_FORMAT_RGB15, PIXEL_FORMAT_ARGB15, PIXEL_FORMAT_RGB16, PIXEL_FORMAT_RGB24, PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_XRGB32, diff --git a/libfreerdp/gdi/test/TestGdiLine.c b/libfreerdp/gdi/test/TestGdiLine.c index 86242e959..0d3f29c7d 100644 --- a/libfreerdp/gdi/test/TestGdiLine.c +++ b/libfreerdp/gdi/test/TestGdiLine.c @@ -565,7 +565,8 @@ static BOOL test_line(HGDI_DC hdc, const gdiPalette* hPalette, UINT32 mX, UINT32 int TestGdiLine(int argc, char* argv[]) { int rc = -1; - UINT32 x, i; + UINT32 x; + UINT32 i; gdiPalette g; const UINT32 RawFormat = PIXEL_FORMAT_RGB8; const UINT32 colorFormats[] = { PIXEL_FORMAT_RGB15, PIXEL_FORMAT_ARGB15, PIXEL_FORMAT_RGB16, diff --git a/libfreerdp/gdi/test/TestGdiRect.c b/libfreerdp/gdi/test/TestGdiRect.c index 44f4dd5f1..46b136172 100644 --- a/libfreerdp/gdi/test/TestGdiRect.c +++ b/libfreerdp/gdi/test/TestGdiRect.c @@ -72,7 +72,8 @@ static int test_gdi_FillRect(void) UINT32 color; UINT32 pixel; UINT32 rawPixel; - UINT32 x, y; + UINT32 x; + UINT32 y; UINT32 badPixels; UINT32 goodPixels; UINT32 width = 200; diff --git a/libfreerdp/gdi/test/TestGdiRegion.c b/libfreerdp/gdi/test/TestGdiRegion.c index 1ce74d895..fc4ca76c8 100644 --- a/libfreerdp/gdi/test/TestGdiRegion.c +++ b/libfreerdp/gdi/test/TestGdiRegion.c @@ -14,8 +14,14 @@ int TestGdiRegion(int argc, char* argv[]) { int rc = -1; - INT32 x, y, w, h; - INT32 l, r, t, b; + INT32 x; + INT32 y; + INT32 w; + INT32 h; + INT32 l; + INT32 r; + INT32 t; + INT32 b; HGDI_RGN rgn1 = NULL; HGDI_RGN rgn2 = NULL; HGDI_RECT rect1 = NULL; diff --git a/libfreerdp/gdi/test/TestGdiRop3.c b/libfreerdp/gdi/test/TestGdiRop3.c index 3940350e7..6e2309b1f 100644 --- a/libfreerdp/gdi/test/TestGdiRop3.c +++ b/libfreerdp/gdi/test/TestGdiRop3.c @@ -100,8 +100,14 @@ static char* gdi_convert_postfix_to_infix(const char* postfix) size_t length; BOOL unary; wStack* stack; - size_t al, bl, cl, dl; - char *a, *b, *c, *d; + size_t al; + size_t bl; + size_t cl; + size_t dl; + char* a; + char* b; + char* c; + char* d; bl = cl = dl = 0; stack = Stack_New(FALSE); length = strlen(postfix); diff --git a/libfreerdp/gdi/test/helpers.c b/libfreerdp/gdi/test/helpers.c index 1186bab8a..9606041b3 100644 --- a/libfreerdp/gdi/test/helpers.c +++ b/libfreerdp/gdi/test/helpers.c @@ -56,7 +56,9 @@ HGDI_BITMAP test_convert_to_bitmap(const BYTE* src, UINT32 SrcFormat, UINT32 Src static void test_dump_data(unsigned char* p, int len, int width, const char* name) { unsigned char* line = p; - int i, thisline, offset = 0; + int i; + int thisline; + int offset = 0; return; // TODO: Activate this manually if required. Improves test speed printf("\n%s[%d][%d]:\n", name, len / width, width); @@ -91,10 +93,12 @@ void test_dump_bitmap(HGDI_BITMAP hBmp, const char* name) static BOOL CompareBitmaps(HGDI_BITMAP hBmp1, HGDI_BITMAP hBmp2, const gdiPalette* palette) { - UINT32 x, y; + UINT32 x; + UINT32 y; const BYTE* p1 = hBmp1->data; const BYTE* p2 = hBmp2->data; - UINT32 colorA, colorB; + UINT32 colorA; + UINT32 colorB; UINT32 minw = (hBmp1->width < hBmp2->width) ? hBmp1->width : hBmp2->width; UINT32 minh = (hBmp1->height < hBmp2->height) ? hBmp1->height : hBmp2->height; diff --git a/libfreerdp/locale/keyboard.c b/libfreerdp/locale/keyboard.c index 4d3592c24..08c1320fa 100644 --- a/libfreerdp/locale/keyboard.c +++ b/libfreerdp/locale/keyboard.c @@ -350,7 +350,8 @@ DWORD freerdp_keyboard_init_ex(DWORD keyboardLayoutId, const char* keyboardRemap token = strtok_s(copy, ",", &context); while (token) { - DWORD key, value; + DWORD key; + DWORD value; int rc = sscanf(token, "%" PRIu32 "=%" PRIu32, &key, &value); if (rc != 2) rc = sscanf(token, "%" PRIx32 "=%" PRIx32 "", &key, &value); diff --git a/libfreerdp/locale/keyboard_layout.c b/libfreerdp/locale/keyboard_layout.c index 8e3d2d057..58f7944d9 100644 --- a/libfreerdp/locale/keyboard_layout.c +++ b/libfreerdp/locale/keyboard_layout.c @@ -816,7 +816,8 @@ void freerdp_keyboard_layouts_free(RDP_KEYBOARD_LAYOUT* layouts, size_t count) RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types, size_t* count) { - size_t num, i; + size_t num; + size_t i; RDP_KEYBOARD_LAYOUT* layouts = NULL; num = 0; diff --git a/libfreerdp/locale/keyboard_x11.c b/libfreerdp/locale/keyboard_x11.c index 00272f74d..03290c070 100644 --- a/libfreerdp/locale/keyboard_x11.c +++ b/libfreerdp/locale/keyboard_x11.c @@ -31,7 +31,8 @@ static BOOL parse_xkb_rule_names(char* xkb_rule, unsigned long num_bytes, char** layout, char** variant) { - size_t i, index; + size_t i; + size_t index; /* Sample output for "Canadian Multilingual Standard" * * _XKB_RULES_NAMES_BACKUP(STRING) = "xorg", "pc105", "ca", "multi", "magic" diff --git a/libfreerdp/primitives/prim_YCoCg.c b/libfreerdp/primitives/prim_YCoCg.c index 2e627491d..cb6b7b43c 100644 --- a/libfreerdp/primitives/prim_YCoCg.c +++ b/libfreerdp/primitives/prim_YCoCg.c @@ -37,7 +37,8 @@ static pstatus_t general_YCoCgToRGB_8u_AC4R(const BYTE* pSrc, INT32 srcStep, BYT UINT32 DstFormat, INT32 dstStep, UINT32 width, UINT32 height, UINT8 shift, BOOL withAlpha) { - UINT32 x, y; + UINT32 x; + UINT32 y; const DWORD formatSize = FreeRDPGetBytesPerPixel(DstFormat); fkt_writePixel writePixel = getPixelWriteFunction(DstFormat, TRUE); diff --git a/libfreerdp/primitives/prim_YCoCg_opt.c b/libfreerdp/primitives/prim_YCoCg_opt.c index a39fdfb1d..0a6cae419 100644 --- a/libfreerdp/primitives/prim_YCoCg_opt.c +++ b/libfreerdp/primitives/prim_YCoCg_opt.c @@ -99,7 +99,14 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_invert(const BYTE* WINPR_RESTRICT pSr while (w >= 8) { - __m128i R0, R1, R2, R3, R4, R5, R6, R7; + __m128i R0; + __m128i R1; + __m128i R2; + __m128i R3; + __m128i R4; + __m128i R5; + __m128i R6; + __m128i R7; if (onStride) { @@ -279,7 +286,14 @@ static pstatus_t ssse3_YCoCgRToRGB_8u_AC4R_no_invert(const BYTE* WINPR_RESTRICT while (w >= 8) { - __m128i R0, R1, R2, R3, R4, R5, R6, R7; + __m128i R0; + __m128i R1; + __m128i R2; + __m128i R3; + __m128i R4; + __m128i R5; + __m128i R6; + __m128i R7; if (onStride) { diff --git a/libfreerdp/primitives/prim_YUV.c b/libfreerdp/primitives/prim_YUV.c index d4edc2c72..3ca610075 100644 --- a/libfreerdp/primitives/prim_YUV.c +++ b/libfreerdp/primitives/prim_YUV.c @@ -99,7 +99,8 @@ static pstatus_t general_ChromaFilter(BYTE* WINPR_RESTRICT pDst[3], const UINT32 const UINT32 nHeight = roi->bottom - roi->top; const UINT32 halfHeight = (nHeight + 1) / 2; const UINT32 halfWidth = (nWidth + 1) / 2; - UINT32 x, y; + UINT32 x; + UINT32 y; /* Filter */ for (y = roi->top; y < halfHeight + roi->top; y++) @@ -147,7 +148,8 @@ static pstatus_t general_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcR const UINT32 mod = 16; UINT32 uY = 0; UINT32 vY = 0; - UINT32 x, y; + UINT32 x; + UINT32 y; const UINT32 nWidth = roi->right - roi->left; const UINT32 nHeight = roi->bottom - roi->top; const UINT32 halfWidth = (nWidth) / 2; @@ -221,7 +223,8 @@ static pstatus_t general_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[ const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) { - UINT32 x, y; + UINT32 x; + UINT32 y; const UINT32 nWidth = roi->right - roi->left; const UINT32 nHeight = roi->bottom - roi->top; const UINT32 halfWidth = (nWidth + 1) / 2; @@ -305,8 +308,12 @@ general_YUV444SplitToYUV420(const BYTE* const WINPR_RESTRICT pSrc[3], const UINT BYTE* WINPR_RESTRICT pAuxDst[3], const UINT32 dstAuxStep[3], const prim_size_t* WINPR_RESTRICT roi) { - UINT32 x, y, uY = 0, vY = 0; - UINT32 halfWidth, halfHeight; + UINT32 x; + UINT32 y; + UINT32 uY = 0; + UINT32 vY = 0; + UINT32 halfWidth; + UINT32 halfHeight; /* The auxilary frame is aligned to multiples of 16x16. * We need the padded height for B4 and B5 conversion. */ const UINT32 padHeigth = roi->height + 16 - roi->height % 16; @@ -487,18 +494,23 @@ static pstatus_t general_YUV420ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) { - UINT32 x, y; + UINT32 x; + UINT32 y; UINT32 dstPad; UINT32 srcPad[3]; - BYTE Y, U, V; + BYTE Y; + BYTE U; + BYTE V; UINT32 halfWidth; UINT32 halfHeight; const BYTE* pY; const BYTE* pU; const BYTE* pV; BYTE* pRGB = pDst; - UINT32 nWidth, nHeight; - UINT32 lastRow, lastCol; + UINT32 nWidth; + UINT32 nHeight; + UINT32 lastRow; + UINT32 lastCol; const DWORD formatSize = FreeRDPGetBytesPerPixel(DstFormat); fkt_writePixel writePixel = getPixelWriteFunction(DstFormat, FALSE); pY = pSrc[0]; @@ -633,8 +645,10 @@ static pstatus_t general_RGBToYUV444_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc, const prim_size_t* WINPR_RESTRICT roi) { const UINT32 bpp = FreeRDPGetBytesPerPixel(SrcFormat); - UINT32 x, y; - UINT32 nWidth, nHeight; + UINT32 x; + UINT32 y; + UINT32 nWidth; + UINT32 nHeight; nWidth = roi->width; nHeight = roi->height; @@ -647,7 +661,9 @@ static pstatus_t general_RGBToYUV444_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc, for (x = 0; x < nWidth; x++) { - BYTE B, G, R; + BYTE B; + BYTE G; + BYTE R; const UINT32 color = FreeRDPReadColor(&pRGB[x * bpp], SrcFormat); FreeRDPSplitColor(color, SrcFormat, &R, &G, &B, NULL, NULL); pY[x] = RGB2Y(R, G, B); @@ -664,9 +680,17 @@ static INLINE pstatus_t general_RGBToYUV420_BGRX(const BYTE* WINPR_RESTRICT pSrc const UINT32 dstStep[3], const prim_size_t* WINPR_RESTRICT roi) { - UINT32 x, y, i; - size_t x1 = 0, x2 = 4, x3 = srcStep, x4 = srcStep + 4; - size_t y1 = 0, y2 = 1, y3 = dstStep[0], y4 = dstStep[0] + 1; + UINT32 x; + UINT32 y; + UINT32 i; + size_t x1 = 0; + size_t x2 = 4; + size_t x3 = srcStep; + size_t x4 = srcStep + 4; + size_t y1 = 0; + size_t y2 = 1; + size_t y3 = dstStep[0]; + size_t y4 = dstStep[0] + 1; UINT32 max_x = roi->width - 1; UINT32 max_y = roi->height - 1; @@ -679,8 +703,12 @@ static INLINE pstatus_t general_RGBToYUV420_BGRX(const BYTE* WINPR_RESTRICT pSrc for (x = 0; x < roi->width; x += 2) { - BYTE R, G, B; - INT32 Ra, Ga, Ba; + BYTE R; + BYTE G; + BYTE B; + INT32 Ra; + INT32 Ga; + INT32 Ba; /* row 1, pixel 1 */ Ba = B = *(src + x1 + 0); Ga = G = *(src + x1 + 1); @@ -732,9 +760,17 @@ static INLINE pstatus_t general_RGBToYUV420_RGBX(const BYTE* WINPR_RESTRICT pSrc const UINT32 dstStep[3], const prim_size_t* WINPR_RESTRICT roi) { - UINT32 x, y, i; - size_t x1 = 0, x2 = 4, x3 = srcStep, x4 = srcStep + 4; - size_t y1 = 0, y2 = 1, y3 = dstStep[0], y4 = dstStep[0] + 1; + UINT32 x; + UINT32 y; + UINT32 i; + size_t x1 = 0; + size_t x2 = 4; + size_t x3 = srcStep; + size_t x4 = srcStep + 4; + size_t y1 = 0; + size_t y2 = 1; + size_t y3 = dstStep[0]; + size_t y4 = dstStep[0] + 1; UINT32 max_x = roi->width - 1; UINT32 max_y = roi->height - 1; @@ -747,8 +783,12 @@ static INLINE pstatus_t general_RGBToYUV420_RGBX(const BYTE* WINPR_RESTRICT pSrc for (x = 0; x < roi->width; x += 2) { - BYTE R, G, B; - INT32 Ra, Ga, Ba; + BYTE R; + BYTE G; + BYTE B; + INT32 Ra; + INT32 Ga; + INT32 Ba; /* row 1, pixel 1 */ Ra = R = *(src + x1 + 0); Ga = G = *(src + x1 + 1); @@ -801,9 +841,17 @@ static INLINE pstatus_t general_RGBToYUV420_ANY(const BYTE* WINPR_RESTRICT pSrc, const prim_size_t* WINPR_RESTRICT roi) { const UINT32 bpp = FreeRDPGetBytesPerPixel(srcFormat); - UINT32 x, y, i; - size_t x1 = 0, x2 = bpp, x3 = srcStep, x4 = srcStep + bpp; - size_t y1 = 0, y2 = 1, y3 = dstStep[0], y4 = dstStep[0] + 1; + UINT32 x; + UINT32 y; + UINT32 i; + size_t x1 = 0; + size_t x2 = bpp; + size_t x3 = srcStep; + size_t x4 = srcStep + bpp; + size_t y1 = 0; + size_t y2 = 1; + size_t y3 = dstStep[0]; + size_t y4 = dstStep[0] + 1; UINT32 max_x = roi->width - 1; UINT32 max_y = roi->height - 1; @@ -816,8 +864,12 @@ static INLINE pstatus_t general_RGBToYUV420_ANY(const BYTE* WINPR_RESTRICT pSrc, for (x = 0; x < roi->width; x += 2) { - BYTE R, G, B; - INT32 Ra, Ga, Ba; + BYTE R; + BYTE G; + BYTE B; + INT32 Ra; + INT32 Ga; + INT32 Ba; UINT32 color; /* row 1, pixel 1 */ color = FreeRDPReadColor(src + x1, srcFormat); @@ -902,8 +954,18 @@ static INLINE void general_RGBToAVC444YUV_BGRX_DOUBLE_ROW( for (UINT32 x = 0; x < width; x += 2) { const BOOL lastX = (x + 1) >= width; - BYTE Y1e, Y2e, U1e, V1e, U2e, V2e; - BYTE Y1o, Y2o, U1o, V1o, U2o, V2o; + BYTE Y1e; + BYTE Y2e; + BYTE U1e; + BYTE V1e; + BYTE U2e; + BYTE V2e; + BYTE Y1o; + BYTE Y2o; + BYTE U1o; + BYTE V1o; + BYTE U2o; + BYTE V2o; /* Read 4 pixels, 2 from even, 2 from odd lines */ { const BYTE b = *srcEven++; @@ -1034,8 +1096,18 @@ static INLINE void general_RGBToAVC444YUV_RGBX_DOUBLE_ROW( for (UINT32 x = 0; x < width; x += 2) { const BOOL lastX = (x + 1) >= width; - BYTE Y1e, Y2e, U1e, V1e, U2e, V2e; - BYTE Y1o, Y2o, U1o, V1o, U2o, V2o; + BYTE Y1e; + BYTE Y2e; + BYTE U1e; + BYTE V1e; + BYTE U2e; + BYTE V2e; + BYTE Y1o; + BYTE Y2o; + BYTE U1o; + BYTE V1o; + BYTE U2o; + BYTE V2o; /* Read 4 pixels, 2 from even, 2 from odd lines */ { const BYTE r = *srcEven++; @@ -1166,11 +1238,23 @@ static INLINE void general_RGBToAVC444YUV_ANY_DOUBLE_ROW( for (UINT32 x = 0; x < width; x += 2) { const BOOL lastX = (x + 1) >= width; - BYTE Y1e, Y2e, U1e, V1e, U2e, V2e; - BYTE Y1o, Y2o, U1o, V1o, U2o, V2o; + BYTE Y1e; + BYTE Y2e; + BYTE U1e; + BYTE V1e; + BYTE U2e; + BYTE V2e; + BYTE Y1o; + BYTE Y2o; + BYTE U1o; + BYTE V1o; + BYTE U2o; + BYTE V2o; /* Read 4 pixels, 2 from even, 2 from odd lines */ { - BYTE r, g, b; + BYTE r; + BYTE g; + BYTE b; const UINT32 color = FreeRDPReadColor(srcEven, srcFormat); srcEven += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1181,7 +1265,9 @@ static INLINE void general_RGBToAVC444YUV_ANY_DOUBLE_ROW( if (!lastX) { - BYTE r, g, b; + BYTE r; + BYTE g; + BYTE b; const UINT32 color = FreeRDPReadColor(srcEven, srcFormat); srcEven += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1192,7 +1278,9 @@ static INLINE void general_RGBToAVC444YUV_ANY_DOUBLE_ROW( if (b1Odd) { - BYTE r, g, b; + BYTE r; + BYTE g; + BYTE b; const UINT32 color = FreeRDPReadColor(srcOdd, srcFormat); srcOdd += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1203,7 +1291,9 @@ static INLINE void general_RGBToAVC444YUV_ANY_DOUBLE_ROW( if (b1Odd && !lastX) { - BYTE r, g, b; + BYTE r; + BYTE g; + BYTE b; const UINT32 color = FreeRDPReadColor(srcOdd, srcFormat); srcOdd += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1394,12 +1484,22 @@ static INLINE void general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW( for (UINT32 x = 0; x < width; x += 2) { - BYTE Ya, Ua, Va; - BYTE Yb, Ub, Vb; - BYTE Yc, Uc, Vc; - BYTE Yd, Ud, Vd; + BYTE Ya; + BYTE Ua; + BYTE Va; + BYTE Yb; + BYTE Ub; + BYTE Vb; + BYTE Yc; + BYTE Uc; + BYTE Vc; + BYTE Yd; + BYTE Ud; + BYTE Vd; { - BYTE b, g, r; + BYTE b; + BYTE g; + BYTE r; const UINT32 color = FreeRDPReadColor(srcEven, srcFormat); srcEven += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1410,7 +1510,9 @@ static INLINE void general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW( if (x < width - 1) { - BYTE b, g, r; + BYTE b; + BYTE g; + BYTE r; const UINT32 color = FreeRDPReadColor(srcEven, srcFormat); srcEven += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1427,7 +1529,9 @@ static INLINE void general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW( if (srcOdd) { - BYTE b, g, r; + BYTE b; + BYTE g; + BYTE r; const UINT32 color = FreeRDPReadColor(srcOdd, srcFormat); srcOdd += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1444,7 +1548,9 @@ static INLINE void general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW( if (srcOdd && (x < width - 1)) { - BYTE b, g, r; + BYTE b; + BYTE g; + BYTE r; const UINT32 color = FreeRDPReadColor(srcOdd, srcFormat); srcOdd += bpp; FreeRDPSplitColor(color, srcFormat, &r, &g, &b, NULL, NULL); @@ -1601,10 +1707,18 @@ static INLINE void general_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( { for (UINT32 x = 0; x < width; x += 2) { - BYTE Ya, Ua, Va; - BYTE Yb, Ub, Vb; - BYTE Yc, Uc, Vc; - BYTE Yd, Ud, Vd; + BYTE Ya; + BYTE Ua; + BYTE Va; + BYTE Yb; + BYTE Ub; + BYTE Vb; + BYTE Yc; + BYTE Uc; + BYTE Vc; + BYTE Yd; + BYTE Ud; + BYTE Vd; { const BYTE b = *srcEven++; const BYTE g = *srcEven++; diff --git a/libfreerdp/primitives/prim_YUV_opencl.c b/libfreerdp/primitives/prim_YUV_opencl.c index 206c3515a..118b1a68d 100644 --- a/libfreerdp/primitives/prim_YUV_opencl.c +++ b/libfreerdp/primitives/prim_YUV_opencl.c @@ -183,7 +183,9 @@ static const char* openclProgram = static BOOL primitives_init_opencl_context(primitives_opencl_context* cl) { cl_platform_id* platform_ids = NULL; - cl_uint ndevices, nplatforms, i; + cl_uint ndevices; + cl_uint nplatforms; + cl_uint i; cl_kernel kernel; cl_int ret; diff --git a/libfreerdp/primitives/prim_YUV_ssse3.c b/libfreerdp/primitives/prim_YUV_ssse3.c index 3e1083e1b..fb0b0e7f4 100644 --- a/libfreerdp/primitives/prim_YUV_ssse3.c +++ b/libfreerdp/primitives/prim_YUV_ssse3.c @@ -90,7 +90,9 @@ static __m128i* ssse3_YUV444Pixel(__m128i* WINPR_RESTRICT dst, __m128i Yraw, __m __m128i BGRX = _mm_and_si128(_mm_loadu_si128(dst), _mm_set_epi32(0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000)); { - __m128i C, D, E; + __m128i C; + __m128i D; + __m128i E; /* Load Y values and expand to 32 bit */ { C = _mm_shuffle_epi8(Yraw, mapY[pos]); /* Reorder and multiply by 256 */ @@ -347,7 +349,10 @@ PRIM_ALIGN_128 static const BYTE rgbx_v_factors[] = { static INLINE void ssse3_RGBToYUV420_BGRX_Y(const BYTE* WINPR_RESTRICT src, BYTE* dst, UINT32 width) { UINT32 x; - __m128i x0, x1, x2, x3; + __m128i x0; + __m128i x1; + __m128i x2; + __m128i x3; const __m128i y_factors = BGRX_Y_FACTORS; const __m128i* argb = (const __m128i*)src; __m128i* ydst = (__m128i*)dst; @@ -388,7 +393,12 @@ static INLINE void ssse3_RGBToYUV420_BGRX_UV(const BYTE* WINPR_RESTRICT src1, const __m128i u_factors = BGRX_U_FACTORS; const __m128i v_factors = BGRX_V_FACTORS; const __m128i vector128 = CONST128_FACTORS; - __m128i x0, x1, x2, x3, x4, x5; + __m128i x0; + __m128i x1; + __m128i x2; + __m128i x3; + __m128i x4; + __m128i x5; const __m128i* rgb1 = (const __m128i*)src1; const __m128i* rgb2 = (const __m128i*)src2; __m64* udst = (__m64*)dst1; @@ -564,7 +574,8 @@ static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW( * * We need to split these according to * 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */ - __m128i ue, uo = { 0 }; + __m128i ue; + __m128i uo = { 0 }; { const __m128i ue1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, u_factors), @@ -641,7 +652,8 @@ static INLINE void ssse3_RGBToAVC444YUV_BGRX_DOUBLE_ROW( * * We need to split these according to * 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */ - __m128i ve, vo = { 0 }; + __m128i ve; + __m128i vo = { 0 }; { const __m128i ve1 = _mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, v_factors), @@ -847,7 +859,9 @@ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( * We need to split these according to * 3.3.8.3.3 YUV420p Stream Combination for YUV444v2 mode */ /* U: multiplications with subtotals and horizontal sums */ - __m128i ue, uo, uavg; + __m128i ue; + __m128i uo; + __m128i uavg; { const __m128i u_factors = BGRX_U_FACTORS; const __m128i ue1 = @@ -936,7 +950,9 @@ static INLINE void ssse3_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( { /* V: multiplications with subtotals and horizontal sums */ - __m128i ve, vo, vavg; + __m128i ve; + __m128i vo; + __m128i vavg; { const __m128i v_factors = BGRX_V_FACTORS; const __m128i ve1 = @@ -1086,7 +1102,8 @@ static pstatus_t ssse3_LumaToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[], const UINT32 srcStep[], BYTE* WINPR_RESTRICT pDstRaw[], const UINT32 dstStep[], const RECTANGLE_16* WINPR_RESTRICT roi) { - UINT32 x, y; + UINT32 x; + UINT32 y; const UINT32 nWidth = roi->right - roi->left; const UINT32 nHeight = roi->bottom - roi->top; const UINT32 halfWidth = (nWidth + 1) / 2; @@ -1200,7 +1217,8 @@ static pstatus_t ssse3_ChromaFilter(BYTE* WINPR_RESTRICT pDst[], const UINT32 ds const UINT32 halfHeight = (nHeight + 1) / 2; const UINT32 halfWidth = (nWidth + 1) / 2; const UINT32 halfPad = halfWidth % 16; - UINT32 x, y; + UINT32 x; + UINT32 y; /* Filter */ for (y = roi->top; y < halfHeight + roi->top; y++) @@ -1253,7 +1271,8 @@ static pstatus_t ssse3_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw const UINT32 mod = 16; UINT32 uY = 0; UINT32 vY = 0; - UINT32 x, y; + UINT32 x; + UINT32 y; const UINT32 nWidth = roi->right - roi->left; const UINT32 nHeight = roi->bottom - roi->top; const UINT32 halfWidth = (nWidth + 1) / 2; @@ -1349,7 +1368,8 @@ static pstatus_t ssse3_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[3] const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) { - UINT32 x, y; + UINT32 x; + UINT32 y; const UINT32 nWidth = roi->right - roi->left; const UINT32 nHeight = roi->bottom - roi->top; const UINT32 halfWidth = (nWidth + 1) / 2; diff --git a/libfreerdp/primitives/prim_alphaComp.c b/libfreerdp/primitives/prim_alphaComp.c index f4cde2a7a..92536ecee 100644 --- a/libfreerdp/primitives/prim_alphaComp.c +++ b/libfreerdp/primitives/prim_alphaComp.c @@ -70,7 +70,8 @@ static pstatus_t general_alphaComp_argb(const BYTE* pSrc1, UINT32 src1Step, cons * I'm not sure who first designed the double-ops trick * (Red Blue and Alpha Green). */ - UINT32 rb, ag; + UINT32 rb; + UINT32 ag; UINT32 s2rb = src2 & 0x00FF00FFU; UINT32 s2ag = (src2 >> 8) & 0x00FF00FFU; UINT32 s1rb = src1 & 0x00FF00FFU; diff --git a/libfreerdp/primitives/prim_alphaComp_opt.c b/libfreerdp/primitives/prim_alphaComp_opt.c index cc836babd..a6e0fc919 100644 --- a/libfreerdp/primitives/prim_alphaComp_opt.c +++ b/libfreerdp/primitives/prim_alphaComp_opt.c @@ -51,9 +51,13 @@ static pstatus_t sse2_alphaComp_argb(const BYTE* WINPR_RESTRICT pSrc1, UINT32 sr const UINT32* sptr1 = (const UINT32*)pSrc1; const UINT32* sptr2 = (const UINT32*)pSrc2; UINT32* dptr; - int linebytes, src1Jump, src2Jump, dstJump; + int linebytes; + int src1Jump; + int src2Jump; + int dstJump; UINT32 y; - __m128i xmm0, xmm1; + __m128i xmm0; + __m128i xmm1; if ((width <= 0) || (height <= 0)) return PRIMITIVES_SUCCESS; @@ -125,7 +129,12 @@ static pstatus_t sse2_alphaComp_argb(const BYTE* WINPR_RESTRICT pSrc1, UINT32 sr while (count--) { - __m128i xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; + __m128i xmm2; + __m128i xmm3; + __m128i xmm4; + __m128i xmm5; + __m128i xmm6; + __m128i xmm7; /* BdGdRdAdBcGcRcAcBbGbRbAbBaGaRaAa */ xmm2 = LOAD_SI128(sptr1); sptr1 += 4; diff --git a/libfreerdp/primitives/prim_colors.c b/libfreerdp/primitives/prim_colors.c index 328252589..e587049b3 100644 --- a/libfreerdp/primitives/prim_colors.c +++ b/libfreerdp/primitives/prim_colors.c @@ -34,7 +34,8 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_R UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) { - UINT32 x, y; + UINT32 x; + UINT32 y; BYTE* pRGB = pDst; const INT16* pY = pSrc[0]; const INT16* pCb = pSrc[1]; @@ -47,7 +48,9 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_R { for (x = 0; x < roi->width; x++) { - INT16 R, G, B; + INT16 R; + INT16 G; + INT16 B; const INT32 divisor = 16; const INT32 Y = (INT32)((UINT32)((*pY++) + 4096) << divisor); const INT32 Cb = (*pCb++); @@ -76,7 +79,8 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general(const INT16* const WINP UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) { - UINT32 x, y; + UINT32 x; + UINT32 y; BYTE* pRGB = pDst; const INT16* pY = pSrc[0]; const INT16* pCb = pSrc[1]; @@ -90,7 +94,9 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general(const INT16* const WINP { for (x = 0; x < roi->width; x++) { - INT64 R, G, B; + INT64 R; + INT64 G; + INT64 B; const INT32 divisor = 16; const INT32 Y = (INT32)((UINT32)((*pY++) + 4096) << divisor); const INT32 Cb = (*pCb++); @@ -172,7 +178,9 @@ general_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], INT32 INT32 cy = (INT32)(*yptr++); INT32 cb = (INT32)(*cbptr++); INT32 cr = (INT32)(*crptr++); - INT64 r, g, b; + INT64 r; + INT64 g; + INT64 b; /* * This is the slow floating point version kept here for reference. * y = y + 4096; // 128<<5=4096 so that we can scale the sum by>>5 diff --git a/libfreerdp/primitives/prim_colors_opt.c b/libfreerdp/primitives/prim_colors_opt.c index ebcea9671..4cd6b6ca2 100644 --- a/libfreerdp/primitives/prim_colors_opt.c +++ b/libfreerdp/primitives/prim_colors_opt.c @@ -70,11 +70,23 @@ sse2_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcSt INT16* WINPR_RESTRICT pDst[3], int dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { - __m128i zero, max, r_cr, g_cb, g_cr, b_cb, c4096; - const __m128i *y_buf, *cb_buf, *cr_buf; - __m128i *r_buf, *g_buf, *b_buf; + __m128i zero; + __m128i max; + __m128i r_cr; + __m128i g_cb; + __m128i g_cr; + __m128i b_cb; + __m128i c4096; + const __m128i* y_buf; + const __m128i* cb_buf; + const __m128i* cr_buf; + __m128i* r_buf; + __m128i* g_buf; + __m128i* b_buf; UINT32 yp; - int srcbump, dstbump, imax; + int srcbump; + int dstbump; + int imax; if (((ULONG_PTR)(pSrc[0]) & 0x0f) || ((ULONG_PTR)(pSrc[1]) & 0x0f) || ((ULONG_PTR)(pSrc[2]) & 0x0f) || ((ULONG_PTR)(pDst[0]) & 0x0f) || @@ -152,7 +164,12 @@ sse2_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcSt * r = ((y+4096)>>2 + HIWORD(cr*22986)) >> 3 */ /* y = (y_r_buf[i] + 4096) >> 2 */ - __m128i y, cb, cr, r, g, b; + __m128i y; + __m128i cb; + __m128i cr; + __m128i r; + __m128i g; + __m128i b; y = _mm_load_si128(y_buf + i); y = _mm_add_epi16(y, c4096); y = _mm_srai_epi16(y, 2); @@ -264,7 +281,18 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_RESTRICT pSrc[3], UIN * r = ((y+4096)>>2 + HIWORD(cr*22986)) >> 3 */ /* y = (y_r_buf[i] + 4096) >> 2 */ - __m128i y1, y2, cb1, cb2, cr1, cr2, r1, r2, g1, g2, b1, b2; + __m128i y1; + __m128i y2; + __m128i cb1; + __m128i cb2; + __m128i cr1; + __m128i cr2; + __m128i r1; + __m128i r2; + __m128i g1; + __m128i g2; + __m128i b1; + __m128i b2; y1 = _mm_load_si128((const __m128i*)y_buf); y_buf += step; y1 = _mm_add_epi16(y1, c4096); @@ -318,7 +346,11 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_RESTRICT pSrc[3], UIN /* b_buf[i] = CLIP(b); */ _mm_between_epi16(b2, zero, max); { - __m128i R0, R1, R2, R3, R4; + __m128i R0; + __m128i R1; + __m128i R2; + __m128i R3; + __m128i R4; /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ @@ -452,7 +484,18 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* const WINPR_RESTRICT pSrc[3], UIN * r = ((y+4096)>>2 + HIWORD(cr*22986)) >> 3 */ /* y = (y_r_buf[i] + 4096) >> 2 */ - __m128i y1, y2, cb1, cb2, cr1, cr2, r1, r2, g1, g2, b1, b2; + __m128i y1; + __m128i y2; + __m128i cb1; + __m128i cb2; + __m128i cr1; + __m128i cr2; + __m128i r1; + __m128i r2; + __m128i g1; + __m128i g2; + __m128i b1; + __m128i b2; y1 = _mm_load_si128((const __m128i*)y_buf); y_buf += step; y1 = _mm_add_epi16(y1, c4096); @@ -506,7 +549,11 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* const WINPR_RESTRICT pSrc[3], UIN /* b_buf[i] = CLIP(b); */ _mm_between_epi16(b2, zero, max); { - __m128i R0, R1, R2, R3, R4; + __m128i R0; + __m128i R1; + __m128i R2; + __m128i R3; + __m128i R4; /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ @@ -603,7 +650,17 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcSt INT16* WINPR_RESTRICT pDst[3], int dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { - __m128i min, max, y_r, y_g, y_b, cb_r, cb_g, cb_b, cr_r, cr_g, cr_b; + __m128i min; + __m128i max; + __m128i y_r; + __m128i y_g; + __m128i y_b; + __m128i cb_r; + __m128i cb_g; + __m128i cb_b; + __m128i cr_r; + __m128i cr_g; + __m128i cr_b; const __m128i* r_buf = (const __m128i*)(pSrc[0]); const __m128i* g_buf = (const __m128i*)(pSrc[1]); const __m128i* b_buf = (const __m128i*)(pSrc[2]); @@ -611,7 +668,9 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcSt __m128i* cb_buf = (__m128i*)(pDst[1]); __m128i* cr_buf = (__m128i*)(pDst[2]); UINT32 yp; - int srcbump, dstbump, imax; + int srcbump; + int dstbump; + int imax; if (((ULONG_PTR)(pSrc[0]) & 0x0f) || ((ULONG_PTR)(pSrc[1]) & 0x0f) || ((ULONG_PTR)(pSrc[2]) & 0x0f) || ((ULONG_PTR)(pDst[0]) & 0x0f) || @@ -679,7 +738,12 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcSt * within the upper 16 bits we will also have to scale the RGB * values used in the multiplication by << 5+(16-n). */ - __m128i r, g, b, y, cb, cr; + __m128i r; + __m128i g; + __m128i b; + __m128i y; + __m128i cb; + __m128i cr; r = _mm_load_si128(r_buf + i); g = _mm_load_si128(g_buf + i); b = _mm_load_si128(b_buf + i); @@ -736,7 +800,9 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( const UINT32 pad = roi->width % 16; const __m128i a = _mm_set1_epi32(0xFFFFFFFFU); BYTE* out; - UINT32 srcbump, dstbump, y; + UINT32 srcbump; + UINT32 dstbump; + UINT32 y; out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -747,12 +813,15 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( for (x = 0; x < roi->width - pad; x += 16) { - __m128i r, g, b; + __m128i r; + __m128i g; + __m128i b; /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pb); pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((const __m128i*)pb); @@ -760,7 +829,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pg); pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((const __m128i*)pg); @@ -768,7 +838,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pr); pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((const __m128i*)pr); @@ -776,7 +847,10 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { - __m128i gbHi, gbLo, arHi, arLo; + __m128i gbHi; + __m128i gbLo; + __m128i arHi; + __m128i arLo; { gbLo = _mm_unpacklo_epi8(b, g); /* R0 = G7G6G5G4G3G2G1G0 */ gbHi = _mm_unpackhi_epi8(b, g); /* R1 = G7B7G6B7G5B5G4B4 */ @@ -840,7 +914,9 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( const UINT32 pad = roi->width % 16; const __m128i a = _mm_set1_epi32(0xFFFFFFFFU); BYTE* out; - UINT32 srcbump, dstbump, y; + UINT32 srcbump; + UINT32 dstbump; + UINT32 y; out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -851,12 +927,15 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( for (x = 0; x < roi->width - pad; x += 16) { - __m128i r, g, b; + __m128i r; + __m128i g; + __m128i b; /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pb); pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((const __m128i*)pb); @@ -864,7 +943,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pg); pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((const __m128i*)pg); @@ -872,7 +952,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pr); pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((const __m128i*)pr); @@ -880,7 +961,10 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { - __m128i gbHi, gbLo, arHi, arLo; + __m128i gbHi; + __m128i gbLo; + __m128i arHi; + __m128i arLo; { gbLo = _mm_unpacklo_epi8(r, g); /* R0 = G7G6G5G4G3G2G1G0 */ gbHi = _mm_unpackhi_epi8(r, g); /* R1 = G7B7G6B7G5B5G4B4 */ @@ -944,7 +1028,9 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( const UINT32 pad = roi->width % 16; const __m128i a = _mm_set1_epi32(0xFFFFFFFFU); BYTE* out; - UINT32 srcbump, dstbump, y; + UINT32 srcbump; + UINT32 dstbump; + UINT32 y; out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -955,12 +1041,15 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( for (x = 0; x < roi->width - pad; x += 16) { - __m128i r, g, b; + __m128i r; + __m128i g; + __m128i b; /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pb); pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((const __m128i*)pb); @@ -968,7 +1057,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pg); pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((const __m128i*)pg); @@ -976,7 +1066,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pr); pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((const __m128i*)pr); @@ -984,7 +1075,10 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { - __m128i gbHi, gbLo, arHi, arLo; + __m128i gbHi; + __m128i gbLo; + __m128i arHi; + __m128i arLo; { gbLo = _mm_unpacklo_epi8(a, b); /* R0 = G7G6G5G4G3G2G1G0 */ gbHi = _mm_unpackhi_epi8(a, b); /* R1 = G7B7G6B7G5B5G4B4 */ @@ -1048,7 +1142,9 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( const __m128i a = _mm_set1_epi32(0xFFFFFFFFU); const UINT32 pad = roi->width % 16; BYTE* out; - UINT32 srcbump, dstbump, y; + UINT32 srcbump; + UINT32 dstbump; + UINT32 y; out = (BYTE*)pDst; srcbump = (srcStep - (roi->width * sizeof(UINT16))) / sizeof(UINT16); dstbump = (dstStep - (roi->width * sizeof(UINT32))); @@ -1059,12 +1155,15 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( for (x = 0; x < roi->width - pad; x += 16) { - __m128i r, g, b; + __m128i r; + __m128i g; + __m128i b; /* The comments below pretend these are 8-byte registers * rather than 16-byte, for readability. */ { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pb); pb += 8; /* R0 = 00B300B200B100B0 */ R1 = _mm_load_si128((const __m128i*)pb); @@ -1072,7 +1171,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( b = _mm_packus_epi16(R0, R1); /* b = B7B6B5B4B3B2B1B0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pg); pg += 8; /* R1 = 00G300G200G100G0 */ R1 = _mm_load_si128((const __m128i*)pg); @@ -1080,7 +1180,8 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( g = _mm_packus_epi16(R0, R1); /* g = G7G6G5G4G3G2G1G0 */ } { - __m128i R0, R1; + __m128i R0; + __m128i R1; R0 = _mm_load_si128((const __m128i*)pr); pr += 8; /* R0 = 00R300R200R100R0 */ R1 = _mm_load_si128((const __m128i*)pr); @@ -1088,7 +1189,10 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( r = _mm_packus_epi16(R0, R1); /* r = R7R6R5R4R3R2R1R0 */ } { - __m128i gbHi, gbLo, arHi, arLo; + __m128i gbHi; + __m128i gbLo; + __m128i arHi; + __m128i arLo; { gbLo = _mm_unpacklo_epi8(a, r); /* R0 = G7G6G5G4G3G2G1G0 */ gbHi = _mm_unpackhi_epi8(a, r); /* R1 = G7B7G6B7G5B5G4B4 */ diff --git a/libfreerdp/primitives/prim_set.c b/libfreerdp/primitives/prim_set.c index d0110b31f..810c5b87a 100644 --- a/libfreerdp/primitives/prim_set.c +++ b/libfreerdp/primitives/prim_set.c @@ -41,7 +41,8 @@ static pstatus_t general_zero(void* pDst, size_t len) static pstatus_t general_set_32s(INT32 val, INT32* pDst, UINT32 len) { INT32* dptr = (INT32*)pDst; - size_t span, remaining; + size_t span; + size_t remaining; primitives_t* prims; if (len < 256) @@ -77,7 +78,8 @@ static pstatus_t general_set_32s(INT32 val, INT32* pDst, UINT32 len) static pstatus_t general_set_32u(UINT32 val, UINT32* pDst, UINT32 len) { UINT32* dptr = (UINT32*)pDst; - size_t span, remaining; + size_t span; + size_t remaining; primitives_t* prims; if (len < 256) diff --git a/libfreerdp/primitives/prim_set_opt.c b/libfreerdp/primitives/prim_set_opt.c index 52c5de343..685de60b5 100644 --- a/libfreerdp/primitives/prim_set_opt.c +++ b/libfreerdp/primitives/prim_set_opt.c @@ -37,7 +37,8 @@ static primitives_t* generic = NULL; #if !defined(WITH_IPP) || defined(ALL_PRIMITIVES_VERSIONS) static pstatus_t sse2_set_8u(BYTE val, BYTE* WINPR_RESTRICT pDst, UINT32 len) { - BYTE byte, *dptr; + BYTE byte; + BYTE* dptr; __m128i xmm0; size_t count; diff --git a/libfreerdp/primitives/prim_sign_opt.c b/libfreerdp/primitives/prim_sign_opt.c index 0b2cb4372..f25e90a0b 100644 --- a/libfreerdp/primitives/prim_sign_opt.c +++ b/libfreerdp/primitives/prim_sign_opt.c @@ -67,7 +67,14 @@ static pstatus_t ssse3_sign_16s(const INT16* WINPR_RESTRICT pSrc, INT16* WINPR_R /* Unaligned */ while (count--) { - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; + __m128i xmm0; + __m128i xmm1; + __m128i xmm2; + __m128i xmm3; + __m128i xmm4; + __m128i xmm5; + __m128i xmm6; + __m128i xmm7; xmm0 = _mm_set1_epi16(0x0001U); xmm1 = _mm_set1_epi16(0x0001U); xmm2 = _mm_set1_epi16(0x0001U); @@ -99,7 +106,14 @@ static pstatus_t ssse3_sign_16s(const INT16* WINPR_RESTRICT pSrc, INT16* WINPR_R /* Aligned */ while (count--) { - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; + __m128i xmm0; + __m128i xmm1; + __m128i xmm2; + __m128i xmm3; + __m128i xmm4; + __m128i xmm5; + __m128i xmm6; + __m128i xmm7; xmm0 = _mm_set1_epi16(0x0001U); xmm1 = _mm_set1_epi16(0x0001U); xmm2 = _mm_set1_epi16(0x0001U); diff --git a/libfreerdp/primitives/prim_templates.h b/libfreerdp/primitives/prim_templates.h index 02b64fff2..5ab85a8e8 100644 --- a/libfreerdp/primitives/prim_templates.h +++ b/libfreerdp/primitives/prim_templates.h @@ -87,22 +87,21 @@ { \ while (count--) \ { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm0 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm1 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm1 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm2 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm3 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm4 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm5 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm5 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm6 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm6 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm7 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm7 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ xmm0 = _op_(xmm0, val); \ xmm1 = _op_(xmm1, val); \ @@ -134,22 +133,21 @@ { \ while (count--) \ { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm0 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm1 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm1 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm2 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm2 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm3 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm3 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm4 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm4 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm5 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm5 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm6 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm6 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm7 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm7 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ xmm0 = _op_(xmm0, val); \ xmm1 = _op_(xmm1, val); \ @@ -242,14 +240,13 @@ { \ while (count--) \ { \ - __m128i xmm1, xmm2, xmm3, xmm4; \ - xmm1 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm1 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm2 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm3 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((const __m128i*)sptr); \ + __m128i xmm4 = _mm_lddqu_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ xmm1 = _op_(xmm1, xmm0); \ xmm2 = _op_(xmm2, xmm0); \ @@ -269,14 +266,13 @@ { \ while (count--) \ { \ - __m128i xmm1, xmm2, xmm3, xmm4; \ - xmm1 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm1 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm2 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm2 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm3 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm3 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ - xmm4 = _mm_load_si128((const __m128i*)sptr); \ + __m128i xmm4 = _mm_load_si128((const __m128i*)sptr); \ sptr += (16 / sizeof(_type_)); \ xmm1 = _op_(xmm1, xmm0); \ xmm2 = _op_(xmm2, xmm0); \ @@ -359,22 +355,21 @@ /* Unaligned loads */ \ while (count--) \ { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_lddqu_si128((const __m128i*)sptr1); \ + __m128i xmm0 = _mm_lddqu_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm1 = _mm_lddqu_si128((const __m128i*)sptr1); \ + __m128i xmm1 = _mm_lddqu_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm2 = _mm_lddqu_si128((const __m128i*)sptr1); \ + __m128i xmm2 = _mm_lddqu_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm3 = _mm_lddqu_si128((const __m128i*)sptr1); \ + __m128i xmm3 = _mm_lddqu_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm4 = _mm_lddqu_si128((const __m128i*)sptr2); \ + __m128i xmm4 = _mm_lddqu_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ - xmm5 = _mm_lddqu_si128((const __m128i*)sptr2); \ + __m128i xmm5 = _mm_lddqu_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ - xmm6 = _mm_lddqu_si128((const __m128i*)sptr2); \ + __m128i xmm6 = _mm_lddqu_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ - xmm7 = _mm_lddqu_si128((const __m128i*)sptr2); \ + __m128i xmm7 = _mm_lddqu_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ xmm0 = _op_(xmm0, xmm4); \ xmm1 = _op_(xmm1, xmm5); \ @@ -395,22 +390,21 @@ /* Aligned loads */ \ while (count--) \ { \ - __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7; \ - xmm0 = _mm_load_si128((const __m128i*)sptr1); \ + __m128i xmm0 = _mm_load_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm1 = _mm_load_si128((const __m128i*)sptr1); \ + __m128i xmm1 = _mm_load_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm2 = _mm_load_si128((const __m128i*)sptr1); \ + __m128i xmm2 = _mm_load_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm3 = _mm_load_si128((const __m128i*)sptr1); \ + __m128i xmm3 = _mm_load_si128((const __m128i*)sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm4 = _mm_load_si128((const __m128i*)sptr2); \ + __m128i xmm4 = _mm_load_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ - xmm5 = _mm_load_si128((const __m128i*)sptr2); \ + __m128i xmm5 = _mm_load_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ - xmm6 = _mm_load_si128((const __m128i*)sptr2); \ + __m128i xmm6 = _mm_load_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ - xmm7 = _mm_load_si128((const __m128i*)sptr2); \ + __m128i xmm7 = _mm_load_si128((const __m128i*)sptr2); \ sptr2 += (16 / sizeof(_type_)); \ xmm0 = _op_(xmm0, xmm4); \ xmm1 = _op_(xmm1, xmm5); \ @@ -431,10 +425,9 @@ len -= count << (5 - shifts); \ while (count--) \ { \ - __m128i xmm0, xmm1; \ - xmm0 = LOAD_SI128(sptr1); \ + __m128i xmm0 = LOAD_SI128(sptr1); \ sptr1 += (16 / sizeof(_type_)); \ - xmm1 = LOAD_SI128(sptr2); \ + __m128i xmm1 = LOAD_SI128(sptr2); \ sptr2 += (16 / sizeof(_type_)); \ xmm0 = _op_(xmm0, xmm1); \ _mm_store_si128((__m128i*)dptr, xmm0); \ diff --git a/libfreerdp/primitives/test/TestPrimitivesAdd.c b/libfreerdp/primitives/test/TestPrimitivesAdd.c index a81af5b06..08120e7df 100644 --- a/libfreerdp/primitives/test/TestPrimitivesAdd.c +++ b/libfreerdp/primitives/test/TestPrimitivesAdd.c @@ -23,9 +23,10 @@ static BOOL test_add16s_func(void) { pstatus_t status; - INT16 ALIGN(src1[FUNC_TEST_SIZE + 3]) = { 0 }, ALIGN(src2[FUNC_TEST_SIZE + 3]) = { 0 }, - ALIGN(d1[FUNC_TEST_SIZE + 3]) = { 0 }, - ALIGN(d2[FUNC_TEST_SIZE + 3]) = { 0 }; + INT16 ALIGN(src1[FUNC_TEST_SIZE + 3]) = { 0 }; + INT16 ALIGN(src2[FUNC_TEST_SIZE + 3]) = { 0 }; + INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]) = { 0 }; + INT16 ALIGN(d2[FUNC_TEST_SIZE + 3]) = { 0 }; winpr_RAND(src1, sizeof(src1)); winpr_RAND(src2, sizeof(src2)); @@ -44,8 +45,9 @@ static BOOL test_add16s_func(void) /* ------------------------------------------------------------------------- */ static BOOL test_add16s_speed(void) { - BYTE ALIGN(src1[MAX_TEST_SIZE + 3]), ALIGN(src2[MAX_TEST_SIZE + 3]), - ALIGN(dst[MAX_TEST_SIZE + 3]); + BYTE ALIGN(src1[MAX_TEST_SIZE + 3]); + BYTE ALIGN(src2[MAX_TEST_SIZE + 3]); + BYTE ALIGN(dst[MAX_TEST_SIZE + 3]); if (!g_TestPrimitivesPerformance) return TRUE; diff --git a/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c b/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c index 9b720a3fd..3d4fc004d 100644 --- a/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c +++ b/libfreerdp/primitives/test/TestPrimitivesAlphaComp.c @@ -63,7 +63,8 @@ static UINT32 alpha_add(UINT32 c1, UINT32 c2) /* ------------------------------------------------------------------------- */ static UINT32 colordist(UINT32 c1, UINT32 c2) { - int d, maxd = 0; + int d; + int maxd = 0; d = ABS((INT32)(ALF(c1) - ALF(c2))); if (d > maxd) @@ -91,7 +92,8 @@ static UINT32 colordist(UINT32 c1, UINT32 c2) static BOOL check(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, UINT32 src2Step, BYTE* pDst, UINT32 dstStep, UINT32 width, UINT32 height) { - UINT32 x, y; + UINT32 x; + UINT32 y; for (y = 0; y < height; ++y) { diff --git a/libfreerdp/primitives/test/TestPrimitivesColors.c b/libfreerdp/primitives/test/TestPrimitivesColors.c index 9ae0ba83c..e5399000e 100644 --- a/libfreerdp/primitives/test/TestPrimitivesColors.c +++ b/libfreerdp/primitives/test/TestPrimitivesColors.c @@ -125,7 +125,9 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_speed(void) INT16** pv; } cnv; const prim_size_t roi64x64 = { 64, 64 }; - INT16 ALIGN(r[4096 + 1]), ALIGN(g[4096 + 1]), ALIGN(b[4096 + 1]); + INT16 ALIGN(r[4096 + 1]); + INT16 ALIGN(g[4096 + 1]); + INT16 ALIGN(b[4096 + 1]); UINT32 ALIGN(dst[4096 + 1]); int i; INT16* ptrs[3]; @@ -163,9 +165,15 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_speed(void) static BOOL test_yCbCrToRGB_16s16s_P3P3_func(void) { pstatus_t status; - INT16 ALIGN(y[4096]) = { 0 }, ALIGN(cb[4096]) = { 0 }, ALIGN(cr[4096]) = { 0 }; - INT16 ALIGN(r1[4096]) = { 0 }, ALIGN(g1[4096]) = { 0 }, ALIGN(b1[4096]) = { 0 }; - INT16 ALIGN(r2[4096]) = { 0 }, ALIGN(g2[4096]) = { 0 }, ALIGN(b2[4096]) = { 0 }; + INT16 ALIGN(y[4096]) = { 0 }; + INT16 ALIGN(cb[4096]) = { 0 }; + INT16 ALIGN(cr[4096]) = { 0 }; + INT16 ALIGN(r1[4096]) = { 0 }; + INT16 ALIGN(g1[4096]) = { 0 }; + INT16 ALIGN(b1[4096]) = { 0 }; + INT16 ALIGN(r2[4096]) = { 0 }; + INT16 ALIGN(g2[4096]) = { 0 }; + INT16 ALIGN(b2[4096]) = { 0 }; int i; const INT16* in[3]; INT16* out1[3]; @@ -220,8 +228,12 @@ static BOOL test_yCbCrToRGB_16s16s_P3P3_func(void) static int test_yCbCrToRGB_16s16s_P3P3_speed(void) { prim_size_t roi = { 64, 64 }; - INT16 ALIGN(y[4096]), ALIGN(cb[4096]), ALIGN(cr[4096]); - INT16 ALIGN(r[4096]), ALIGN(g[4096]), ALIGN(b[4096]); + INT16 ALIGN(y[4096]); + INT16 ALIGN(cb[4096]); + INT16 ALIGN(cr[4096]); + INT16 ALIGN(r[4096]); + INT16 ALIGN(g[4096]); + INT16 ALIGN(b[4096]); int i; const INT16* input[3]; INT16* output[3]; diff --git a/libfreerdp/primitives/test/TestPrimitivesCopy.c b/libfreerdp/primitives/test/TestPrimitivesCopy.c index 6b216a8c2..59b3f4034 100644 --- a/libfreerdp/primitives/test/TestPrimitivesCopy.c +++ b/libfreerdp/primitives/test/TestPrimitivesCopy.c @@ -24,7 +24,8 @@ static BOOL test_copy8u_func(void) { primitives_t* prims = primitives_get(); BYTE ALIGN(data[COPY_TESTSIZE + 15]) = { 0 }; - int i, soff; + int i; + int soff; winpr_RAND(data, sizeof(data)); for (soff = 0; soff < 16; ++soff) diff --git a/libfreerdp/primitives/test/TestPrimitivesShift.c b/libfreerdp/primitives/test/TestPrimitivesShift.c index 3bbb6d573..babc732eb 100644 --- a/libfreerdp/primitives/test/TestPrimitivesShift.c +++ b/libfreerdp/primitives/test/TestPrimitivesShift.c @@ -338,7 +338,8 @@ static BOOL test_ShiftWrapper_16u_func(void) static BOOL test_lShift_16s_speed(void) { UINT32 val; - INT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); + INT16 ALIGN(src[MAX_TEST_SIZE + 1]); + INT16 ALIGN(dst[MAX_TEST_SIZE + 1]); winpr_RAND(src, sizeof(src)); winpr_RAND(&val, sizeof(val)); @@ -358,7 +359,8 @@ static BOOL test_lShift_16s_speed(void) static BOOL test_lShift_16u_speed(void) { UINT32 val; - UINT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); + UINT16 ALIGN(src[MAX_TEST_SIZE + 1]); + UINT16 ALIGN(dst[MAX_TEST_SIZE + 1]); winpr_RAND(&val, sizeof(val)); winpr_RAND(src, sizeof(src)); @@ -378,7 +380,8 @@ static BOOL test_lShift_16u_speed(void) static BOOL test_rShift_16s_speed(void) { UINT32 val; - INT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); + INT16 ALIGN(src[MAX_TEST_SIZE + 1]); + INT16 ALIGN(dst[MAX_TEST_SIZE + 1]); winpr_RAND(src, sizeof(src)); winpr_RAND(&val, sizeof(val)); @@ -398,7 +401,8 @@ static BOOL test_rShift_16s_speed(void) static BOOL test_rShift_16u_speed(void) { UINT32 val; - UINT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); + UINT16 ALIGN(src[MAX_TEST_SIZE + 1]); + UINT16 ALIGN(dst[MAX_TEST_SIZE + 1]); winpr_RAND(&val, sizeof(val)); winpr_RAND(src, sizeof(src)); diff --git a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c index c9ee1f5f6..0c9ca9e20 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYCbCr.c +++ b/libfreerdp/primitives/test/TestPrimitivesYCbCr.c @@ -1533,8 +1533,12 @@ static int test_bmp_cmp_dump(const BYTE* actual, const BYTE* expected, int size, const INT16 Cr = TEST_CR_COMPONENT[index]; const int x = index % 64; const int y = (index - x) / 64; - BYTE R, G, B; - BYTE eR, eG, eB; + BYTE R; + BYTE G; + BYTE B; + BYTE eR; + BYTE eG; + BYTE eB; FreeRDPSplitColor(pixel, PIXEL_FORMAT_XRGB32, &R, &G, &B, NULL, NULL); FreeRDPSplitColor(ePixel, PIXEL_FORMAT_XRGB32, &eR, &eG, &eB, NULL, NULL); diff --git a/libfreerdp/primitives/test/TestPrimitivesYCoCg.c b/libfreerdp/primitives/test/TestPrimitivesYCoCg.c index 8bece4874..c7edb434b 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYCoCg.c +++ b/libfreerdp/primitives/test/TestPrimitivesYCoCg.c @@ -29,7 +29,8 @@ static BOOL test_YCoCgRToRGB_8u_AC4R_func(UINT32 width, UINT32 height) BYTE* out_sse = NULL; BYTE* in = NULL; BYTE* out_c = NULL; - UINT32 i, x; + UINT32 i; + UINT32 x; const UINT32 srcStride = width * 4; const UINT32 size = srcStride * height; const UINT32 formats[] = { PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_RGBA32, @@ -120,7 +121,8 @@ int TestPrimitivesYCoCg(int argc, char* argv[]) for (x = 0; x < 10; x++) { - UINT32 w, h; + UINT32 w; + UINT32 h; do { diff --git a/libfreerdp/primitives/test/TestPrimitivesYUV.c b/libfreerdp/primitives/test/TestPrimitivesYUV.c index 35fe69386..ccaa0e722 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYUV.c +++ b/libfreerdp/primitives/test/TestPrimitivesYUV.c @@ -46,9 +46,16 @@ static BOOL similarRGB(const BYTE* src, const BYTE* dst, size_t size, UINT32 for for (x = 0; x < size; x++) { const double maxDiff = 4.0; - UINT32 sColor, dColor; - BYTE sR, sG, sB, sA; - BYTE dR, dG, dB, dA; + UINT32 sColor; + UINT32 dColor; + BYTE sR; + BYTE sG; + BYTE sB; + BYTE sA; + BYTE dR; + BYTE dG; + BYTE dB; + BYTE dA; sColor = FreeRDPReadColor(src, format); dColor = FreeRDPReadColor(dst, format); src += bpp; @@ -179,8 +186,11 @@ static BOOL TestPrimitiveYUVCombine(primitives_t* prims, prim_size_t roi) const BYTE** cpv; BYTE** pv; } cnv; - UINT32 x, y, i; - UINT32 awidth, aheight; + UINT32 x; + UINT32 y; + UINT32 i; + UINT32 awidth; + UINT32 aheight; BOOL rc = FALSE; BYTE* luma[3] = { 0 }; BYTE* chroma[3] = { 0 }; @@ -385,14 +395,17 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) BYTE** pv; } cnv; BOOL res = FALSE; - UINT32 x, y; - UINT32 awidth, aheight; + UINT32 x; + UINT32 y; + UINT32 awidth; + UINT32 aheight; BYTE* yuv[3] = { 0 }; UINT32 yuv_step[3]; BYTE* rgb = NULL; BYTE* rgb_dst = NULL; size_t size; - size_t uvsize, uvwidth; + size_t uvsize; + size_t uvwidth; size_t padding = 100 * 16; UINT32 stride; const UINT32 formats[] = { PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_ARGB32, @@ -681,8 +694,11 @@ static BOOL compare_yuv420(BYTE** planesA, BYTE** planesB, UINT32 width, UINT32 static BOOL TestPrimitiveRgbToLumaChroma(primitives_t* prims, prim_size_t roi, UINT32 version) { BOOL res = FALSE; - UINT32 x, y, cnt; - UINT32 awidth, aheight; + UINT32 x; + UINT32 y; + UINT32 cnt; + UINT32 awidth; + UINT32 aheight; BYTE* luma[3] = { 0 }; BYTE* chroma[3] = { 0 }; BYTE* lumaGeneric[3] = { 0 }; @@ -690,10 +706,12 @@ static BOOL TestPrimitiveRgbToLumaChroma(primitives_t* prims, prim_size_t roi, U UINT32 yuv_step[3]; BYTE* rgb = NULL; size_t size; - size_t uvsize, uvwidth; + size_t uvsize; + size_t uvwidth; const size_t padding = 0x1000; UINT32 stride; - __RGBToAVC444YUV_t fkt, gen; + __RGBToAVC444YUV_t fkt; + __RGBToAVC444YUV_t gen; const UINT32 formats[] = { PIXEL_FORMAT_XRGB32, PIXEL_FORMAT_XBGR32, PIXEL_FORMAT_ARGB32, PIXEL_FORMAT_ABGR32, PIXEL_FORMAT_RGBA32, PIXEL_FORMAT_RGBX32, PIXEL_FORMAT_BGRA32, PIXEL_FORMAT_BGRX32 }; diff --git a/libfreerdp/utils/rdpdr_utils.c b/libfreerdp/utils/rdpdr_utils.c index 1a6807044..28cc97f29 100644 --- a/libfreerdp/utils/rdpdr_utils.c +++ b/libfreerdp/utils/rdpdr_utils.c @@ -276,7 +276,8 @@ static void rdpdr_dump_packet(wLog* log, DWORD lvl, wStream* s, const char* cust const size_t gpos = Stream_GetPosition(s); const size_t pos = send ? Stream_GetPosition(s) : Stream_Length(s); - UINT16 component = 0, packetid = 0; + UINT16 component = 0; + UINT16 packetid = 0; Stream_SetPosition(s, 0); @@ -290,7 +291,8 @@ static void rdpdr_dump_packet(wLog* log, DWORD lvl, wStream* s, const char* cust case PAKID_CORE_SERVER_ANNOUNCE: case PAKID_CORE_CLIENTID_CONFIRM: { - UINT16 versionMajor = 0, versionMinor = 0; + UINT16 versionMajor = 0; + UINT16 versionMinor = 0; UINT32 clientID = 0; if (pos >= 6) @@ -337,7 +339,10 @@ static void rdpdr_dump_packet(wLog* log, DWORD lvl, wStream* s, const char* cust case PAKID_CORE_DEVICE_IOREQUEST: { UINT32 CompletionId = 0; - UINT32 deviceID = 0, FileId = 0, MajorFunction = 0, MinorFunction = 0; + UINT32 deviceID = 0; + UINT32 FileId = 0; + UINT32 MajorFunction = 0; + UINT32 MinorFunction = 0; if (pos >= 8) Stream_Read_UINT32(s, deviceID); @@ -359,7 +364,8 @@ static void rdpdr_dump_packet(wLog* log, DWORD lvl, wStream* s, const char* cust break; case PAKID_CORE_DEVICE_IOCOMPLETION: { - UINT32 completionID = 0, ioStatus = 0; + UINT32 completionID = 0; + UINT32 ioStatus = 0; UINT32 deviceID = 0; if (pos >= 8) Stream_Read_UINT32(s, deviceID); @@ -377,7 +383,8 @@ static void rdpdr_dump_packet(wLog* log, DWORD lvl, wStream* s, const char* cust break; case PAKID_CORE_DEVICE_REPLY: { - UINT32 deviceID = 0, status = 0; + UINT32 deviceID = 0; + UINT32 status = 0; if (pos >= 8) Stream_Read_UINT32(s, deviceID); diff --git a/libfreerdp/utils/smartcard_call.c b/libfreerdp/utils/smartcard_call.c index 31d3b38f0..ddae1c603 100644 --- a/libfreerdp/utils/smartcard_call.c +++ b/libfreerdp/utils/smartcard_call.c @@ -262,7 +262,8 @@ static BOOL filter_match(wLinkedList* list, LPCSTR reader, size_t readerLen) static DWORD filter_device_by_name_a(wLinkedList* list, LPSTR* mszReaders, DWORD cchReaders) { - size_t rpos = 0, wpos = 0; + size_t rpos = 0; + size_t wpos = 0; if (*mszReaders == NULL || LinkedList_Count(list) < 1) return cchReaders; @@ -891,7 +892,8 @@ static LONG smartcard_GetStatusChangeA_Call(scard_call_context* smartcard, wStre { LONG status = STATUS_NO_MEMORY; UINT32 index; - DWORD dwTimeOut, x; + DWORD dwTimeOut; + DWORD x; const DWORD dwTimeStep = 100; GetStatusChange_Return ret = { 0 }; GetStatusChangeA_Call* call; @@ -954,7 +956,8 @@ static LONG smartcard_GetStatusChangeW_Call(scard_call_context* smartcard, wStre { LONG status = STATUS_NO_MEMORY; UINT32 index; - DWORD dwTimeOut, x; + DWORD dwTimeOut; + DWORD x; const DWORD dwTimeStep = 100; GetStatusChange_Return ret = { 0 }; GetStatusChangeW_Call* call; @@ -1459,7 +1462,9 @@ static LONG smartcard_LocateCardsByATRA_Call(scard_call_context* smartcard, wStr SMARTCARD_OPERATION* operation) { LONG status; - DWORD i, j, k; + DWORD i; + DWORD j; + DWORD k; GetStatusChange_Return ret = { 0 }; LPSCARD_READERSTATEA state = NULL; LPSCARD_READERSTATEA states = NULL; diff --git a/libfreerdp/utils/smartcard_pack.c b/libfreerdp/utils/smartcard_pack.c index 9ad574b7d..284c02aee 100644 --- a/libfreerdp/utils/smartcard_pack.c +++ b/libfreerdp/utils/smartcard_pack.c @@ -100,7 +100,9 @@ static BOOL smartcard_ndr_pointer_read_(wStream* s, UINT32* index, UINT32* ptr, static LONG smartcard_ndr_read(wStream* s, BYTE** data, size_t min, size_t elementSize, ndr_ptr_t type) { - size_t len = 0, offset, len2; + size_t len = 0; + size_t offset; + size_t len2; void* r; size_t required = 0; @@ -325,7 +327,8 @@ static LONG smartcard_ndr_read_u(wStream* s, UUID** data) static char* smartcard_convert_string_list(const void* in, size_t bytes, BOOL unicode) { - size_t index, length = 0; + size_t index; + size_t length = 0; union { const void* pv; @@ -2208,7 +2211,8 @@ static void smartcard_trace_get_status_change_a_call(const GetStatusChangeA_Call static LONG smartcard_unpack_reader_state_a(wStream* s, LPSCARD_READERSTATEA* ppcReaders, UINT32 cReaders, UINT32* ptrIndex) { - UINT32 index, len; + UINT32 index; + UINT32 len; LONG status = SCARD_E_NO_MEMORY; LPSCARD_READERSTATEA rgReaderStates; BOOL* states; @@ -2281,7 +2285,8 @@ fail: static LONG smartcard_unpack_reader_state_w(wStream* s, LPSCARD_READERSTATEW* ppcReaders, UINT32 cReaders, UINT32* ptrIndex) { - UINT32 index, len; + UINT32 index; + UINT32 len; LONG status = SCARD_E_NO_MEMORY; LPSCARD_READERSTATEW rgReaderStates; BOOL* states; @@ -3015,7 +3020,8 @@ LONG smartcard_unpack_locate_cards_by_atr_a_call(wStream* s, LocateCardsByATRA_C LONG smartcard_unpack_context_and_two_strings_a_call(wStream* s, ContextAndTwoStringA_Call* call) { - UINT32 sz1NdrPtr, sz2NdrPtr; + UINT32 sz1NdrPtr; + UINT32 sz2NdrPtr; UINT32 index = 0; UINT32 pbContextNdrPtr = 0; @@ -3051,7 +3057,8 @@ LONG smartcard_unpack_context_and_two_strings_a_call(wStream* s, ContextAndTwoSt LONG smartcard_unpack_context_and_two_strings_w_call(wStream* s, ContextAndTwoStringW_Call* call) { - UINT32 sz1NdrPtr, sz2NdrPtr; + UINT32 sz1NdrPtr; + UINT32 sz2NdrPtr; UINT32 index = 0; UINT32 pbContextNdrPtr = 0; @@ -3087,7 +3094,8 @@ LONG smartcard_unpack_context_and_two_strings_w_call(wStream* s, ContextAndTwoSt LONG smartcard_unpack_locate_cards_a_call(wStream* s, LocateCardsA_Call* call) { - UINT32 sz1NdrPtr, sz2NdrPtr; + UINT32 sz1NdrPtr; + UINT32 sz2NdrPtr; UINT32 index = 0; UINT32 pbContextNdrPtr = 0; @@ -3130,7 +3138,8 @@ LONG smartcard_unpack_locate_cards_a_call(wStream* s, LocateCardsA_Call* call) LONG smartcard_unpack_locate_cards_w_call(wStream* s, LocateCardsW_Call* call) { - UINT32 sz1NdrPtr, sz2NdrPtr; + UINT32 sz1NdrPtr; + UINT32 sz2NdrPtr; UINT32 index = 0; UINT32 pbContextNdrPtr = 0; diff --git a/libfreerdp/utils/test/TestPodArrays.c b/libfreerdp/utils/test/TestPodArrays.c index aa8b68233..fc8794cec 100644 --- a/libfreerdp/utils/test/TestPodArrays.c +++ b/libfreerdp/utils/test/TestPodArrays.c @@ -60,7 +60,9 @@ POD_ARRAYS_IMPL(BasicStruct, basicstruct) int TestPodArrays(int argc, char* argv[]) { - UINT32 i, sum, foreach_index; + UINT32 i; + UINT32 sum; + UINT32 foreach_index; ArrayUINT32 uint32s; UINT32* ptr; const UINT32* cptr; diff --git a/libfreerdp/utils/test/TestRingBuffer.c b/libfreerdp/utils/test/TestRingBuffer.c index 730381e58..e2950947c 100644 --- a/libfreerdp/utils/test/TestRingBuffer.c +++ b/libfreerdp/utils/test/TestRingBuffer.c @@ -30,7 +30,9 @@ static BOOL test_overlaps(void) size_t i; size_t k; int x; - int nchunks, j, counter = 0; + int nchunks; + int j; + int counter = 0; for (i = 0; i < sizeof(bytes); i++) bytes[i] = (BYTE)i; diff --git a/rdtk/librdtk/rdtk_nine_patch.c b/rdtk/librdtk/rdtk_nine_patch.c index 4ae376190..ea8432fb5 100644 --- a/rdtk/librdtk/rdtk_nine_patch.c +++ b/rdtk/librdtk/rdtk_nine_patch.c @@ -78,7 +78,8 @@ static int rdtk_image_copy_alpha_blend(uint8_t* pDstData, int nDstStep, int nXDs int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight, rdtkNinePatch* ninePatch) { - int x, y; + int x; + int y; int width; int height; int nXSrc; diff --git a/rdtk/sample/rdtk_x11.c b/rdtk/sample/rdtk_x11.c index d0bcba759..ae479ef1a 100644 --- a/rdtk/sample/rdtk_x11.c +++ b/rdtk/sample/rdtk_x11.c @@ -33,7 +33,8 @@ int main(int argc, char** argv) GC gc; int index; int depth; - int x, y; + int x; + int y; int width; int height; uint8_t* buffer; diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 31ca4ee87..ebb67bba7 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -495,7 +495,8 @@ static void test_peer_draw_icon(freerdp_peer* client, UINT32 x, UINT32 y) static BOOL test_sleep_tsdiff(UINT32* old_sec, UINT32* old_usec, UINT32 new_sec, UINT32 new_usec) { - INT64 sec, usec; + INT64 sec; + INT64 usec; WINPR_ASSERT(old_sec); WINPR_ASSERT(old_usec); diff --git a/server/common/server.c b/server/common/server.c index 1d5bbbad9..3e22d10b0 100644 --- a/server/common/server.c +++ b/server/common/server.c @@ -92,7 +92,8 @@ size_t server_audin_get_formats(AUDIO_FORMAT** dst_formats) { WAVE_FORMAT_ALAW, 1, 22050, 22050, 2, 8, 0, NULL } }; const size_t nrDefaultFormatsMax = ARRAYSIZE(default_supported_audio_formats); - size_t x, nr_formats = 0; + size_t x; + size_t nr_formats = 0; AUDIO_FORMAT* formats = audio_formats_new(nrDefaultFormatsMax); if (!dst_formats) @@ -125,7 +126,8 @@ fail: size_t server_rdpsnd_get_formats(AUDIO_FORMAT** dst_formats) { - size_t x, y = 0; + size_t x; + size_t y = 0; /* Default supported audio formats */ static const AUDIO_FORMAT default_supported_audio_formats[] = { { WAVE_FORMAT_AAC_MS, 2, 44100, 176400, 4, 16, 0, NULL }, diff --git a/server/proxy/channels/pf_channel_drdynvc.c b/server/proxy/channels/pf_channel_drdynvc.c index 020830d66..864b74fc8 100644 --- a/server/proxy/channels/pf_channel_drdynvc.c +++ b/server/proxy/channels/pf_channel_drdynvc.c @@ -232,8 +232,10 @@ static DynvcReadResult dynvc_read_varInt(wLog* log, wStream* s, size_t len, UINT static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL firstPacket, BOOL lastPacket) { - BYTE cmd, byte0; - wStream *s, sbuffer; + BYTE cmd; + BYTE byte0; + wStream* s; + wStream sbuffer; BOOL haveChannelId; BOOL haveLength; UINT64 dynChannelId = 0; diff --git a/server/proxy/channels/pf_channel_rdpdr.c b/server/proxy/channels/pf_channel_rdpdr.c index 419c061f1..7a00a91df 100644 --- a/server/proxy/channels/pf_channel_rdpdr.c +++ b/server/proxy/channels/pf_channel_rdpdr.c @@ -269,7 +269,8 @@ static UINT rdpdr_seal_send_free_request(pf_channel_server_context* context, wSt static BOOL rdpdr_process_server_header(BOOL server, wLog* log, wStream* s, UINT16 component, UINT16 PacketId, size_t expect) { - UINT16 rpacketid, rcomponent; + UINT16 rpacketid; + UINT16 rcomponent; WINPR_ASSERT(s); if (!Stream_CheckAndLogRequiredLengthRx(server, log, s, 4)) @@ -388,7 +389,8 @@ static UINT rdpdr_process_client_announce_reply(pf_channel_server_context* rdpdr { const UINT16 component = RDPDR_CTYP_CORE; const UINT16 packetid = PAKID_CORE_CLIENTID_CONFIRM; - UINT16 versionMajor, versionMinor; + UINT16 versionMajor; + UINT16 versionMinor; UINT32 clientID; WINPR_ASSERT(rdpdr); @@ -733,7 +735,8 @@ static UINT rdpdr_process_client_capability_response(pf_channel_server_context* const UINT16 component = RDPDR_CTYP_CORE; const UINT16 packetid = PAKID_CORE_CLIENT_CAPABILITY; UINT status = CHANNEL_RC_OK; - UINT16 numCapabilities, x; + UINT16 numCapabilities; + UINT16 x; WINPR_ASSERT(rdpdr); if (!rdpdr_process_server_header(TRUE, rdpdr->log, s, component, packetid, 4)) @@ -890,7 +893,8 @@ rdpdr_process_server_capability_request_or_clientid_confirm(pf_channel_client_co const UINT32 mask = STATE_CLIENT_EXPECT_SERVER_CLIENT_ID_CONFIRM | STATE_CLIENT_EXPECT_SERVER_CORE_CAPABILITY_REQUEST; const UINT16 rcomponent = RDPDR_CTYP_CORE; - UINT16 component, packetid; + UINT16 component; + UINT16 packetid; WINPR_ASSERT(rdpdr); WINPR_ASSERT(s); @@ -1106,7 +1110,8 @@ static BOOL pf_channel_rdpdr_rewrite_device_list(pf_channel_client_context* rdpd WINPR_ASSERT(ps); const size_t pos = Stream_GetPosition(s); - UINT16 component, packetid; + UINT16 component; + UINT16 packetid; Stream_SetPosition(s, 0); if (!Stream_CheckAndLogRequiredLengthWLog(rdpdr->log, s, 4)) @@ -1190,7 +1195,8 @@ static BOOL filter_smartcard_io_requests(pf_channel_client_context* rdpdr, wStre UINT16* pPacketid) { BOOL rc = FALSE; - UINT16 component, packetid; + UINT16 component; + UINT16 packetid; UINT32 deviceID = 0; size_t pos; @@ -1529,7 +1535,8 @@ static BOOL pf_channel_rdpdr_client_pass_message(pServerContext* ps, pClientCont static BOOL filter_smartcard_device_list_remove(pf_channel_server_context* rdpdr, wStream* s) { size_t pos; - UINT32 x, count; + UINT32 x; + UINT32 count; WINPR_ASSERT(rdpdr); if (!Stream_CheckAndLogRequiredLengthWLog(rdpdr->log, s, sizeof(UINT32))) @@ -1630,7 +1637,8 @@ static BOOL filter_smartcard_device_list_announce_request(pf_channel_server_cont { BOOL rc = TRUE; size_t pos; - UINT16 component, packetid; + UINT16 component; + UINT16 packetid; WINPR_ASSERT(rdpdr); if (!Stream_CheckAndLogRequiredLengthWLog(rdpdr->log, s, 8)) diff --git a/server/proxy/channels/pf_channel_smartcard.c b/server/proxy/channels/pf_channel_smartcard.c index ebc9ec967..17ba52963 100644 --- a/server/proxy/channels/pf_channel_smartcard.c +++ b/server/proxy/channels/pf_channel_smartcard.c @@ -74,8 +74,10 @@ static pf_channel_client_context* scard_get_client_context(pClientContext* pc) static BOOL pf_channel_client_write_iostatus(wStream* out, const SMARTCARD_OPERATION* op, UINT32 ioStatus) { - UINT16 component, packetid; - UINT32 dID, cID; + UINT16 component; + UINT16 packetid; + UINT32 dID; + UINT32 cID; size_t pos; WINPR_ASSERT(op); diff --git a/server/proxy/modules/dyn-channel-dump/dyn-channel-dump.cpp b/server/proxy/modules/dyn-channel-dump/dyn-channel-dump.cpp index 990281904..d80902f23 100644 --- a/server/proxy/modules/dyn-channel-dump/dyn-channel-dump.cpp +++ b/server/proxy/modules/dyn-channel-dump/dyn-channel-dump.cpp @@ -342,7 +342,8 @@ static std::vector split(const std::string& input, const std::strin { // passing -1 as the submatch index parameter performs splitting std::regex re(regex); - std::sregex_token_iterator first{ input.begin(), input.end(), re, -1 }, last; + std::sregex_token_iterator first{ input.begin(), input.end(), re, -1 }; + std::sregex_token_iterator last; return { first, last }; } diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index 4ba866614..2231e5ce0 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -409,7 +409,8 @@ static BOOL pf_client_load_channels(freerdp* instance) { CHANNEL_DEF* channels = (CHANNEL_DEF*)freerdp_settings_get_pointer_array_writable( settings, FreeRDP_ChannelDefArray, 0); - size_t x, size = freerdp_settings_get_uint32(settings, FreeRDP_ChannelCount); + size_t x; + size_t size = freerdp_settings_get_uint32(settings, FreeRDP_ChannelCount); UINT32 id = MCS_GLOBAL_CHANNEL_ID + 1; WINPR_ASSERT(channels || (size == 0)); diff --git a/server/shadow/X11/x11_shadow.c b/server/shadow/X11/x11_shadow.c index bd9fa9299..cf0948fa5 100644 --- a/server/shadow/X11/x11_shadow.c +++ b/server/shadow/X11/x11_shadow.c @@ -482,7 +482,10 @@ static int x11_shadow_pointer_alpha_update(x11ShadowSubsystem* subsystem) static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage) { - int x = 0, y = 0, n, k; + int x = 0; + int y = 0; + int n; + int k; rdpShadowServer* server; rdpShadowSurface* surface; server = subsystem->common.server; @@ -530,9 +533,12 @@ static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage) else { UINT32 mask; - int win_x, win_y; - int root_x, root_y; - Window root, child; + int win_x; + int win_y; + int root_x; + int root_y; + Window root; + Window child; XLockDisplay(subsystem->display); if (!XQueryPointer(subsystem->display, subsystem->root_window, &root, &child, &root_x, @@ -606,7 +612,8 @@ static void x11_shadow_validate_region(x11ShadowSubsystem* subsystem, int x, int static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem) { - UINT32 x, y; + UINT32 x; + UINT32 y; UINT32 nXSrc; UINT32 nYSrc; INT64 nXDst; @@ -617,7 +624,10 @@ static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem) UINT32 nDstStep; BYTE* pSrcData; BYTE* pDstData; - BYTE A, R, G, B; + BYTE A; + BYTE R; + BYTE G; + BYTE B; rdpShadowSurface* surface; if (!subsystem) @@ -754,8 +764,10 @@ static int x11_shadow_screen_grab(x11ShadowSubsystem* subsystem) int rc = 0; size_t count; int status = -1; - int x, y; - int width, height; + int x; + int y; + int width; + int height; XImage* image; rdpShadowServer* server; rdpShadowSurface* surface; @@ -1007,7 +1019,8 @@ static int x11_shadow_xfixes_init(x11ShadowSubsystem* subsystem) #ifdef WITH_XFIXES int xfixes_event; int xfixes_error; - int major, minor; + int major; + int minor; if (!XFixesQueryExtension(subsystem->display, &xfixes_event, &xfixes_error)) return -1; @@ -1035,7 +1048,8 @@ static int x11_shadow_xinerama_init(x11ShadowSubsystem* subsystem) return -1; #if defined(WITH_XDAMAGE) - int major, minor; + int major; + int minor; if (!XDamageQueryVersion(subsystem->display, &major, &minor)) return -1; #endif @@ -1052,7 +1066,8 @@ static int x11_shadow_xinerama_init(x11ShadowSubsystem* subsystem) static int x11_shadow_xdamage_init(x11ShadowSubsystem* subsystem) { #ifdef WITH_XDAMAGE - int major, minor; + int major; + int minor; int damage_event; int damage_error; @@ -1091,7 +1106,8 @@ static int x11_shadow_xdamage_init(x11ShadowSubsystem* subsystem) static int x11_shadow_xshm_init(x11ShadowSubsystem* subsystem) { Bool pixmaps; - int major, minor; + int major; + int minor; XGCValues values; if (!XShmQueryExtension(subsystem->display)) @@ -1183,7 +1199,8 @@ UINT32 x11_shadow_enum_monitors(MONITOR_DEF* monitors, UINT32 maxMonitors) #ifdef WITH_XINERAMA { #if defined(WITH_XDAMAGE) - int major, minor; + int major; + int minor; #endif int xinerama_event; int xinerama_error; diff --git a/server/shadow/shadow_capture.c b/server/shadow/shadow_capture.c index af43fefcb..8f03eeafe 100644 --- a/server/shadow/shadow_capture.c +++ b/server/shadow/shadow_capture.c @@ -31,7 +31,8 @@ int shadow_capture_align_clip_rect(RECTANGLE_16* rect, RECTANGLE_16* clip) { - int dx, dy; + int dx; + int dy; dx = (rect->left % 16); if (dx != 0) @@ -82,11 +83,19 @@ int shadow_capture_compare(BYTE* pData1, UINT32 nStep1, UINT32 nWidth, UINT32 nH { BOOL equal; BOOL allEqual; - UINT32 tw, th; - UINT32 tx, ty, k; - UINT32 nrow, ncol; - UINT32 l, t, r, b; - BYTE *p1, *p2; + UINT32 tw; + UINT32 th; + UINT32 tx; + UINT32 ty; + UINT32 k; + UINT32 nrow; + UINT32 ncol; + UINT32 l; + UINT32 t; + UINT32 r; + UINT32 b; + BYTE* p1; + BYTE* p2; BOOL rows[1024]; #ifdef WITH_DEBUG_SHADOW_CAPTURE BOOL cols[1024] = { FALSE }; diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index 5aaa55100..8ff284585 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -318,7 +318,8 @@ static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, UINT32 nu */ static INLINE BOOL shadow_client_recalc_desktop_size(rdpShadowClient* client) { - INT32 width, height; + INT32 width; + INT32 height; rdpShadowServer* server; rdpSettings* settings; RECTANGLE_16 viewport = { 0 }; @@ -1378,7 +1379,8 @@ static BOOL shadow_client_send_surface_bits(rdpShadowClient* client, BYTE* pSrcD rdpSettings* settings; rdpShadowEncoder* encoder; SURFACE_BITS_COMMAND cmd = { 0 }; - UINT32 nsID, rfxID; + UINT32 nsID; + UINT32 rfxID; if (!context || !pSrcData) return FALSE; @@ -1528,8 +1530,10 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, BYTE* pSrc BYTE* data; BYTE* buffer; UINT32 k; - UINT32 yIdx, xIdx; - UINT32 rows, cols; + UINT32 yIdx; + UINT32 xIdx; + UINT32 rows; + UINT32 cols; UINT32 DstSize; UINT32 SrcFormat; BITMAP_DATA* bitmap; @@ -1672,7 +1676,8 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client, BYTE* pSrc if (updateSizeEstimate > maxUpdateSize) { - UINT32 i, j; + UINT32 i; + UINT32 j; UINT32 updateSize; UINT32 newUpdateSize; BITMAP_DATA* fragBitmapData = NULL; @@ -1742,8 +1747,10 @@ out: static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GFX_STATUS* pStatus) { BOOL ret = TRUE; - INT64 nXSrc, nYSrc; - INT64 nWidth, nHeight; + INT64 nXSrc; + INT64 nYSrc; + INT64 nWidth; + INT64 nHeight; rdpContext* context = (rdpContext*)client; rdpSettings* settings; rdpShadowServer* server; @@ -1752,7 +1759,8 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GF RECTANGLE_16 surfaceRect; const RECTANGLE_16* extents; BYTE* pSrcData; - UINT32 nSrcStep, SrcFormat; + UINT32 nSrcStep; + UINT32 SrcFormat; UINT32 index; UINT32 numRects = 0; const RECTANGLE_16* rects; @@ -1814,7 +1822,8 @@ static BOOL shadow_client_send_surface_update(rdpShadowClient* client, SHADOW_GF /* Move to new pSrcData / nXSrc / nYSrc according to sub rect */ if (server->shareSubRect) { - INT32 subX, subY; + INT32 subX; + INT32 subY; subX = server->subRect.left; subY = server->subRect.top; nXSrc -= subX; diff --git a/server/shadow/shadow_encoder.c b/server/shadow/shadow_encoder.c index d357e87ee..55dd905e0 100644 --- a/server/shadow/shadow_encoder.c +++ b/server/shadow/shadow_encoder.c @@ -80,7 +80,9 @@ UINT32 shadow_encoder_create_frame_id(rdpShadowEncoder* encoder) static int shadow_encoder_init_grid(rdpShadowEncoder* encoder) { - UINT32 i, j, k; + UINT32 i; + UINT32 j; + UINT32 k; UINT32 tileSize; UINT32 tileCount; encoder->gridWidth = ((encoder->width + (encoder->maxTileWidth - 1)) / encoder->maxTileWidth); diff --git a/server/shadow/shadow_screen.c b/server/shadow/shadow_screen.c index eb0fbb670..c6be52239 100644 --- a/server/shadow/shadow_screen.c +++ b/server/shadow/shadow_screen.c @@ -119,8 +119,10 @@ void shadow_screen_free(rdpShadowScreen* screen) BOOL shadow_screen_resize(rdpShadowScreen* screen) { - int x, y; - int width, height; + int x; + int y; + int width; + int height; MONITOR_DEF* primary; rdpShadowSubsystem* subsystem; diff --git a/server/shadow/shadow_server.c b/server/shadow/shadow_server.c index d589e4b94..b14ed0da8 100644 --- a/server/shadow/shadow_server.c +++ b/server/shadow/shadow_server.c @@ -226,7 +226,10 @@ int shadow_server_parse_command_line(rdpShadowServer* server, int argc, char** a { char* p; char* tok[4]; - long x = -1, y = -1, w = -1, h = -1; + long x = -1; + long y = -1; + long w = -1; + long h = -1; char* str = _strdup(arg->Value); if (!str) @@ -641,7 +644,8 @@ int shadow_server_start(rdpShadowServer* server) strnlen(bind_address, sizeof(bind_address))) != 0); if (!ipc) { - size_t x, count; + size_t x; + size_t count; char** list = CommandLineParseCommaSeparatedValuesEx(NULL, server->ipcSocket, &count); if (!list || (count <= 1)) { diff --git a/server/shadow/shadow_subsystem.c b/server/shadow/shadow_subsystem.c index a1d5190d5..bf2b45ee7 100644 --- a/server/shadow/shadow_subsystem.c +++ b/server/shadow/shadow_subsystem.c @@ -193,7 +193,8 @@ int shadow_subsystem_pointer_convert_alpha_pointer_data( BYTE* pixels, BOOL premultiplied, UINT32 width, UINT32 height, SHADOW_MSG_OUT_POINTER_ALPHA_UPDATE* pointerColor) { - UINT32 x, y; + UINT32 x; + UINT32 y; BYTE* pSrc8; BYTE* pDst8; UINT32 xorStep; @@ -201,7 +202,10 @@ int shadow_subsystem_pointer_convert_alpha_pointer_data( UINT32 andBit; BYTE* andBits; UINT32 andPixel; - BYTE A, R, G, B; + BYTE A; + BYTE R; + BYTE G; + BYTE B; xorStep = (width * 3); xorStep += (xorStep % 2); diff --git a/uwac/libuwac/uwac-display.c b/uwac/libuwac/uwac-display.c index 8b1c06dc3..3d61a285a 100644 --- a/uwac/libuwac/uwac-display.c +++ b/uwac/libuwac/uwac-display.c @@ -109,7 +109,8 @@ static const struct zwp_fullscreen_shell_v1_listener fullscreen_shell_listener = static void display_destroy_seat(UwacDisplay* d, uint32_t name) { - UwacSeat *seat, *tmp; + UwacSeat* seat; + UwacSeat* tmp; wl_list_for_each_safe(seat, tmp, &d->seats, link) { if (seat->seat_id == name) @@ -204,7 +205,8 @@ static void registry_handle_global(void* data, struct wl_registry* registry, uin } else if (strcmp(interface, "wl_data_device_manager") == 0) { - UwacSeat *seat, *tmp; + UwacSeat* seat; + UwacSeat* tmp; d->data_device_manager = wl_registry_bind(registry, id, &wl_data_device_manager_interface, min(TARGET_DDM_INTERFACE, version)); @@ -458,7 +460,9 @@ out_free: int UwacDisplayDispatch(UwacDisplay* display, int timeout) { - int ret, count, i; + int ret; + int count; + int i; UwacTask* task; struct epoll_event ep[16]; wl_display_dispatch_pending(display->display); @@ -498,10 +502,14 @@ UwacReturnCode UwacDisplayGetLastError(const UwacDisplay* display) UwacReturnCode UwacCloseDisplay(UwacDisplay** pdisplay) { UwacDisplay* display; - UwacSeat *seat, *tmpSeat; - UwacWindow *window, *tmpWindow; - UwacOutput *output, *tmpOutput; - UwacGlobal *global, *tmpGlobal; + UwacSeat* seat; + UwacSeat* tmpSeat; + UwacWindow* window; + UwacWindow* tmpWindow; + UwacOutput* output; + UwacOutput* tmpOutput; + UwacGlobal* global; + UwacGlobal* tmpGlobal; assert(pdisplay); display = *pdisplay; @@ -622,7 +630,8 @@ const char* UwacErrorString(UwacReturnCode error) UwacReturnCode UwacDisplayQueryInterfaceVersion(const UwacDisplay* display, const char* name, uint32_t* version) { - const UwacGlobal *global, *tmp; + const UwacGlobal* global; + const UwacGlobal* tmp; if (!display) return UWAC_ERROR_INVALID_DISPLAY; @@ -675,7 +684,8 @@ uint32_t UwacDisplayGetNbOutputs(const UwacDisplay* display) const UwacOutput* UwacDisplayGetOutput(UwacDisplay* display, int index) { - int i, display_count; + int i; + int display_count; UwacOutput* ret = NULL; if (!display) diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index a9732828d..1c6a7d1ba 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -97,7 +97,8 @@ static UwacReturnCode set_cursor_image(UwacSeat* seat, uint32_t serial) struct wl_cursor* cursor; struct wl_cursor_image* image = NULL; struct wl_surface* surface = NULL; - int32_t x = 0, y = 0; + int32_t x = 0; + int32_t y = 0; if (!seat || !seat->display || !seat->default_cursor || !seat->default_cursor->images) return UWAC_ERROR_INTERNAL; @@ -362,7 +363,8 @@ static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, uint32 UwacWindow* window = input->keyboard_focus; UwacKeyEvent* keyEvent; - uint32_t code, num_syms; + uint32_t code; + uint32_t num_syms; enum wl_keyboard_key_state state = state_w; const xkb_keysym_t* syms; xkb_keysym_t sym; diff --git a/uwac/libuwac/uwac-window.c b/uwac/libuwac/uwac-window.c index 91b37d55c..76141ad75 100644 --- a/uwac/libuwac/uwac-window.c +++ b/uwac/libuwac/uwac-window.c @@ -91,7 +91,8 @@ static void xdg_handle_toplevel_configure(void* data, struct xdg_toplevel* xdg_t width *= scale; height *= scale; UwacConfigureEvent* event; - int ret, surfaceState; + int ret; + int surfaceState; enum xdg_toplevel_state* state; surfaceState = 0; wl_array_for_each(state, states) @@ -321,7 +322,8 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32 { int ret = UWAC_SUCCESS; UwacBuffer* newBuffers; - int i, fd; + int i; + int fd; void* data; struct wl_shm_pool* pool; size_t pagesize = sysconf(_SC_PAGESIZE); @@ -456,7 +458,8 @@ UwacWindow* UwacCreateWindowShm(UwacDisplay* display, uint32_t width, uint32_t h enum wl_shm_format format) { UwacWindow* w; - int allocSize, ret; + int allocSize; + int ret; if (!display) { @@ -679,8 +682,12 @@ static const struct wl_callback_listener frame_listener = { frame_done_cb }; #ifdef UWAC_HAVE_PIXMAN_REGION static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale) { - int nrects, i; - int x, y, w, h; + int nrects; + int i; + int x; + int y; + int w; + int h; const pixman_box32_t* box = pixman_region32_rectangles(&buffer->damage, &nrects); for (i = 0; i < nrects; i++, box++) @@ -697,8 +704,12 @@ static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale) #else static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale) { - uint32_t nrects, i; - int x, y, w, h; + uint32_t nrects; + uint32_t i; + int x; + int y; + int w; + int h; const RECTANGLE_16* box = region16_rects(&buffer->damage, &nrects); for (i = 0; i < nrects; i++, box++) diff --git a/winpr/libwinpr/clipboard/synthetic_file.c b/winpr/libwinpr/clipboard/synthetic_file.c index 78b4cafd2..cfa5f416e 100644 --- a/winpr/libwinpr/clipboard/synthetic_file.c +++ b/winpr/libwinpr/clipboard/synthetic_file.c @@ -705,7 +705,11 @@ static void* convert_filedescriptors_to_file_list(wClipboard* clipboard, UINT32 const FILEDESCRIPTORW* descriptors = NULL; UINT32 nrDescriptors = 0; - size_t count, x, alloc, pos, baseLength = 0; + size_t count; + size_t x; + size_t alloc; + size_t pos; + size_t baseLength = 0; char* dst; size_t header_len = strlen(header); size_t lineprefix_len = strlen(lineprefix); diff --git a/winpr/libwinpr/comm/comm_io.c b/winpr/libwinpr/comm/comm_io.c index 1b0f278cf..6cbf5355a 100644 --- a/winpr/libwinpr/comm/comm_io.c +++ b/winpr/libwinpr/comm/comm_io.c @@ -78,7 +78,8 @@ BOOL CommReadFile(HANDLE hDevice, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, UCHAR vmin = 0; UCHAR vtime = 0; ULONGLONG Tmax = 0; - struct timeval tmaxTimeout, *pTmaxTimeout; + struct timeval tmaxTimeout; + struct timeval* pTmaxTimeout; struct termios currentTermios; EnterCriticalSection(&pComm->ReadLock); /* KISSer by the function's beginning */ @@ -366,7 +367,8 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) { WINPR_COMM* pComm = (WINPR_COMM*)hDevice; - struct timeval tmaxTimeout, *pTmaxTimeout; + struct timeval tmaxTimeout; + struct timeval* pTmaxTimeout; EnterCriticalSection(&pComm->WriteLock); /* KISSer by the function's beginning */ if (!CommIsHandled(hDevice)) @@ -420,7 +422,8 @@ BOOL CommWriteFile(HANDLE hDevice, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite while (*lpNumberOfBytesWritten < nNumberOfBytesToWrite) { int biggestFd = -1; - fd_set event_set, write_set; + fd_set event_set; + fd_set write_set; int nbFds; biggestFd = pComm->fd_write; diff --git a/winpr/libwinpr/crt/alignment.c b/winpr/libwinpr/crt/alignment.c index 9fd0623a6..bfba54bd3 100644 --- a/winpr/libwinpr/crt/alignment.c +++ b/winpr/libwinpr/crt/alignment.c @@ -77,7 +77,8 @@ void* winpr_aligned_recalloc(void* memblock, size_t num, size_t size, size_t ali void* winpr_aligned_offset_malloc(size_t size, size_t alignment, size_t offset) { - size_t header, alignsize; + size_t header; + size_t alignsize; uintptr_t basesize; void* base; void* memblock; diff --git a/winpr/libwinpr/crypto/crypto.c b/winpr/libwinpr/crypto/crypto.c index e3757c8f3..ce6a94a12 100644 --- a/winpr/libwinpr/crypto/crypto.c +++ b/winpr/libwinpr/crypto/crypto.c @@ -147,7 +147,8 @@ static wListDictionary* g_ProtectedMemoryBlocks = NULL; BOOL CryptProtectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags) { BYTE* pCipherText; - size_t cbOut, cbFinal; + size_t cbOut; + size_t cbFinal; WINPR_CIPHER_CTX* enc = NULL; BYTE randomKey[256] = { 0 }; WINPR_PROTECTED_MEMORY_BLOCK* pMemBlock; @@ -210,7 +211,8 @@ out: BOOL CryptUnprotectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags) { BYTE* pPlainText = NULL; - size_t cbOut, cbFinal; + size_t cbOut; + size_t cbFinal; WINPR_CIPHER_CTX* dec = NULL; WINPR_PROTECTED_MEMORY_BLOCK* pMemBlock = NULL; diff --git a/winpr/libwinpr/crypto/md4.c b/winpr/libwinpr/crypto/md4.c index bae63e08f..b5a137406 100644 --- a/winpr/libwinpr/crypto/md4.c +++ b/winpr/libwinpr/crypto/md4.c @@ -89,9 +89,16 @@ static const void* body(WINPR_MD4_CTX* ctx, const void* data, unsigned long size) { const unsigned char* ptr; - winpr_MD4_u32plus a, b, c, d; - winpr_MD4_u32plus saved_a, saved_b, saved_c, saved_d; - const winpr_MD4_u32plus ac1 = 0x5a827999, ac2 = 0x6ed9eba1; + winpr_MD4_u32plus a; + winpr_MD4_u32plus b; + winpr_MD4_u32plus c; + winpr_MD4_u32plus d; + winpr_MD4_u32plus saved_a; + winpr_MD4_u32plus saved_b; + winpr_MD4_u32plus saved_c; + winpr_MD4_u32plus saved_d; + const winpr_MD4_u32plus ac1 = 0x5a827999; + const winpr_MD4_u32plus ac2 = 0x6ed9eba1; ptr = (const unsigned char*)data; @@ -191,7 +198,8 @@ void winpr_MD4_Init(WINPR_MD4_CTX* ctx) void winpr_MD4_Update(WINPR_MD4_CTX* ctx, const void* data, unsigned long size) { winpr_MD4_u32plus saved_lo; - unsigned long used, available; + unsigned long used; + unsigned long available; saved_lo = ctx->lo; if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) @@ -233,7 +241,8 @@ void winpr_MD4_Update(WINPR_MD4_CTX* ctx, const void* data, unsigned long size) void winpr_MD4_Final(unsigned char* result, WINPR_MD4_CTX* ctx) { - unsigned long used, available; + unsigned long used; + unsigned long available; used = ctx->lo & 0x3f; diff --git a/winpr/libwinpr/crypto/md5.c b/winpr/libwinpr/crypto/md5.c index 818cdf8e6..7ad62230b 100644 --- a/winpr/libwinpr/crypto/md5.c +++ b/winpr/libwinpr/crypto/md5.c @@ -93,8 +93,14 @@ static const void* body(WINPR_MD5_CTX* ctx, const void* data, unsigned long size) { const unsigned char* ptr; - winpr_MD5_u32plus a, b, c, d; - winpr_MD5_u32plus saved_a, saved_b, saved_c, saved_d; + winpr_MD5_u32plus a; + winpr_MD5_u32plus b; + winpr_MD5_u32plus c; + winpr_MD5_u32plus d; + winpr_MD5_u32plus saved_a; + winpr_MD5_u32plus saved_b; + winpr_MD5_u32plus saved_c; + winpr_MD5_u32plus saved_d; ptr = (const unsigned char*)data; @@ -212,7 +218,8 @@ void winpr_MD5_Init(WINPR_MD5_CTX* ctx) void winpr_MD5_Update(WINPR_MD5_CTX* ctx, const void* data, unsigned long size) { winpr_MD5_u32plus saved_lo; - unsigned long used, available; + unsigned long used; + unsigned long available; saved_lo = ctx->lo; if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) @@ -254,7 +261,8 @@ void winpr_MD5_Update(WINPR_MD5_CTX* ctx, const void* data, unsigned long size) void winpr_MD5_Final(unsigned char* result, WINPR_MD5_CTX* ctx) { - unsigned long used, available; + unsigned long used; + unsigned long available; used = ctx->lo & 0x3f; diff --git a/winpr/libwinpr/environment/environment.c b/winpr/libwinpr/environment/environment.c index 098f6cb39..45e440cbd 100644 --- a/winpr/libwinpr/environment/environment.c +++ b/winpr/libwinpr/environment/environment.c @@ -495,7 +495,9 @@ DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer, char* env = NULL; char* foundEquals; const char* penvb = envBlock; - size_t nLength, fLength, lpNameLength; + size_t nLength; + size_t fLength; + size_t lpNameLength; if (!lpName || NULL == envBlock) return 0; diff --git a/winpr/libwinpr/file/file.c b/winpr/libwinpr/file/file.c index 9dfa885db..8a411427b 100644 --- a/winpr/libwinpr/file/file.c +++ b/winpr/libwinpr/file/file.c @@ -276,7 +276,8 @@ static BOOL FileWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrit static DWORD FileGetFileSize(HANDLE Object, LPDWORD lpFileSizeHigh) { WINPR_FILE* file; - INT64 cur, size; + INT64 cur; + INT64 size; if (!Object) return 0; diff --git a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c index f8117983c..b0318088f 100644 --- a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c +++ b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c @@ -10,7 +10,9 @@ typedef int (*TEST_AB_FN)(int a, int b); int TestLibraryGetProcAddress(int argc, char* argv[]) { - int a, b, c; + int a; + int b; + int c; HINSTANCE library; TEST_AB_FN pFunctionA; TEST_AB_FN pFunctionB; diff --git a/winpr/libwinpr/ncrypt/test/TestNCryptProviders.c b/winpr/libwinpr/ncrypt/test/TestNCryptProviders.c index be35a9175..3a0be523d 100644 --- a/winpr/libwinpr/ncrypt/test/TestNCryptProviders.c +++ b/winpr/libwinpr/ncrypt/test/TestNCryptProviders.c @@ -27,7 +27,8 @@ int TestNCryptProviders(int argc, char* argv[]) { SECURITY_STATUS status; - DWORD nproviders, i; + DWORD nproviders; + DWORD i; NCryptProviderName* providers; WINPR_UNUSED(argc); diff --git a/winpr/libwinpr/ncrypt/test/TestNCryptSmartcard.c b/winpr/libwinpr/ncrypt/test/TestNCryptSmartcard.c index eebbd9ad9..744e2e84b 100644 --- a/winpr/libwinpr/ncrypt/test/TestNCryptSmartcard.c +++ b/winpr/libwinpr/ncrypt/test/TestNCryptSmartcard.c @@ -93,7 +93,8 @@ int TestNCryptSmartcard(int argc, char* argv[]) NCRYPT_SILENT_FLAG)) == ERROR_SUCCESS) { NCRYPT_KEY_HANDLE phKey; - DWORD dwFlags = 0, cbOutput; + DWORD dwFlags = 0; + DWORD cbOutput; char keyNameStr[256] = { 0 }; WCHAR reader[1024] = { 0 }; PBYTE certBytes = NULL; diff --git a/winpr/libwinpr/registry/registry_reg.c b/winpr/libwinpr/registry/registry_reg.c index c6a412981..bdb32fe74 100644 --- a/winpr/libwinpr/registry/registry_reg.c +++ b/winpr/libwinpr/registry/registry_reg.c @@ -226,7 +226,8 @@ static RegVal* reg_load_value(const Reg* reg, RegKey* key) break; case REG_SZ: { - size_t len, cmp; + size_t len; + size_t cmp; char* end; char* start = strchr(data, '"'); if (!start) diff --git a/winpr/libwinpr/smartcard/smartcard_pcsc.c b/winpr/libwinpr/smartcard/smartcard_pcsc.c index 878755c13..04f7c08d9 100644 --- a/winpr/libwinpr/smartcard/smartcard_pcsc.c +++ b/winpr/libwinpr/smartcard/smartcard_pcsc.c @@ -1524,7 +1524,8 @@ static LONG WINAPI PCSC_SCardGetStatusChange_Internal(SCARDCONTEXT hContext, DWO LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) { - PCSC_DWORD i, j; + PCSC_DWORD i; + PCSC_DWORD j; INT64* map; PCSC_DWORD cMappedReaders; PCSC_SCARD_READERSTATE* states; diff --git a/winpr/libwinpr/sspi/Kerberos/kerberos.c b/winpr/libwinpr/sspi/Kerberos/kerberos.c index 695e6153b..8719b23e5 100644 --- a/winpr/libwinpr/sspi/Kerberos/kerberos.c +++ b/winpr/libwinpr/sspi/Kerberos/kerberos.c @@ -574,7 +574,8 @@ cleanup: static BOOL kerberos_rd_tgt_token(const sspi_gss_data* token, char** target, krb5_data* ticket) { - WinPrAsn1Decoder dec, dec2; + WinPrAsn1Decoder dec; + WinPrAsn1Decoder dec2; BOOL error; WinPrAsn1_tagId tag; WinPrAsn1_INTEGER val; @@ -1331,7 +1332,9 @@ static SECURITY_STATUS SEC_ENTRY kerberos_QueryContextAttributesA(PCtxtHandle ph if (ulAttribute == SECPKG_ATTR_SIZES) { - UINT header, pad, trailer; + UINT header; + UINT pad; + UINT trailer; krb5glue_key key; KRB_CONTEXT* context = get_context(phContext); SecPkgContext_Sizes* ContextSizes = (SecPkgContext_Sizes*)pBuffer; @@ -1484,7 +1487,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_EncryptMessage(PCtxtHandle phContext, { #ifdef WITH_KRB5 KRB_CONTEXT* context = get_context(phContext); - PSecBuffer sig_buffer, data_buffer; + PSecBuffer sig_buffer; + PSecBuffer data_buffer; BYTE* header; BYTE flags = 0; krb5glue_key key; @@ -1570,7 +1574,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_DecryptMessage(PCtxtHandle phContext, { #ifdef WITH_KRB5 KRB_CONTEXT* context = get_context(phContext); - PSecBuffer sig_buffer, data_buffer; + PSecBuffer sig_buffer; + PSecBuffer data_buffer; krb5glue_key key; krb5_keyusage usage; char* header; @@ -1669,7 +1674,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_MakeSignature(PCtxtHandle phContext, U { #ifdef WITH_KRB5 KRB_CONTEXT* context = get_context(phContext); - PSecBuffer sig_buffer, data_buffer; + PSecBuffer sig_buffer; + PSecBuffer data_buffer; krb5glue_key key; krb5_keyusage usage; char* header; @@ -1737,7 +1743,8 @@ static SECURITY_STATUS SEC_ENTRY kerberos_VerifySignature(PCtxtHandle phContext, ULONG MessageSeqNo, ULONG* pfQOP) { #ifdef WITH_KRB5 - PSecBuffer sig_buffer, data_buffer; + PSecBuffer sig_buffer; + PSecBuffer data_buffer; krb5glue_key key; krb5_keyusage usage; char* header; diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c index 711779c8c..b60a3c9ea 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c @@ -420,7 +420,8 @@ static BOOL ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) else if (context->HashCallback) { int ret; - SecBuffer proofValue, micValue; + SecBuffer proofValue; + SecBuffer micValue; if (ntlm_computeProofValue(context, &proofValue) != SEC_E_OK) return FALSE; diff --git a/winpr/libwinpr/sspi/Negotiate/negotiate.c b/winpr/libwinpr/sspi/Negotiate/negotiate.c index b7f1eb0a9..88421ac64 100644 --- a/winpr/libwinpr/sspi/Negotiate/negotiate.c +++ b/winpr/libwinpr/sspi/Negotiate/negotiate.c @@ -235,7 +235,8 @@ static PSecHandle negotiate_FindCredential(MechCred* creds, const Mech* mech) static BOOL negotiate_get_dword(HKEY hKey, const char* subkey, DWORD* pdwValue) { - DWORD dwValue = 0, dwType = 0; + DWORD dwValue = 0; + DWORD dwType = 0; DWORD dwSize = sizeof(dwValue); LONG rc = RegQueryValueExA(hKey, subkey, NULL, &dwType, (BYTE*)&dwValue, &dwSize); @@ -953,7 +954,8 @@ static SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext( SecBufferDesc mech_input = { SECBUFFER_VERSION, 1, &input_token.mechToken }; SecBufferDesc mech_output = { SECBUFFER_VERSION, 1, &output_token.mechToken }; SECURITY_STATUS status = SEC_E_INTERNAL_ERROR; - WinPrAsn1Decoder dec, dec2; + WinPrAsn1Decoder dec; + WinPrAsn1Decoder dec2; WinPrAsn1_tagId tag; WinPrAsn1_OID oid = { 0 }; const Mech* first_mech = NULL; @@ -1371,7 +1373,8 @@ static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleW( void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) { - BOOL kerberos, ntlm; + BOOL kerberos; + BOOL ntlm; if (!negotiate_get_config(pAuthData, &kerberos, &ntlm)) return SEC_E_INTERNAL_ERROR; @@ -1412,7 +1415,8 @@ static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleA( void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry) { - BOOL kerberos, ntlm; + BOOL kerberos; + BOOL ntlm; if (!negotiate_get_config(pAuthData, &kerberos, &ntlm)) return SEC_E_INTERNAL_ERROR; diff --git a/winpr/libwinpr/sspi/sspi_gss.c b/winpr/libwinpr/sspi/sspi_gss.c index 9730c776c..0c9d45dbc 100644 --- a/winpr/libwinpr/sspi/sspi_gss.c +++ b/winpr/libwinpr/sspi/sspi_gss.c @@ -86,7 +86,8 @@ cleanup: BOOL sspi_gss_unwrap_token(const SecBuffer* buf, WinPrAsn1_OID* oid, uint16_t* tok_id, sspi_gss_data* token) { - WinPrAsn1Decoder dec, dec2; + WinPrAsn1Decoder dec; + WinPrAsn1Decoder dec2; WinPrAsn1_tagId tag; wStream sbuffer = { 0 }; wStream* s; diff --git a/winpr/libwinpr/synch/event.c b/winpr/libwinpr/synch/event.c index 65620eb36..f60113951 100644 --- a/winpr/libwinpr/synch/event.c +++ b/winpr/libwinpr/synch/event.c @@ -55,7 +55,8 @@ static wArrayList* global_event_list = NULL; static void dump_event(WINPR_EVENT* event, size_t index) { char** msg; - size_t used, i; + size_t used; + size_t i; #if 0 void* stack = winpr_backtrace(20); WLog_DBG(TAG, "Called from:"); diff --git a/winpr/libwinpr/synch/mutex.c b/winpr/libwinpr/synch/mutex.c index c2fc7af0a..2a912028b 100644 --- a/winpr/libwinpr/synch/mutex.c +++ b/winpr/libwinpr/synch/mutex.c @@ -69,7 +69,8 @@ BOOL MutexCloseHandle(HANDLE handle) winpr_strerror(rc, ebuffer, sizeof(ebuffer)), rc); #if defined(WITH_DEBUG_MUTEX) { - size_t used = 0, i; + size_t used = 0; + size_t i; void* stack = winpr_backtrace(20); char** msg = NULL; diff --git a/winpr/libwinpr/synch/pollset.c b/winpr/libwinpr/synch/pollset.c index f7bb380be..f08746a51 100644 --- a/winpr/libwinpr/synch/pollset.c +++ b/winpr/libwinpr/synch/pollset.c @@ -121,7 +121,8 @@ int pollset_poll(WINPR_POLL_SET* set, DWORD dwMilliseconds) { WINPR_ASSERT(set); int ret = 0; - UINT64 dueTime, now; + UINT64 dueTime; + UINT64 now; now = GetTickCount64(); if (dwMilliseconds == INFINITE) diff --git a/winpr/libwinpr/synch/test/TestSynchBarrier.c b/winpr/libwinpr/synch/test/TestSynchBarrier.c index 67a661229..9d4c6a86e 100644 --- a/winpr/libwinpr/synch/test/TestSynchBarrier.c +++ b/winpr/libwinpr/synch/test/TestSynchBarrier.c @@ -63,7 +63,9 @@ static BOOL TestSynchBarrierWithFlags(DWORD dwFlags, DWORD dwThreads, DWORD dwLo { HANDLE* threads; struct test_params p; - DWORD dwStatus, expectedTrueCount, expectedFalseCount; + DWORD dwStatus; + DWORD expectedTrueCount; + DWORD expectedFalseCount; DWORD i; p.threadCount = 0; p.trueCount = 0; diff --git a/winpr/libwinpr/synch/test/TestSynchCritical.c b/winpr/libwinpr/synch/test/TestSynchCritical.c index ec6c2c2e0..0ed5de315 100644 --- a/winpr/libwinpr/synch/test/TestSynchCritical.c +++ b/winpr/libwinpr/synch/test/TestSynchCritical.c @@ -44,7 +44,9 @@ static BOOL TestSynchCritical_TriggerAndCheckRaceCondition(HANDLE OwningThread, * FALSE */ static DWORD WINAPI TestSynchCritical_Test1(LPVOID arg) { - int i, j, rc; + int i; + int j; + int rc; HANDLE hThread = (HANDLE)(ULONG_PTR)GetCurrentThreadId(); PBOOL pbContinueRunning = (PBOOL)arg; @@ -97,7 +99,8 @@ static DWORD WINAPI TestSynchCritical_Test2(LPVOID arg) static DWORD WINAPI TestSynchCritical_Main(LPVOID arg) { - int i, j; + int i; + int j; SYSTEM_INFO sysinfo; DWORD dwPreviousSpinCount; DWORD dwSpinCount; diff --git a/winpr/libwinpr/synch/test/TestSynchMutex.c b/winpr/libwinpr/synch/test/TestSynchMutex.c index 56344f1b4..35d0b3fd2 100644 --- a/winpr/libwinpr/synch/test/TestSynchMutex.c +++ b/winpr/libwinpr/synch/test/TestSynchMutex.c @@ -46,7 +46,9 @@ static BOOL test_mutex_basic(void) static BOOL test_mutex_recursive(void) { HANDLE mutex; - DWORD rc, i, cnt = 50; + DWORD rc; + DWORD i; + DWORD cnt = 50; if (!(mutex = CreateMutex(NULL, TRUE, NULL))) { diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index b04aaef90..4b0a535ff 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -359,7 +359,8 @@ DWORD WaitForMultipleObjectsEx(DWORD nCount, const HANDLE* lpHandles, BOOL bWait WINPR_POLL_SET pollset = { 0 }; DWORD ret = WAIT_FAILED; size_t extraFds = 0; - UINT64 now = 0, dueTime = 0; + UINT64 now = 0; + UINT64 dueTime = 0; if (!nCount || (nCount > MAXIMUM_WAIT_OBJECTS)) { diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c index 9693ec4b7..a1783cc3a 100644 --- a/winpr/libwinpr/sysinfo/sysinfo.c +++ b/winpr/libwinpr/sysinfo/sysinfo.c @@ -817,7 +817,10 @@ BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature) #endif // __linux__ #elif defined(_M_IX86_AMD64) #ifdef __GNUC__ - unsigned a, b, c, d; + unsigned a; + unsigned b; + unsigned c; + unsigned d; cpuid(1, &a, &b, &c, &d); switch (ProcessorFeature) @@ -945,14 +948,20 @@ BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature) #endif // __linux__ #elif defined(_M_IX86_AMD64) - unsigned a, b, c, d; + unsigned a; + unsigned b; + unsigned c; + unsigned d; cpuid(1, &a, &b, &c, &d); switch (ProcessorFeature) { case PF_EX_LZCNT: { - unsigned a81, b81, c81, d81; + unsigned a81; + unsigned b81; + unsigned c81; + unsigned d81; cpuid(0x80000001, &a81, &b81, &c81, &d81); if (c81 & C81_BIT_LZCNT) @@ -1000,7 +1009,8 @@ BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature) if (!(c & C_BIT_XGETBV)) break; - int e, f; + int e; + int f; xgetbv(0, e, f); /* XGETBV enabled for applications and XMM/YMM states enabled */ diff --git a/winpr/libwinpr/thread/apc.c b/winpr/libwinpr/thread/apc.c index b66ea76b4..0d655a9c4 100644 --- a/winpr/libwinpr/thread/apc.c +++ b/winpr/libwinpr/thread/apc.c @@ -187,7 +187,8 @@ out: int apc_executeCompletions(WINPR_THREAD* thread, WINPR_POLL_SET* set, size_t idx) { APC_QUEUE* apc; - WINPR_APC_ITEM *item, *nextItem; + WINPR_APC_ITEM* item; + WINPR_APC_ITEM* nextItem; int ret = 0; WINPR_ASSERT(thread); diff --git a/winpr/libwinpr/thread/thread.c b/winpr/libwinpr/thread/thread.c index fcc83e4da..b54d4f1af 100644 --- a/winpr/libwinpr/thread/thread.c +++ b/winpr/libwinpr/thread/thread.c @@ -362,7 +362,8 @@ static void dump_thread(WINPR_THREAD* thread) #if defined(WITH_DEBUG_THREADS) void* stack = winpr_backtrace(20); char** msg; - size_t used, i; + size_t used; + size_t i; WLog_DBG(TAG, "Called from:"); msg = winpr_backtrace_symbols(stack, &used); @@ -979,7 +980,8 @@ VOID DumpThreadHandles(void) { #if defined(WITH_DEBUG_THREADS) char** msg; - size_t used, i; + size_t used; + size_t i; void* stack = winpr_backtrace(20); WLog_DBG(TAG, "---------------- Called from ----------------------------"); msg = winpr_backtrace_symbols(stack, &used); diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c index 62da9b171..fc7a276f3 100644 --- a/winpr/libwinpr/timezone/timezone.c +++ b/winpr/libwinpr/timezone/timezone.c @@ -54,7 +54,9 @@ static UINT64 winpr_windows_gmtime(void) static char* winpr_read_unix_timezone_identifier_from_file(FILE* fp) { const INT CHUNK_SIZE = 32; - INT64 rc, read = 0, length = CHUNK_SIZE; + INT64 rc; + INT64 read = 0; + INT64 length = CHUNK_SIZE; char* tzid = NULL; tzid = (char*)malloc(length); @@ -294,8 +296,10 @@ static BOOL winpr_match_unix_timezone_identifier_with_list(const char* tzid, con static TIME_ZONE_ENTRY* winpr_detect_windows_time_zone(void) { - size_t i, j; - char *tzid = NULL, *ntzid = NULL; + size_t i; + size_t j; + char* tzid = NULL; + char* ntzid = NULL; LPCSTR tz = "TZ"; DWORD nSize = GetEnvironmentVariableA(tz, NULL, 0); diff --git a/winpr/libwinpr/utils/asn1/asn1.c b/winpr/libwinpr/utils/asn1/asn1.c index 18c569cbf..721abfe23 100644 --- a/winpr/libwinpr/utils/asn1/asn1.c +++ b/winpr/libwinpr/utils/asn1/asn1.c @@ -390,8 +390,11 @@ BOOL WinPrAsn1EncContextualOctetStringContainer(WinPrAsn1Encoder* enc, WinPrAsn1 size_t WinPrAsn1EncEndContainer(WinPrAsn1Encoder* enc) { - size_t innerLen, i, unused; - size_t innerHeaderBytes, outerHeaderBytes; + size_t innerLen; + size_t i; + size_t unused; + size_t innerHeaderBytes; + size_t outerHeaderBytes; BYTE containerByte = 0; WinPrAsn1EncContainer* container; Asn1Chunk* chunk; @@ -578,7 +581,8 @@ static size_t WinPrAsn1EncContextualIntegerLike(WinPrAsn1Encoder* enc, WinPrAsn1 { wStream staticS; wStream* s = &staticS; - size_t len, outLen; + size_t len; + size_t outLen; WINPR_ASSERT(enc); WINPR_ASSERT_VALID_TAG(tagId); @@ -711,7 +715,8 @@ static size_t WinPrAsn1EncContextualMemoryChunk(WinPrAsn1Encoder* enc, BYTE wire const WinPrAsn1_MemoryChunk* mchunk) { wStream s; - size_t len, outLen; + size_t len; + size_t outLen; WINPR_ASSERT(enc); WINPR_ASSERT_VALID_TAG(tagId); @@ -1369,7 +1374,8 @@ static size_t readContextualHeader(WinPrAsn1Decoder* dec, WinPrAsn1_tagId tagId, size_t WinPrAsn1DecReadContextualBool(WinPrAsn1Decoder* dec, WinPrAsn1_tagId tagId, BOOL* error, WinPrAsn1_BOOL* target) { - size_t ret, ret2; + size_t ret; + size_t ret2; WinPrAsn1Decoder content; ret = readContextualHeader(dec, tagId, error, &content); @@ -1390,7 +1396,8 @@ size_t WinPrAsn1DecReadContextualBool(WinPrAsn1Decoder* dec, WinPrAsn1_tagId tag size_t WinPrAsn1DecReadContextualInteger(WinPrAsn1Decoder* dec, WinPrAsn1_tagId tagId, BOOL* error, WinPrAsn1_INTEGER* target) { - size_t ret, ret2; + size_t ret; + size_t ret2; WinPrAsn1Decoder content; ret = readContextualHeader(dec, tagId, error, &content); @@ -1411,7 +1418,8 @@ size_t WinPrAsn1DecReadContextualInteger(WinPrAsn1Decoder* dec, WinPrAsn1_tagId size_t WinPrAsn1DecReadContextualOID(WinPrAsn1Decoder* dec, WinPrAsn1_tagId tagId, BOOL* error, WinPrAsn1_OID* target, BOOL allocate) { - size_t ret, ret2; + size_t ret; + size_t ret2; WinPrAsn1Decoder content; ret = readContextualHeader(dec, tagId, error, &content); @@ -1433,7 +1441,8 @@ size_t WinPrAsn1DecReadContextualOctetString(WinPrAsn1Decoder* dec, WinPrAsn1_ta BOOL* error, WinPrAsn1_OctetString* target, BOOL allocate) { - size_t ret, ret2; + size_t ret; + size_t ret2; WinPrAsn1Decoder content; ret = readContextualHeader(dec, tagId, error, &content); @@ -1454,7 +1463,8 @@ size_t WinPrAsn1DecReadContextualOctetString(WinPrAsn1Decoder* dec, WinPrAsn1_ta size_t WinPrAsn1DecReadContextualSequence(WinPrAsn1Decoder* dec, WinPrAsn1_tagId tagId, BOOL* error, WinPrAsn1Decoder* target) { - size_t ret, ret2; + size_t ret; + size_t ret2; WinPrAsn1Decoder content; ret = readContextualHeader(dec, tagId, error, &content); diff --git a/winpr/libwinpr/utils/cmdline.c b/winpr/libwinpr/utils/cmdline.c index 15c33e5e7..19b560116 100644 --- a/winpr/libwinpr/utils/cmdline.c +++ b/winpr/libwinpr/utils/cmdline.c @@ -57,7 +57,8 @@ int CommandLineParseArgumentsA(int argc, LPSTR* argv, COMMAND_LINE_ARGUMENT_A* o void* context, COMMAND_LINE_PRE_FILTER_FN_A preFilter, COMMAND_LINE_POST_FILTER_FN_A postFilter) { - int i, j; + int i; + int j; int status; int count; size_t length; @@ -672,7 +673,8 @@ char** CommandLineParseCommaSeparatedValuesEx(const char* name, const char* list *count = 0; if (list) { - int start, end; + int start; + int end; unquoted = copy = _strdup(list); if (!copy) goto fail; diff --git a/winpr/libwinpr/utils/collections/ArrayList.c b/winpr/libwinpr/utils/collections/ArrayList.c index 19091d2e7..c8b9a300a 100644 --- a/winpr/libwinpr/utils/collections/ArrayList.c +++ b/winpr/libwinpr/utils/collections/ArrayList.c @@ -433,7 +433,9 @@ BOOL ArrayList_RemoveAt(wArrayList* arrayList, size_t index) SSIZE_T ArrayList_IndexOf(wArrayList* arrayList, const void* obj, SSIZE_T startIndex, SSIZE_T count) { - SSIZE_T index, sindex, cindex; + SSIZE_T index; + SSIZE_T sindex; + SSIZE_T cindex; BOOL found = FALSE; WINPR_ASSERT(arrayList); @@ -480,7 +482,9 @@ SSIZE_T ArrayList_IndexOf(wArrayList* arrayList, const void* obj, SSIZE_T startI SSIZE_T ArrayList_LastIndexOf(wArrayList* arrayList, const void* obj, SSIZE_T startIndex, SSIZE_T count) { - SSIZE_T index, sindex, cindex; + SSIZE_T index; + SSIZE_T sindex; + SSIZE_T cindex; BOOL found = FALSE; WINPR_ASSERT(arrayList); @@ -535,7 +539,8 @@ BOOL ArrayList_ForEach(wArrayList* arrayList, ArrayList_ForEachFkt fkt, ...) BOOL ArrayList_ForEachAP(wArrayList* arrayList, ArrayList_ForEachFkt fkt, va_list ap) { - size_t index, count; + size_t index; + size_t count; BOOL rc = FALSE; va_list cap; diff --git a/winpr/libwinpr/utils/debug.c b/winpr/libwinpr/utils/debug.c index ccce746f9..4111ff871 100644 --- a/winpr/libwinpr/utils/debug.c +++ b/winpr/libwinpr/utils/debug.c @@ -201,7 +201,8 @@ void winpr_log_backtrace(const char* tag, DWORD level, DWORD size) void winpr_log_backtrace_ex(wLog* log, DWORD level, DWORD size) { - size_t used, x; + size_t used; + size_t x; char** msg; void* stack = winpr_backtrace(20); diff --git a/winpr/libwinpr/utils/ini.c b/winpr/libwinpr/utils/ini.c index fee7df64d..8b64fc127 100644 --- a/winpr/libwinpr/utils/ini.c +++ b/winpr/libwinpr/utils/ini.c @@ -428,7 +428,8 @@ static int IniFile_Load(wIniFile* ini) char* name; char* value; char* separator; - char *beg, *end; + char* beg; + char* end; wIniFileSection* section = NULL; WINPR_ASSERT(ini); diff --git a/winpr/libwinpr/utils/print.c b/winpr/libwinpr/utils/print.c index de272a909..59a0de220 100644 --- a/winpr/libwinpr/utils/print.c +++ b/winpr/libwinpr/utils/print.c @@ -43,7 +43,9 @@ void winpr_HexDump(const char* tag, UINT32 level, const void* data, size_t lengt void winpr_HexLogDump(wLog* log, UINT32 lvl, const void* data, size_t length) { const BYTE* p = data; - size_t i, line, offset = 0; + size_t i; + size_t line; + size_t offset = 0; const size_t maxlen = 20; /* 64bit SIZE_MAX as decimal */ /* String line length: * prefix '[1234] ' @@ -132,7 +134,8 @@ fail: void winpr_CArrayDump(const char* tag, UINT32 level, const void* data, size_t length, size_t width) { const BYTE* p = data; - size_t i, offset = 0; + size_t i; + size_t offset = 0; const size_t llen = ((length > width) ? width : length) * 4ull + 1ull; size_t pos; char* buffer = malloc(llen); @@ -184,7 +187,8 @@ static BYTE value(char c) size_t winpr_HexStringToBinBuffer(const char* str, size_t strLength, BYTE* data, size_t dataLength) { - size_t x, y = 0; + size_t x; + size_t y = 0; size_t maxStrLen; if (!str || !data || (strLength == 0) || (dataLength == 0)) return 0; diff --git a/winpr/libwinpr/utils/test/TestASN1.c b/winpr/libwinpr/utils/test/TestASN1.c index 4c65d26b0..b06c67715 100644 --- a/winpr/libwinpr/utils/test/TestASN1.c +++ b/winpr/libwinpr/utils/test/TestASN1.c @@ -28,7 +28,8 @@ static const BYTE utctimeContent[] = { 0x17, 0x0D, 0x32, 0x31, 0x30, 0x33, 0x31, int TestASN1Read(int argc, char* argv[]) { - WinPrAsn1Decoder decoder, seqDecoder; + WinPrAsn1Decoder decoder; + WinPrAsn1Decoder seqDecoder; wStream staticS; WinPrAsn1_BOOL boolV; WinPrAsn1_INTEGER integerV; diff --git a/winpr/libwinpr/utils/test/TestBacktrace.c b/winpr/libwinpr/utils/test/TestBacktrace.c index c4c7dc15e..7c9039af1 100644 --- a/winpr/libwinpr/utils/test/TestBacktrace.c +++ b/winpr/libwinpr/utils/test/TestBacktrace.c @@ -4,7 +4,8 @@ int TestBacktrace(int argc, char* argv[]) { int rc = -1; - size_t used, x; + size_t used; + size_t x; char** msg; void* stack = winpr_backtrace(20); diff --git a/winpr/libwinpr/utils/test/TestBitStream.c b/winpr/libwinpr/utils/test/TestBitStream.c index bceb052f7..268a005d0 100644 --- a/winpr/libwinpr/utils/test/TestBitStream.c +++ b/winpr/libwinpr/utils/test/TestBitStream.c @@ -6,7 +6,8 @@ static void BitStrGen(void) { - DWORD i, j; + DWORD i; + DWORD j; char str[64]; for (i = 0; i < 256;) diff --git a/winpr/libwinpr/utils/test/TestPrint.c b/winpr/libwinpr/utils/test/TestPrint.c index e709439d2..9f04574ac 100644 --- a/winpr/libwinpr/utils/test/TestPrint.c +++ b/winpr/libwinpr/utils/test/TestPrint.c @@ -302,8 +302,10 @@ fail: int TestPrint(int argc, char* argv[]) { - int a, b; - float c, d; + int a; + int b; + float c; + float d; WINPR_UNUSED(argc); WINPR_UNUSED(argv); diff --git a/winpr/libwinpr/utils/test/TestStream.c b/winpr/libwinpr/utils/test/TestStream.c index 45484a574..947c26cf2 100644 --- a/winpr/libwinpr/utils/test/TestStream.c +++ b/winpr/libwinpr/utils/test/TestStream.c @@ -90,7 +90,8 @@ static BOOL TestStream_New(void) static BOOL TestStream_Static(void) { BYTE buffer[20]; - wStream staticStream, *s = &staticStream; + wStream staticStream; + wStream* s = &staticStream; UINT16 v; /* Test creation of a static stream */ Stream_StaticInit(s, buffer, sizeof(buffer)); @@ -129,7 +130,10 @@ static BOOL TestStream_Static(void) static BOOL TestStream_Create(size_t count, BOOL selfAlloc) { - size_t i, len, cap, pos; + size_t i; + size_t len; + size_t cap; + size_t pos; wStream* s = NULL; void* buffer = NULL; @@ -250,8 +254,8 @@ fail: #define TestStream_PeekAndRead(_s, _r, _t) \ do \ { \ - _t _a, _b; \ - size_t _i; \ + _t _a; \ + _t _b; \ BYTE* _p = Stream_Buffer(_s); \ Stream_SetPosition(_s, 0); \ Stream_Peek_##_t(_s, _a); \ @@ -261,7 +265,7 @@ fail: printf("%s: test1 " #_t "_LE failed\n", __func__); \ _r = FALSE; \ } \ - for (_i = 0; _i < sizeof(_t); _i++) \ + for (size_t _i = 0; _i < sizeof(_t); _i++) \ { \ if (((_a >> (_i * 8)) & 0xFF) != _p[_i]) \ { \ @@ -279,7 +283,7 @@ fail: printf("%s: test1 " #_t "_BE failed\n", __func__); \ _r = FALSE; \ } \ - for (_i = 0; _i < sizeof(_t); _i++) \ + for (size_t _i = 0; _i < sizeof(_t); _i++) \ { \ if (((_a >> (_i * 8)) & 0xFF) != _p[sizeof(_t) - _i - 1]) \ { \ diff --git a/winpr/libwinpr/utils/test/TestVersion.c b/winpr/libwinpr/utils/test/TestVersion.c index 77225bda2..b6828f281 100644 --- a/winpr/libwinpr/utils/test/TestVersion.c +++ b/winpr/libwinpr/utils/test/TestVersion.c @@ -9,7 +9,9 @@ int TestVersion(int argc, char* argv[]) const char* version; const char* git; const char* build; - int major = 0, minor = 0, revision = 0; + int major = 0; + int minor = 0; + int revision = 0; WINPR_UNUSED(argc); WINPR_UNUSED(argv); winpr_get_version(&major, &minor, &revision); diff --git a/winpr/libwinpr/utils/wlog/wlog.c b/winpr/libwinpr/utils/wlog/wlog.c index 341055cce..8f535aeb0 100644 --- a/winpr/libwinpr/utils/wlog/wlog.c +++ b/winpr/libwinpr/utils/wlog/wlog.c @@ -179,7 +179,8 @@ static BOOL log_recursion(LPCSTR file, LPCSTR fkt, size_t line) { BOOL status = FALSE; char** msg = NULL; - size_t used, i; + size_t used; + size_t i; void* bt = winpr_backtrace(20); #if defined(ANDROID) LPCSTR tag = WINPR_TAG("utils.wlog"); @@ -741,7 +742,8 @@ BOOL WLog_ParseFilters(wLog* root) LONG WLog_GetFilterLogLevel(wLog* log) { - DWORD i, j; + DWORD i; + DWORD j; BOOL match = FALSE; if (log->FilterLevel >= 0) diff --git a/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c b/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c index a26873bfd..ee1e30005 100644 --- a/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c +++ b/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c @@ -6,7 +6,8 @@ int TestWtsApiQuerySessionInformation(int argc, char* argv[]) { - DWORD index, i; + DWORD index; + DWORD i; DWORD count; BOOL bSuccess; HANDLE hServer;