From 3b1c1e0af1edfb59d43199246165b64b686c3269 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 27 Aug 2024 15:51:48 +0200 Subject: [PATCH] [warnings] fix cppcoreguidelines-init-variables --- libfreerdp/gdi/gdi.h | 4 ++-- libfreerdp/primitives/prim_internal.h | 2 +- winpr/include/winpr/stream.h | 2 +- winpr/libwinpr/handle/handle.h | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libfreerdp/gdi/gdi.h b/libfreerdp/gdi/gdi.h index fb653e711..d39b18a44 100644 --- a/libfreerdp/gdi/gdi.h +++ b/libfreerdp/gdi/gdi.h @@ -32,7 +32,7 @@ FREERDP_LOCAL void gdi_bitmap_free_ex(gdiBitmap* gdi_bmp); static INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, INT32 x, INT32 y) { - BYTE* p; + BYTE* p = NULL; HGDI_BITMAP hBmp = (HGDI_BITMAP)hdcBmp->selectedObject; if ((x >= 0) && (y >= 0) && (x < hBmp->width) && (y < hBmp->height)) @@ -59,7 +59,7 @@ static INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, INT32 x, INT32 y) */ static INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, UINT32 x, UINT32 y) { - BYTE* p; + BYTE* p = NULL; UINT32 brushStyle = gdi_GetBrushStyle(hdcBrush); switch (brushStyle) diff --git a/libfreerdp/primitives/prim_internal.h b/libfreerdp/primitives/prim_internal.h index 6bafc59d8..08aed533e 100644 --- a/libfreerdp/primitives/prim_internal.h +++ b/libfreerdp/primitives/prim_internal.h @@ -228,7 +228,7 @@ static INLINE BYTE CLIP(INT64 X) static INLINE BYTE CONDITIONAL_CLIP(INT32 in, BYTE original) { BYTE out = CLIP(in); - BYTE diff; + BYTE diff = 0; if (out > original) diff = out - original; else diff --git a/winpr/include/winpr/stream.h b/winpr/include/winpr/stream.h index 6dd5a0ee4..7a86d86ea 100644 --- a/winpr/include/winpr/stream.h +++ b/winpr/include/winpr/stream.h @@ -131,7 +131,7 @@ extern "C" static INLINE void Stream_Rewind(wStream* s, size_t _offset) { - size_t cur; + size_t cur = 0; WINPR_ASSERT(s); WINPR_ASSERT(s->buffer <= s->pointer); cur = WINPR_STREAM_CAST(size_t, s->pointer - s->buffer); diff --git a/winpr/libwinpr/handle/handle.h b/winpr/libwinpr/handle/handle.h index dda6d35a8..5abe218dc 100644 --- a/winpr/libwinpr/handle/handle.h +++ b/winpr/libwinpr/handle/handle.h @@ -143,7 +143,7 @@ static INLINE void WINPR_HANDLE_SET_TYPE_AND_MODE(void* _handle, ULONG _type, UL static INLINE BOOL winpr_Handle_GetInfo(HANDLE handle, ULONG* pType, WINPR_HANDLE** pObject) { - WINPR_HANDLE* wHandle; + WINPR_HANDLE* wHandle = NULL; if (handle == NULL) return FALSE; @@ -165,8 +165,8 @@ static INLINE BOOL winpr_Handle_GetInfo(HANDLE handle, ULONG* pType, WINPR_HANDL static INLINE int winpr_Handle_getFd(HANDLE handle) { - WINPR_HANDLE* hdl; - ULONG type; + WINPR_HANDLE* hdl = NULL; + ULONG type = 0; if (!winpr_Handle_GetInfo(handle, &type, &hdl)) return -1; @@ -179,8 +179,8 @@ static INLINE int winpr_Handle_getFd(HANDLE handle) static INLINE DWORD winpr_Handle_cleanup(HANDLE handle) { - WINPR_HANDLE* hdl; - ULONG type; + WINPR_HANDLE* hdl = NULL; + ULONG type = 0; if (!winpr_Handle_GetInfo(handle, &type, &hdl)) return WAIT_FAILED;