mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
Merge pull request #12368 from akallabeth/3.23.0-warning-fixes
3.23.0 warning fixes
This commit is contained in:
@@ -24,6 +24,12 @@
|
||||
#define FREERDP_CHANNEL_CLIPRDR_CLIENT_FORMAT_H
|
||||
|
||||
#include <winpr/wtypes.h>
|
||||
#include <winpr/stream.h>
|
||||
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/channels/cliprdr.h>
|
||||
|
||||
#include "cliprdr_main.h"
|
||||
|
||||
WINPR_ATTR_NODISCARD
|
||||
FREERDP_LOCAL
|
||||
|
||||
@@ -1696,7 +1696,7 @@ static BOOL rdpdr_check_channel_state(rdpdrPlugin* rdpdr, UINT16 packetid)
|
||||
* then reinitialize the channel after login successful
|
||||
*/
|
||||
if (!rdpdr_state_advance(rdpdr, RDPDR_CHANNEL_STATE_INITIAL))
|
||||
return ERROR_INVALID_STATE;
|
||||
return FALSE;
|
||||
return rdpdr_state_check(rdpdr, packetid, RDPDR_CHANNEL_STATE_ANNOUNCE, 1,
|
||||
RDPDR_CHANNEL_STATE_INITIAL);
|
||||
case PAKID_CORE_SERVER_CAPABILITY:
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "rdpgfx_main.h"
|
||||
|
||||
FREERDP_LOCAL
|
||||
WINPR_ATTR_NODISCARD
|
||||
FREERDP_LOCAL UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd);
|
||||
|
||||
#endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_CODEC_H */
|
||||
|
||||
@@ -102,7 +102,7 @@ extern "C"
|
||||
* @param availableBytes On output, the number of bytes ready for reading
|
||||
* @return Pointer to the first bytes ready for reading, or NULL if buffer is empty
|
||||
*/
|
||||
static __inline__ __attribute__((always_inline)) void*
|
||||
static inline __attribute__((always_inline)) void*
|
||||
TPCircularBufferTail(TPCircularBuffer* buffer, int32_t* availableBytes)
|
||||
{
|
||||
*availableBytes = buffer->fillCount;
|
||||
@@ -119,7 +119,7 @@ extern "C"
|
||||
* @param buffer Circular buffer
|
||||
* @param amount Number of bytes to consume
|
||||
*/
|
||||
static __inline__ __attribute__((always_inline)) void
|
||||
static inline __attribute__((always_inline)) void
|
||||
TPCircularBufferConsume(TPCircularBuffer* buffer, int32_t amount)
|
||||
{
|
||||
buffer->tail = (buffer->tail + amount) % buffer->length;
|
||||
@@ -131,7 +131,7 @@ extern "C"
|
||||
* Version of TPCircularBufferConsume without the memory barrier, for more optimal use in
|
||||
* single-threaded contexts
|
||||
*/
|
||||
static __inline__ __attribute__((always_inline)) void
|
||||
static inline __attribute__((always_inline)) void
|
||||
TPCircularBufferConsumeNoBarrier(TPCircularBuffer* buffer, int32_t amount)
|
||||
{
|
||||
buffer->tail = (buffer->tail + amount) % buffer->length;
|
||||
@@ -149,7 +149,7 @@ extern "C"
|
||||
* @param availableBytes On output, the number of bytes ready for writing
|
||||
* @return Pointer to the first bytes ready for writing, or NULL if buffer is full
|
||||
*/
|
||||
static __inline__ __attribute__((always_inline)) void*
|
||||
static inline __attribute__((always_inline)) void*
|
||||
TPCircularBufferHead(TPCircularBuffer* buffer, int32_t* availableBytes)
|
||||
{
|
||||
*availableBytes = (buffer->length - buffer->fillCount);
|
||||
@@ -168,7 +168,7 @@ extern "C"
|
||||
* @param buffer Circular buffer
|
||||
* @param amount Number of bytes to produce
|
||||
*/
|
||||
static __inline__ __attribute__((always_inline)) void
|
||||
static inline __attribute__((always_inline)) void
|
||||
TPCircularBufferProduce(TPCircularBuffer* buffer, int amount)
|
||||
{
|
||||
buffer->head = (buffer->head + amount) % buffer->length;
|
||||
@@ -180,7 +180,7 @@ extern "C"
|
||||
* Version of TPCircularBufferProduce without the memory barrier, for more optimal use in
|
||||
* single-threaded contexts
|
||||
*/
|
||||
static __inline__ __attribute__((always_inline)) void
|
||||
static inline __attribute__((always_inline)) void
|
||||
TPCircularBufferProduceNoBarrier(TPCircularBuffer* buffer, int amount)
|
||||
{
|
||||
buffer->head = (buffer->head + amount) % buffer->length;
|
||||
@@ -198,7 +198,7 @@ extern "C"
|
||||
* @param len Number of bytes in source buffer
|
||||
* @return true if bytes copied, false if there was insufficient space
|
||||
*/
|
||||
static __inline__ __attribute__((always_inline)) bool
|
||||
static inline __attribute__((always_inline)) bool
|
||||
TPCircularBufferProduceBytes(TPCircularBuffer* buffer, const void* src, int32_t len)
|
||||
{
|
||||
int32_t space;
|
||||
|
||||
@@ -6,6 +6,8 @@ set(FREERDP_EXTERNAL_SSL_PATH $ENV{ANDROID_SSL_PATH} CACHE PATH "android ssl")
|
||||
# ANDROID_NDK and ANDROID_SDK must be set as environment variable
|
||||
#set(ANDROID_NDK $ENV{ANDROID_SDK} CACHE PATH "Android NDK")
|
||||
#set(ANDROID_SDK "${ANDROID_NDK}" CACHE PATH "android SDK")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(WITH_FREERDP_DEPRECATED_COMMANDLINE ON CACHE BOOL "Enable deprecated command line options")
|
||||
set(WITH_KRB5 OFF CACHE BOOL "Kerberos support")
|
||||
set(WITH_CLIENT_SDL OFF CACHE BOOL "SDL client")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(WINPR_UTILS_IMAGE_JPEG ON CACHE BOOL "preload")
|
||||
set(WINPR_UTILS_IMAGE_WEBP ON CACHE BOOL "preload")
|
||||
set(WINPR_UTILS_IMAGE_PNG ON CACHE BOOL "preload")
|
||||
|
||||
@@ -2,6 +2,8 @@ message("PRELOADING cache")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(BUILD_TESTING_INTERNAL ON CACHE BOOL "preload")
|
||||
set(WITH_MANPAGES ON CACHE BOOL "preload")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "preload")
|
||||
set(WITH_CAIRO ON CACHE BOOL "preload")
|
||||
set(WITH_ALSA ON CACHE BOOL "preload")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
message("PRELOADING iOS cache")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/cmake/ios.toolchain.cmake" CACHE PATH "cmake toolchain file")
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "build type")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
message("PRELOADING iOS cache")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/cmake/ios.toolchain.cmake" CACHE PATH "cmake toolchain file")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "build type")
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "iOS platform to build")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
message("PRELOADING cache")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(BUILD_TESTING_INTERNAL ON CACHE BOOL "preload")
|
||||
set(WITH_MANPAGES ON CACHE BOOL "preload")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
message("PRELOADING cache")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(BUILD_TESTING_INTERNAL ON CACHE BOOL "preload")
|
||||
set(WITH_MANPAGES OFF CACHE BOOL "preload")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
message("PRELOADING mac cache")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(WITH_MANPAGES OFF CACHE BOOL "man pages")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "build type")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
message("PRELOADING cache")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(WITH_VERBOSE_WINPR_ASSERT ON CACHE BOOL "oss fuzz")
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
message("PRELOADING cache")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(WITH_SERVER ON CACHE BOOL "qa default")
|
||||
set(WITH_SAMPLE ON CACHE BOOL "qa default")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
set(BUILD_TESTING_INTERNAL ON CACHE BOOL "qa default")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_C_FLAGS "-Wno-pre-c23-compat" CACHE STRING "preload")
|
||||
set(WITH_STREAMPOOL_DEBUG ON CACHE BOOL "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(ENABLE_WARNING_VERBOSE ON CACHE BOOL "preload")
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
message("PRELOADING cache")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(WITH_MANPAGES ON CACHE BOOL "man pages")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "build type")
|
||||
set(WITH_CUPS OFF CACHE BOOL "CUPS printing")
|
||||
set(WITH_KRB5 ON CACHE BOOL "Kerberos support")
|
||||
set(WITH_ALSA OFF CACHE BOOL "alsa audio")
|
||||
set(WITH_FFMPEG OFF CACHE BOOL "ffmepg support")
|
||||
set(WITH_XV OFF CACHE BOOL "xvideo support")
|
||||
set(BUILD_TESTING_INTERNAL ON CACHE BOOL "build testing")
|
||||
set(WITH_XSHM OFF CACHE BOOL "build with xshm support")
|
||||
set(WITH_SERVER ON CACHE BOOL "build with server")
|
||||
set(WITH_SAMPLE ON CACHE BOOL "build with sample")
|
||||
set(WITH_SANITIZE_ADDRESS ON)
|
||||
set(WITH_FREERDP_DEPRECATED_COMMANDLINE ON CACHE BOOL "Enable deprecated command line options")
|
||||
@@ -1,4 +1,5 @@
|
||||
message("PRELOADING windows cache")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "preload")
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
|
||||
set(CMAKE_WINDOWS_VERSION "WIN7" CACHE STRING "windows build version")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "build static linked executable")
|
||||
|
||||
@@ -53,7 +53,13 @@
|
||||
#endif
|
||||
#else
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define FREERDP_API [[gnu::visibility("default")]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define FREERDP_API [[gnu::visibility("default")]]
|
||||
#else
|
||||
#define FREERDP_API __attribute__((visibility("default")))
|
||||
#endif
|
||||
#else
|
||||
#define FREERDP_API
|
||||
#endif
|
||||
@@ -66,7 +72,13 @@
|
||||
#define FREERDP_LOCAL
|
||||
#else
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define FREERDP_LOCAL [[gnu::visibility("hidden")]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define FREERDP_LOCAL [[gnu::visibility("hidden")]]
|
||||
#else
|
||||
#define FREERDP_LOCAL __attribute__((visibility("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#define FREERDP_LOCAL
|
||||
#endif
|
||||
@@ -104,14 +116,6 @@
|
||||
((_cb != NULL) ? _cb(__VA_ARGS__) : (_default_return))
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define ALIGN64 __attribute__((aligned(8)))
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
#define ALIGN64 __declspec(align(8))
|
||||
#else
|
||||
#define ALIGN64
|
||||
#endif
|
||||
#endif
|
||||
#define ALIGN64 DECLSPEC_ALIGN(8)
|
||||
|
||||
#endif /* FREERDP_API */
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define FREERDP_CODEC_AUDIO_H
|
||||
|
||||
#include <winpr/wlog.h>
|
||||
#include <winpr/wtypes.h>
|
||||
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/types.h>
|
||||
|
||||
@@ -613,23 +613,21 @@ static BOOL freerdp_dsp_decode_opus(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
|
||||
const BYTE* WINPR_RESTRICT src, size_t size,
|
||||
wStream* WINPR_RESTRICT out)
|
||||
{
|
||||
size_t max_size = 5760;
|
||||
int frames;
|
||||
|
||||
if (!context || !src || !out)
|
||||
return FALSE;
|
||||
|
||||
/* Max packet duration is 120ms (5760 at 48KHz) */
|
||||
max_size = OPUS_MAX_FRAMES * context->common.format.nChannels * sizeof(int16_t);
|
||||
const size_t max_size = OPUS_MAX_FRAMES * context->common.format.nChannels * sizeof(int16_t);
|
||||
if (!Stream_EnsureRemainingCapacity(context->common.buffer, max_size))
|
||||
return FALSE;
|
||||
|
||||
frames = opus_decode(context->opus_decoder, src, WINPR_ASSERTING_INT_CAST(opus_int32, size),
|
||||
Stream_Pointer(out), OPUS_MAX_FRAMES, 0);
|
||||
const opus_int32 frames =
|
||||
opus_decode(context->opus_decoder, src, WINPR_ASSERTING_INT_CAST(opus_int32, size),
|
||||
Stream_Pointer(out), OPUS_MAX_FRAMES, 0);
|
||||
if (frames < 0)
|
||||
return FALSE;
|
||||
|
||||
Stream_Seek(out, frames * context->common.format.nChannels * sizeof(int16_t));
|
||||
Stream_Seek(out, (size_t)frames * context->common.format.nChannels * sizeof(int16_t));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -648,12 +646,13 @@ static BOOL freerdp_dsp_encode_opus(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
|
||||
|
||||
const size_t src_frames = size / sizeof(opus_int16) / context->common.format.nChannels;
|
||||
const opus_int16* src_data = (const opus_int16*)src;
|
||||
const int frames = opus_encode(
|
||||
const opus_int32 frames = opus_encode(
|
||||
context->opus_encoder, src_data, WINPR_ASSERTING_INT_CAST(opus_int32, src_frames),
|
||||
Stream_Pointer(out), WINPR_ASSERTING_INT_CAST(opus_int32, max_size));
|
||||
if (frames < 0)
|
||||
return FALSE;
|
||||
return Stream_SafeSeek(out, frames * context->common.format.nChannels * sizeof(int16_t));
|
||||
return Stream_SafeSeek(out,
|
||||
(size_t)frames * context->common.format.nChannels * sizeof(int16_t));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1450,8 +1449,6 @@ BOOL freerdp_dsp_supports_format(const AUDIO_FORMAT* WINPR_RESTRICT format, BOOL
|
||||
case WAVE_FORMAT_OPUS:
|
||||
return opus_is_valid_samplerate(format);
|
||||
#endif
|
||||
/* fallthrough */
|
||||
WINPR_FALLTHROUGH
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1509,9 +1506,9 @@ BOOL freerdp_dsp_context_reset(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
|
||||
{
|
||||
int opus_error = OPUS_OK;
|
||||
|
||||
context->opus_decoder =
|
||||
opus_decoder_create(context->common.format.nSamplesPerSec,
|
||||
context->common.format.nChannels, &opus_error);
|
||||
context->opus_decoder = opus_decoder_create(
|
||||
WINPR_ASSERTING_INT_CAST(opus_int32, context->common.format.nSamplesPerSec),
|
||||
context->common.format.nChannels, &opus_error);
|
||||
if (opus_error != OPUS_OK)
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1519,9 +1516,9 @@ BOOL freerdp_dsp_context_reset(FREERDP_DSP_CONTEXT* WINPR_RESTRICT context,
|
||||
{
|
||||
int opus_error = OPUS_OK;
|
||||
|
||||
context->opus_encoder = opus_encoder_create(context->common.format.nSamplesPerSec,
|
||||
context->common.format.nChannels,
|
||||
OPUS_APPLICATION_VOIP, &opus_error);
|
||||
context->opus_encoder = opus_encoder_create(
|
||||
WINPR_ASSERTING_INT_CAST(opus_int32, context->common.format.nSamplesPerSec),
|
||||
context->common.format.nChannels, OPUS_APPLICATION_VOIP, &opus_error);
|
||||
if (opus_error != OPUS_OK)
|
||||
return FALSE;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
/* rfx_decode_YCbCr_to_RGB_NEON code now resides in the primitives library. */
|
||||
|
||||
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
static inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
rfx_quantization_decode_block_NEON(INT16* buffer, const size_t buffer_size, const UINT32 factor)
|
||||
{
|
||||
int16x8_t quantFactors = vdupq_n_s16(factor);
|
||||
@@ -69,7 +69,7 @@ static void rfx_quantization_decode_NEON(INT16* buffer, const UINT32* WINPR_REST
|
||||
rfx_quantization_decode_block_NEON(&buffer[4032], 64, quantVals[0] - 1); /* LL3 */
|
||||
}
|
||||
|
||||
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
static inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
rfx_dwt_2d_decode_block_horiz_NEON(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRICT h,
|
||||
INT16* WINPR_RESTRICT dst, size_t subband_width)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ rfx_dwt_2d_decode_block_horiz_NEON(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRIC
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
static inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
rfx_dwt_2d_decode_block_vert_NEON(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRICT h,
|
||||
INT16* WINPR_RESTRICT dst, size_t subband_width)
|
||||
{
|
||||
@@ -203,7 +203,7 @@ rfx_dwt_2d_decode_block_vert_NEON(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRICT
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
static inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
rfx_dwt_2d_decode_block_NEON(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT idwt,
|
||||
size_t subband_width)
|
||||
{
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
#define ATTRIBUTES __gnu_inline__, __always_inline__
|
||||
#endif
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
mm_prefetch_buffer(char* WINPR_RESTRICT buffer, size_t num_bytes)
|
||||
static inline void __attribute__((ATTRIBUTES)) mm_prefetch_buffer(char* WINPR_RESTRICT buffer,
|
||||
size_t num_bytes)
|
||||
{
|
||||
__m128i* buf = (__m128i*)buffer;
|
||||
|
||||
@@ -64,7 +64,7 @@ mm_prefetch_buffer(char* WINPR_RESTRICT buffer, size_t num_bytes)
|
||||
/* rfx_decode_ycbcr_to_rgb_sse2 code now resides in the primitives library. */
|
||||
/* rfx_encode_rgb_to_ycbcr_sse2 code now resides in the primitives library. */
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_quantization_decode_block_sse2(INT16* WINPR_RESTRICT buffer, const size_t buffer_size,
|
||||
const UINT32 factor)
|
||||
{
|
||||
@@ -103,7 +103,7 @@ static void rfx_quantization_decode_sse2(INT16* WINPR_RESTRICT buffer,
|
||||
rfx_quantization_decode_block_sse2(&buffer[4032], 64, quantVals[0] - 1); /* LL3 */
|
||||
}
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_quantization_encode_block_sse2(INT16* WINPR_RESTRICT buffer, const unsigned buffer_size,
|
||||
const INT16 factor)
|
||||
{
|
||||
@@ -160,7 +160,7 @@ static void rfx_quantization_encode_sse2(INT16* WINPR_RESTRICT buffer,
|
||||
rfx_quantization_encode_block_sse2(buffer, 4096, 5);
|
||||
}
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_dwt_2d_decode_block_horiz_sse2(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRICT h,
|
||||
INT16* WINPR_RESTRICT dst, size_t subband_width)
|
||||
{
|
||||
@@ -229,7 +229,7 @@ rfx_dwt_2d_decode_block_horiz_sse2(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRIC
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_dwt_2d_decode_block_vert_sse2(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRICT h,
|
||||
INT16* WINPR_RESTRICT dst, size_t subband_width)
|
||||
{
|
||||
@@ -300,7 +300,7 @@ rfx_dwt_2d_decode_block_vert_sse2(INT16* WINPR_RESTRICT l, INT16* WINPR_RESTRICT
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_dwt_2d_decode_block_sse2(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT idwt,
|
||||
size_t subband_width)
|
||||
{
|
||||
@@ -333,7 +333,7 @@ static void rfx_dwt_2d_decode_sse2(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RE
|
||||
rfx_dwt_2d_decode_block_sse2(&buffer[0], dwt_buffer, 32);
|
||||
}
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_dwt_2d_encode_block_vert_sse2(INT16* WINPR_RESTRICT src, INT16* WINPR_RESTRICT l,
|
||||
INT16* WINPR_RESTRICT h, size_t subband_width)
|
||||
{
|
||||
@@ -375,7 +375,7 @@ rfx_dwt_2d_encode_block_vert_sse2(INT16* WINPR_RESTRICT src, INT16* WINPR_RESTRI
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_dwt_2d_encode_block_horiz_sse2(INT16* WINPR_RESTRICT src, INT16* WINPR_RESTRICT l,
|
||||
INT16* WINPR_RESTRICT h, size_t subband_width)
|
||||
{
|
||||
@@ -418,7 +418,7 @@ rfx_dwt_2d_encode_block_horiz_sse2(INT16* WINPR_RESTRICT src, INT16* WINPR_RESTR
|
||||
}
|
||||
}
|
||||
|
||||
static __inline void __attribute__((ATTRIBUTES))
|
||||
static inline void __attribute__((ATTRIBUTES))
|
||||
rfx_dwt_2d_encode_block_sse2(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT dwt,
|
||||
size_t subband_width)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
|
||||
#define TAG FREERDP_TAG("core.gateway.rpc")
|
||||
|
||||
static ALIGN64 const RPC_FAULT_CODE RPC_FAULT_CODES[] = {
|
||||
ALIGN64
|
||||
static const RPC_FAULT_CODE RPC_FAULT_CODES[] = {
|
||||
DEFINE_RPC_FAULT_CODE(nca_s_fault_object_not_found, CAT_GATEWAY),
|
||||
DEFINE_RPC_FAULT_CODE(nca_s_fault_cancel, CAT_GATEWAY),
|
||||
DEFINE_RPC_FAULT_CODE(nca_s_fault_addr_error, CAT_GATEWAY),
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#define TAG FREERDP_TAG("timer")
|
||||
#endif
|
||||
|
||||
typedef ALIGN64 struct
|
||||
typedef struct ALIGN64
|
||||
{
|
||||
FreeRDP_TimerID id;
|
||||
uint64_t intervallNS;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <freerdp/api.h>
|
||||
|
||||
WINPR_ATTR_NODISCARD
|
||||
FREERDP_LOCAL int freerdp_detect_keyboard_layout_from_cf(DWORD* keyboardLayoutId);
|
||||
|
||||
#endif /* FREERDP_LOCALE_KEYBOARD_APPLE_H */
|
||||
|
||||
@@ -25,13 +25,7 @@
|
||||
|
||||
#include "../core/simd.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define PRIM_ALIGN_128 __attribute__((aligned(16)))
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
#define PRIM_ALIGN_128 __declspec(align(16))
|
||||
#endif
|
||||
#endif
|
||||
#define PRIM_ALIGN_128 DECLSPEC_ALIGN(16)
|
||||
|
||||
#if defined(SSE_AVX_INTRINSICS_ENABLED) || defined(NEON_INTRINSICS_ENABLED) || defined(WITH_OPENCL)
|
||||
#define HAVE_OPTIMIZED_PRIMITIVES 1
|
||||
|
||||
@@ -37,7 +37,13 @@
|
||||
#endif
|
||||
#else
|
||||
#if __GNUC__ >= 4
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define RDTK_EXPORT [[gnu::visibility("default")]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define RDTK_EXPORT [[gnu::visibility("default")]]
|
||||
#else
|
||||
#define RDTK_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#else
|
||||
#define RDTK_EXPORT
|
||||
#endif
|
||||
|
||||
@@ -27,7 +27,13 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define UWAC_API [[gnu::visibility("default")]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define UWAC_API [[gnu::visibility("default")]]
|
||||
#else
|
||||
#define UWAC_API __attribute__((visibility("default")))
|
||||
#endif
|
||||
#else
|
||||
#define UWAC_API
|
||||
#endif
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
#define WINPR_FALLTHROUGH \
|
||||
(void)0; \
|
||||
[[fallthrough]];
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201904L)
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_FALLTHROUGH \
|
||||
(void)0; \
|
||||
[[fallthrough]];
|
||||
@@ -80,7 +80,9 @@
|
||||
#endif
|
||||
|
||||
#if defined(WINPR_DEFINE_ATTR_NODISCARD)
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202003L)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_ATTR_NODISCARD [[nodiscard]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_ATTR_NODISCARD [[nodiscard]]
|
||||
#elif defined(__clang__)
|
||||
#define WINPR_ATTR_NODISCARD __attribute__((warn_unused_result))
|
||||
@@ -93,6 +95,14 @@
|
||||
#define WINPR_ATTR_NODISCARD
|
||||
#endif
|
||||
|
||||
/* GCC does not like [[nodiscard]] on function pointers.
|
||||
* it does not complain when using attribute syntax thoug...
|
||||
*/
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#undef WINPR_ATTR_NODISCARD
|
||||
#define WINPR_ATTR_NODISCARD __attribute__((warn_unused_result))
|
||||
#endif
|
||||
|
||||
#if defined(__clang__)
|
||||
#define WINPR_PRAGMA_DIAG_PUSH WINPR_DO_PRAGMA(clang diagnostic push)
|
||||
#define WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS \
|
||||
@@ -532,7 +542,10 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
|
||||
|
||||
WINPR_PRAGMA_DIAG_POP
|
||||
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201904L)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_DEPRECATED(obj) [[deprecated]] obj
|
||||
#define WINPR_DEPRECATED_VAR(text, obj) [[deprecated("[deprecated] " text)]] obj
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_DEPRECATED(obj) [[deprecated]] obj
|
||||
#define WINPR_DEPRECATED_VAR(text, obj) [[deprecated("[deprecated] " text)]] obj
|
||||
#elif defined(__GNUC__)
|
||||
@@ -543,7 +556,9 @@ WINPR_PRAGMA_DIAG_POP
|
||||
#define WINPR_DEPRECATED_VAR(text, obj) obj
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202202L)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_NORETURN(obj) [[noreturn]] obj
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_NORETURN(obj) [[noreturn]] obj
|
||||
#elif defined(WIN32) && !defined(__CYGWIN__)
|
||||
#define WINPR_NORETURN(obj) __declspec(noreturn) obj
|
||||
@@ -572,7 +587,13 @@ WINPR_PRAGMA_DIAG_POP
|
||||
#endif
|
||||
#else
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_API [[gnu::visibility("default")]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_API [[gnu::visibility("default")]]
|
||||
#else
|
||||
#define WINPR_API __attribute__((visibility("default")))
|
||||
#endif
|
||||
#else
|
||||
#define WINPR_API
|
||||
#endif
|
||||
@@ -581,13 +602,29 @@ WINPR_PRAGMA_DIAG_POP
|
||||
#define WINPR_API
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ <= 10)
|
||||
#if defined(__clang__)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
__attribute__((malloc, warn_unused_result)) /** @since version 3.3.0 */
|
||||
#elif defined(__GNUC__)
|
||||
[[gnu::malloc, nodiscard]] /** @since version 3.3.0 */
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
[[gnu::malloc, nodiscard]] /** @since version 3.3.0 */
|
||||
#else
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
[[gnu::malloc, nodiscard]] /** @since version 3.3.0 */
|
||||
#endif
|
||||
#elif defined(__GNUC__) && (__GNUC__ > 10)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
[[gnu::malloc(deallocator, ptrindex), nodiscard]] /** @since version 3.3.0 */
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
[[gnu::malloc(deallocator, ptrindex), nodiscard]] /** @since version 3.3.0 */
|
||||
#else
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
__attribute__((malloc(deallocator, ptrindex), warn_unused_result)) /** @since version 3.3.0 */
|
||||
#else
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) __declspec(restrict) /** @since version 3.3.0 */
|
||||
#endif
|
||||
|
||||
@@ -635,19 +672,11 @@ WINPR_PRAGMA_DIAG_POP
|
||||
#define WINPR_TLS
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define WINPR_ALIGN64 __attribute__((aligned(8))) /** @since version 3.4.0 */
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
#define WINPR_ALIGN64 __declspec(align(8)) /** @since version 3.4.0 */
|
||||
#else
|
||||
#define WINPR_ALIGN64 /** @since version 3.4.0 */
|
||||
#endif
|
||||
#endif
|
||||
#define WINPR_ALIGN64 DECLSPEC_ALIGN(8)
|
||||
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_ATTR_UNUSED [[maybe_unused]] /** @since version 3.12.0 */
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201904L)
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define WINPR_ATTR_UNUSED [[maybe_unused]] /** @since version 3.12.0 */
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define WINPR_ATTR_UNUSED __attribute__((unused)) /** @since version 3.12.0 */
|
||||
|
||||
@@ -82,7 +82,13 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
|
||||
#define DECLSPEC_ALIGN(x) __declspec(align(x))
|
||||
#elif defined(__GNUC__)
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define DECLSPEC_ALIGN(x) [[gnu::aligned(x)]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define DECLSPEC_ALIGN(x) [[gnu::aligned(x)]]
|
||||
#else
|
||||
#define DECLSPEC_ALIGN(x) __attribute__((__aligned__(x)))
|
||||
#endif
|
||||
#else
|
||||
#define DECLSPEC_ALIGN(x)
|
||||
#endif
|
||||
@@ -997,7 +1003,13 @@ extern "C++"
|
||||
#endif /* __GNUC__ */
|
||||
#else
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define DECLSPEC_EXPORT [[gnu::visibility("default")]]
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
|
||||
#define DECLSPEC_EXPORT [[gnu::visibility("default")]]
|
||||
#else
|
||||
#define DECLSPEC_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#define DECLSPEC_IMPORT
|
||||
#else
|
||||
#define DECLSPEC_EXPORT
|
||||
|
||||
@@ -37,7 +37,7 @@ int TestFileGetStdHandle(int argc, char* argv[])
|
||||
(void)fprintf(stderr, "GetStdHandle failed ;(\n");
|
||||
return -1;
|
||||
}
|
||||
WriteFile(so, buf, strnlen(buf, sizeof(buf)), &bytesWritten, FALSE);
|
||||
WriteFile(so, buf, strnlen(buf, sizeof(buf)), &bytesWritten, NULL);
|
||||
if (bytesWritten != strnlen(buf, sizeof(buf)))
|
||||
{
|
||||
(void)fprintf(stderr, "write failed\n");
|
||||
|
||||
Reference in New Issue
Block a user