[warnings] fix -Wunused-macro

comment or delete macros that were not used.
This commit is contained in:
akallabeth
2025-02-26 21:36:02 +01:00
parent ff3f4b3ce7
commit a520f845a3
17 changed files with 28 additions and 216 deletions

View File

@@ -71,10 +71,6 @@ static BOOL wlf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
wlfContext* wlf = (wlfContext*)context;
wlfPointer* ptr = (wlfPointer*)pointer;
void* data = NULL;
UINT32 w = 0;
UINT32 h = 0;
UINT32 x = 0;
UINT32 y = 0;
size_t size = 0;
UwacReturnCode rc = UWAC_ERROR_INTERNAL;
BOOL res = FALSE;
@@ -83,10 +79,10 @@ static BOOL wlf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
if (!wlf || !wlf->seat)
return FALSE;
x = pointer->xPos;
y = pointer->yPos;
w = pointer->width;
h = pointer->height;
UINT32 x = pointer->xPos;
UINT32 y = pointer->yPos;
UINT32 w = pointer->width;
UINT32 h = pointer->height;
if (!wlf_scale_coordinates(context, &x, &y, FALSE) ||
!wlf_scale_coordinates(context, &w, &h, FALSE))
@@ -148,7 +144,7 @@ static BOOL wlf_Pointer_SetPosition(WINPR_ATTR_UNUSED rdpContext* context,
WINPR_ATTR_UNUSED UINT32 x, WINPR_ATTR_UNUSED UINT32 y)
{
// TODO
WLog_ERR("TODO", "TODO: implement");
WLog_ERR(TAG, "TODO: implement");
return TRUE;
}

View File

@@ -77,15 +77,15 @@
// #define VGIDS_SE_ALGOID_CT_RSA_4096 0x09
#define VGIDS_SE_ALGOID_DST_PAD_PKCS1 0x40
#define VGIDS_SE_ALGOID_DST_RSA_1024 0x06
#define VGIDS_SE_ALGOID_DST_RSA_2048 0x07
#define VGIDS_SE_ALGOID_DST_RSA_3072 0x08
#define VGIDS_SE_ALGOID_DST_RSA_4096 0x09
#define VGIDS_SE_ALGOID_DST_ECDSA_P192 0x0A
#define VGIDS_SE_ALGOID_DST_ECDSA_P224 0x0B
#define VGIDS_SE_ALGOID_DST_ECDSA_P256 0x0C
#define VGIDS_SE_ALGOID_DST_ECDSA_P384 0x0D
#define VGIDS_SE_ALGOID_DST_ECDSA_P512 0x0E
// #define VGIDS_SE_ALGOID_DST_RSA_1024 0x06
// #define VGIDS_SE_ALGOID_DST_RSA_2048 0x07
// #define VGIDS_SE_ALGOID_DST_RSA_3072 0x08
// #define VGIDS_SE_ALGOID_DST_RSA_4096 0x09
// #define VGIDS_SE_ALGOID_DST_ECDSA_P192 0x0A
// #define VGIDS_SE_ALGOID_DST_ECDSA_P224 0x0B
// #define VGIDS_SE_ALGOID_DST_ECDSA_P256 0x0C
// #define VGIDS_SE_ALGOID_DST_ECDSA_P384 0x0D
// #define VGIDS_SE_ALGOID_DST_ECDSA_P512 0x0E
#define VGIDS_DEFAULT_KEY_REF 0x81

View File

@@ -33,14 +33,6 @@
static primitives_t* generic = NULL;
#ifdef __GNUC__
#define GNU_INLINE __attribute__((__gnu_inline__, __always_inline__, __artificial__))
#else
#define GNU_INLINE
#endif
#define CACHE_LINE_BYTES 64
/* 1.403 << 14 */
/* -0.344 << 14 */
/* -0.714 << 14 */
@@ -85,20 +77,6 @@ static inline __m128i mm_between_epi16_int(__m128i val, __m128i min, __m128i max
#define mm_between_epi16(_val, _min, _max) (_val) = mm_between_epi16_int((_val), (_min), (_max))
#ifdef DO_PREFETCH
/*---------------------------------------------------------------------------*/
static inline void GNU_INLINE _mm_prefetch_buffer(char* WINPR_RESTRICT buffer, int num_bytes)
{
__m128i* buf = (__m128i*)buffer;
for (unsigned int i = 0; i < (num_bytes / sizeof(__m128i));
i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&buf[i]), _MM_HINT_NTA);
}
}
#endif /* DO_PREFETCH */
/*---------------------------------------------------------------------------*/
static pstatus_t
sse2_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep,
@@ -133,28 +111,6 @@ sse2_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep,
__m128i c4096 = _mm_set1_epi16(4096);
const size_t srcbump = WINPR_ASSERTING_INT_CAST(size_t, srcStep) / sizeof(__m128i);
const size_t dstbump = WINPR_ASSERTING_INT_CAST(size_t, dstStep) / sizeof(__m128i);
#ifdef DO_PREFETCH
/* Prefetch Y's, Cb's, and Cr's. */
for (UINT32 yp = 0; yp < roi->height; yp++)
{
for (int i = 0; i < roi->width * sizeof(INT16) / sizeof(__m128i);
i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&y_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&cb_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&cr_buf[i]), _MM_HINT_NTA);
}
y_buf += srcbump;
cb_buf += srcbump;
cr_buf += srcbump;
}
y_buf = (__m128i*)(pSrc[0]);
cb_buf = (__m128i*)(pSrc[1]);
cr_buf = (__m128i*)(pSrc[2]);
#endif /* DO_PREFETCH */
const size_t imax = roi->width * sizeof(INT16) / sizeof(__m128i);
for (UINT32 yp = 0; yp < roi->height; ++yp)
@@ -246,27 +202,6 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3],
const size_t imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
BYTE* d_buf = pDst;
const size_t dstPad = (dstStep - roi->width * 4);
#ifdef DO_PREFETCH
/* Prefetch Y's, Cb's, and Cr's. */
for (UINT32 yp = 0; yp < roi->height; yp++)
{
for (size_t i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&((__m128i*)cr_buf)[i]), _MM_HINT_NTA);
}
y_buf += srcStep / sizeof(INT16);
cb_buf += srcStep / sizeof(INT16);
cr_buf += srcStep / sizeof(INT16);
}
y_buf = (INT16*)pSrc[0];
cb_buf = (INT16*)pSrc[1];
cr_buf = (INT16*)pSrc[2];
#endif /* DO_PREFETCH */
for (UINT32 yp = 0; yp < roi->height; ++yp)
{
@@ -432,27 +367,6 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* WINPR_RESTRICT pSrc[3],
const size_t imax = (roi->width - pad) * sizeof(INT16) / sizeof(__m128i);
BYTE* d_buf = pDst;
const size_t dstPad = (dstStep - roi->width * 4);
#ifdef DO_PREFETCH
/* Prefetch Y's, Cb's, and Cr's. */
for (UINT32 yp = 0; yp < roi->height; yp++)
{
for (size_t i = 0; i < imax; i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&((__m128i*)y_buf)[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&((__m128i*)cb_buf)[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&((__m128i*)cr_buf)[i]), _MM_HINT_NTA);
}
y_buf += srcStep / sizeof(INT16);
cb_buf += srcStep / sizeof(INT16);
cr_buf += srcStep / sizeof(INT16);
}
y_buf = (INT16*)(pSrc[0]);
cb_buf = (INT16*)(pSrc[1]);
cr_buf = (INT16*)(pSrc[2]);
#endif /* DO_PREFETCH */
for (UINT32 yp = 0; yp < roi->height; ++yp)
{
@@ -657,28 +571,7 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep,
__m128i cr_b = _mm_set1_epi16(-2663); /* -0.081282 << 15 */
const size_t srcbump = WINPR_ASSERTING_INT_CAST(size_t, srcStep) / sizeof(__m128i);
const size_t dstbump = WINPR_ASSERTING_INT_CAST(size_t, dstStep) / sizeof(__m128i);
#ifdef DO_PREFETCH
/* Prefetch RGB's. */
for (UINT32 yp = 0; yp < roi->height; yp++)
{
for (int i = 0; i < roi->width * sizeof(INT16) / sizeof(__m128i);
i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&r_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&g_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&b_buf[i]), _MM_HINT_NTA);
}
r_buf += srcbump;
g_buf += srcbump;
b_buf += srcbump;
}
r_buf = (__m128i*)(pSrc[0]);
g_buf = (__m128i*)(pSrc[1]);
b_buf = (__m128i*)(pSrc[2]);
#endif /* DO_PREFETCH */
const size_t imax = roi->width * sizeof(INT16) / sizeof(__m128i);
for (UINT32 yp = 0; yp < roi->height; ++yp)

View File

@@ -29,8 +29,6 @@
#include <freerdp/codec/color.h>
#if defined(SSE_AVX_INTRINSICS_ENABLED)
#define TAG FREERDP_TAG("primitives.copy")
#include <emmintrin.h>
#include <immintrin.h>

View File

@@ -30,8 +30,6 @@
#include <freerdp/codec/color.h>
#if defined(SSE_AVX_INTRINSICS_ENABLED)
#define TAG FREERDP_TAG("primitives.copy")
#include <emmintrin.h>
#include <immintrin.h>

View File

@@ -38,10 +38,6 @@
#include "../log.h"
#define TAG WINPR_TAG("crt")
#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif
#if defined(WITH_URIPARSER)
char* winpr_str_url_decode(const char* str, size_t len)
{

View File

@@ -29,17 +29,10 @@
#include <winpr/error.h>
#include <winpr/print.h>
#ifndef MIN
#define MIN(a, b) (a) < (b) ? (a) : (b)
#endif
#ifndef _WIN32
#include "unicode.h"
#include "../log.h"
#define TAG WINPR_TAG("unicode")
/**
* Notes on cross-platform Unicode portability:
*

View File

@@ -29,10 +29,6 @@
#include <winpr/error.h>
#include <winpr/print.h>
#ifndef MIN
#define MIN(a, b) (a) < (b) ? (a) : (b)
#endif
#include <unicode/ucnv.h>
#include <unicode/ustring.h>

View File

@@ -24,17 +24,12 @@
#include <winpr/crt.h>
#include <winpr/library.h>
#include <winpr/wlog.h>
#include <winpr/nt.h>
#include <winpr/endian.h>
#include "../log.h"
#define TAG WINPR_TAG("nt")
#ifndef _WIN32
#include <pthread.h>
#include <winpr/crt.h>
#include "../handle/handle.h"

View File

@@ -27,7 +27,9 @@
#include <winpr/path.h>
#include <winpr/file.h>
#if defined(WITH_RESOURCE_VERSIONING)
#define STR(x) #x
#endif
#define PATH_SLASH_CHR '/'
#define PATH_SLASH_STR "/"
@@ -59,18 +61,6 @@
#define PATH_SEPARATOR_STR_W PATH_SLASH_STR_W
#endif
#define SHARED_LIBRARY_EXT_DLL "dll"
#define SHARED_LIBRARY_EXT_SO "so"
#define SHARED_LIBRARY_EXT_DYLIB "dylib"
#ifdef _WIN32
#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DLL
#elif defined(__APPLE__)
#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_DYLIB
#else
#define SHARED_LIBRARY_EXT SHARED_LIBRARY_EXT_SO
#endif
#include "../log.h"
#define TAG WINPR_TAG("path")

View File

@@ -34,8 +34,10 @@
#include "ntlm_av_pairs.h"
#if defined(WITH_DEBUG_NTLM)
#include "../../log.h"
#define TAG WINPR_TAG("sspi.NTLM")
#endif
static BOOL ntlm_av_pair_get_next_offset(const NTLM_AV_PAIR* pAvPair, size_t size, size_t* pOffset);

View File

@@ -26,9 +26,11 @@
#define SSPI_EXPORT __declspec(dllexport)
#else
#include <winpr/winpr.h>
#if defined(SSPI_DLL)
#define SEC_ENTRY
#define SSPI_EXPORT WINPR_API
#endif
#endif
#ifdef _WIN32
typedef long LONG;

View File

@@ -84,9 +84,6 @@ static const SecurityFunctionTableW_NAME SecurityFunctionTableW_NAME_LIST[] = {
{ BUFFER_NAME_LIST_W[4], &SCHANNEL_SecurityFunctionTableW }
};
#define SecHandle_LOWER_MAX 0xFFFFFFFF
#define SecHandle_UPPER_MAX 0xFFFFFFFE
typedef struct
{
void* contextBuffer;

View File

@@ -670,10 +670,10 @@ UINT64 winpr_GetUnixTimeNS(void)
#define D_BIT_SSE (1 << 25)
#define D_BIT_SSE2 (1 << 26)
#define D_BIT_3DN (1 << 30)
#define C_BIT_SSE3 (1 << 0)
// #define C_BIT_SSE3 (1 << 0)
#define C_BIT_PCLMULQDQ (1 << 1)
#define C81_BIT_LZCNT (1 << 5)
#define C_BIT_3DNP (1 << 8)
// #define C_BIT_3DNP (1 << 8)
#define C_BIT_3DNP (1 << 8)
#define C_BIT_SSSE3 (1 << 9)
#define C_BIT_SSE41 (1 << 19)

View File

@@ -32,10 +32,6 @@
#define TAG WINPR_TAG("timezone")
#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif
#include "TimeZoneNameMap.h"
#include "TimeZoneIanaAbbrevMap.h"

View File

@@ -56,41 +56,7 @@ WINPR_PRAGMA_DIAG_POP
#include <winpr/wlog.h>
#include <winpr/debug.h>
#ifndef MIN
#define MIN(a, b) (a) < (b) ? (a) : (b)
#endif
#define TAG "com.winpr.utils.debug"
#define LOGT(...) \
do \
{ \
WLog_Print(WLog_Get(TAG), WLOG_TRACE, __VA_ARGS__); \
} while (0)
#define LOGD(...) \
do \
{ \
WLog_Print(WLog_Get(TAG), WLOG_DEBUG, __VA_ARGS__); \
} while (0)
#define LOGI(...) \
do \
{ \
WLog_Print(WLog_Get(TAG), WLOG_INFO, __VA_ARGS__); \
} while (0)
#define LOGW(...) \
do \
{ \
WLog_Print(WLog_Get(TAG), WLOG_WARN, __VA_ARGS__); \
} while (0)
#define LOGE(...) \
do \
{ \
WLog_Print(WLog_Get(TAG), WLOG_ERROR, __VA_ARGS__); \
} while (0)
#define LOGF(...) \
do \
{ \
WLog_Print(WLog_Get(TAG), WLOG_FATAL, __VA_ARGS__); \
} while (0)
static const char* support_msg = "Invalid stacktrace buffer! check if platform is supported!";
@@ -109,7 +75,7 @@ void winpr_backtrace_free(void* buffer)
winpr_win_backtrace_free(buffer);
#else
free(buffer);
LOGF(support_msg);
WLog_FATAL(TAG, "%s", support_msg);
#endif
}
@@ -124,7 +90,7 @@ void* winpr_backtrace(DWORD size)
#elif (defined(_WIN32) || defined(_WIN64)) && !defined(_UWP)
return winpr_win_backtrace(size);
#else
LOGF(support_msg);
WLog_FATAL(TAG, "%s", support_msg);
/* return a non NULL buffer to allow the backtrace function family to succeed without failing
*/
return _strdup(support_msg);
@@ -138,7 +104,7 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used)
if (!buffer)
{
LOGF(support_msg);
WLog_FATAL(TAG, "%s", support_msg);
return NULL;
}
@@ -151,7 +117,7 @@ char** winpr_backtrace_symbols(void* buffer, size_t* used)
#elif (defined(_WIN32) || defined(_WIN64)) && !defined(_UWP)
return winpr_win_backtrace_symbols(buffer, used);
#else
LOGF(support_msg);
WLog_FATAL(TAG, "%s", support_msg);
/* We return a char** on heap that is compatible with free:
*
@@ -177,7 +143,7 @@ void winpr_backtrace_symbols_fd(void* buffer, int fd)
{
if (!buffer)
{
LOGF(support_msg);
WLog_FATAL(TAG, "%s", support_msg);
return;
}
@@ -196,7 +162,7 @@ void winpr_backtrace_symbols_fd(void* buffer, int fd)
free((void*)lines);
}
#else
LOGF(support_msg);
WLog_FATAL(TAG, "%s", support_msg);
#endif
}

View File

@@ -25,9 +25,6 @@
#include <winpr/file.h>
#include "../../log.h"
#define TAG WINPR_TAG("utils.wlog")
BOOL WLog_DataMessage_Write(const char* filename, const void* data, size_t length)
{
FILE* fp = NULL;
@@ -36,10 +33,7 @@ BOOL WLog_DataMessage_Write(const char* filename, const void* data, size_t lengt
fp = winpr_fopen(filename, "w+b");
if (!fp)
{
// WLog_ERR(TAG, "failed to open file %s", filename);
return FALSE;
}
if (fwrite(data, length, 1, fp) != 1)
ret = FALSE;