mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-23 01:44:35 +08:00
[warnings] fix apple iOS/macos
This commit is contained in:
parent
869bfd5e86
commit
0d5bc92a2b
@ -65,6 +65,8 @@ static BOOL mac_desktop_resize(rdpContext *context);
|
||||
static void input_activity_cb(freerdp *instance);
|
||||
|
||||
static DWORD WINAPI mac_client_thread(void *param);
|
||||
static void windows_to_apple_cords(MRDPView *view, NSRect *r);
|
||||
static CGContextRef mac_create_bitmap_context(rdpContext *context);
|
||||
|
||||
@implementation MRDPView
|
||||
|
||||
|
@ -1117,7 +1117,6 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett
|
||||
UINT32 LoadBalanceInfoLength = 0;
|
||||
const char* GatewayHostname = NULL;
|
||||
char* redirectCameras = NULL;
|
||||
char* redirectUsb = NULL;
|
||||
|
||||
if (!file || !settings)
|
||||
return FALSE;
|
||||
@ -1307,7 +1306,8 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett
|
||||
file->RedirectCameras = redirectCameras;
|
||||
}
|
||||
#ifdef CHANNEL_URBDRC_CLIENT
|
||||
redirectUsb = freerdp_client_channel_args_to_string(settings, URBDRC_CHANNEL_NAME, "device:");
|
||||
char* redirectUsb =
|
||||
freerdp_client_channel_args_to_string(settings, URBDRC_CHANNEL_NAME, "device:");
|
||||
if (redirectUsb)
|
||||
file->UsbDevicesToRedirect = redirectUsb;
|
||||
|
||||
|
@ -648,7 +648,6 @@ static BOOL freerdp_get_system_language_and_country_codes(char* language, size_t
|
||||
|
||||
#if defined(__APPLE__)
|
||||
{
|
||||
CFIndex strSize;
|
||||
CFStringRef langRef, countryRef;
|
||||
CFLocaleRef localeRef = CFLocaleCopyCurrent();
|
||||
if (!localeRef)
|
||||
|
@ -251,7 +251,7 @@ static INLINE pstatus_t neon_YUV420ToX(const BYTE* WINPR_RESTRICT pSrc[3], const
|
||||
return PRIMITIVES_SUCCESS;
|
||||
}
|
||||
|
||||
static pstatus_t neon_YUV420ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT const pSrc[3],
|
||||
static pstatus_t neon_YUV420ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc[3],
|
||||
const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst,
|
||||
UINT32 dstStep, UINT32 DstFormat,
|
||||
const prim_size_t* WINPR_RESTRICT roi)
|
||||
@ -341,7 +341,7 @@ static INLINE pstatus_t neon_YUV444ToX(const BYTE* WINPR_RESTRICT pSrc[3], const
|
||||
return PRIMITIVES_SUCCESS;
|
||||
}
|
||||
|
||||
static pstatus_t neon_YUV444ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT const pSrc[3],
|
||||
static pstatus_t neon_YUV444ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc[3],
|
||||
const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst,
|
||||
UINT32 dstStep, UINT32 DstFormat,
|
||||
const prim_size_t* WINPR_RESTRICT roi)
|
||||
|
@ -46,9 +46,9 @@ neon_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep,
|
||||
int16x8_t g_cr = vdupq_n_s16(-11698); // -0.714 << 14
|
||||
int16x8_t b_cb = vdupq_n_s16(28999); // 1.770 << 14
|
||||
int16x8_t c4096 = vdupq_n_s16(4096);
|
||||
int16x8_t* y_buf = (int16x8_t*)pSrc[0];
|
||||
int16x8_t* cb_buf = (int16x8_t*)pSrc[1];
|
||||
int16x8_t* cr_buf = (int16x8_t*)pSrc[2];
|
||||
const int16x8_t* y_buf = (const int16x8_t*)pSrc[0];
|
||||
const int16x8_t* cb_buf = (const int16x8_t*)pSrc[1];
|
||||
const int16x8_t* cr_buf = (const int16x8_t*)pSrc[2];
|
||||
int16x8_t* r_buf = (int16x8_t*)pDst[0];
|
||||
int16x8_t* g_buf = (int16x8_t*)pDst[1];
|
||||
int16x8_t* b_buf = (int16x8_t*)pDst[2];
|
||||
@ -272,9 +272,9 @@ neon_RGBToRGB_16s8u_P3AC4R_X(const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G,
|
||||
|
||||
for (UINT32 y = 0; y < roi->height; y++)
|
||||
{
|
||||
const INT16* pr = (INT16*)(((BYTE*)pSrc[0]) + y * srcStep);
|
||||
const INT16* pg = (INT16*)(((BYTE*)pSrc[1]) + y * srcStep);
|
||||
const INT16* pb = (INT16*)(((BYTE*)pSrc[2]) + y * srcStep);
|
||||
const INT16* pr = (const INT16*)(((BYTE*)pSrc[0]) + y * srcStep);
|
||||
const INT16* pg = (const INT16*)(((BYTE*)pSrc[1]) + y * srcStep);
|
||||
const INT16* pb = (const INT16*)(((BYTE*)pSrc[2]) + y * srcStep);
|
||||
BYTE* dst = pDst + y * dstStep;
|
||||
|
||||
for (UINT32 x = 0; x < roi->width - pad; x += 8)
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <freerdp/log.h>
|
||||
#define TAG SERVER_TAG("mac")
|
||||
|
||||
int mf_is_event_set(mfEventQueue* event_queue)
|
||||
static int mf_is_event_set(mfEventQueue* event_queue)
|
||||
{
|
||||
fd_set rfds;
|
||||
int num_set;
|
||||
@ -43,7 +43,7 @@ int mf_is_event_set(mfEventQueue* event_queue)
|
||||
return (num_set == 1);
|
||||
}
|
||||
|
||||
void mf_signal_event(mfEventQueue* event_queue)
|
||||
static void mf_signal_event(mfEventQueue* event_queue)
|
||||
{
|
||||
int length;
|
||||
|
||||
@ -53,7 +53,7 @@ void mf_signal_event(mfEventQueue* event_queue)
|
||||
WLog_ERR(TAG, "mf_signal_event: error");
|
||||
}
|
||||
|
||||
void mf_set_event(mfEventQueue* event_queue)
|
||||
static void mf_set_event(mfEventQueue* event_queue)
|
||||
{
|
||||
int length;
|
||||
|
||||
@ -63,7 +63,7 @@ void mf_set_event(mfEventQueue* event_queue)
|
||||
WLog_ERR(TAG, "mf_set_event: error");
|
||||
}
|
||||
|
||||
void mf_clear_events(mfEventQueue* event_queue)
|
||||
static void mf_clear_events(mfEventQueue* event_queue)
|
||||
{
|
||||
int length;
|
||||
|
||||
@ -76,7 +76,7 @@ void mf_clear_events(mfEventQueue* event_queue)
|
||||
}
|
||||
}
|
||||
|
||||
void mf_clear_event(mfEventQueue* event_queue)
|
||||
static void mf_clear_event(mfEventQueue* event_queue)
|
||||
{
|
||||
int length;
|
||||
|
||||
|
@ -88,7 +88,7 @@ int mf_info_unlock(mfInfo* mfi)
|
||||
return 1;
|
||||
}
|
||||
|
||||
mfInfo* mf_info_init()
|
||||
static mfInfo* mf_info_init(void)
|
||||
{
|
||||
mfInfo* mfi;
|
||||
|
||||
@ -112,7 +112,7 @@ mfInfo* mf_info_init()
|
||||
return mfi;
|
||||
}
|
||||
|
||||
mfInfo* mf_info_get_instance()
|
||||
mfInfo* mf_info_get_instance(void)
|
||||
{
|
||||
if (mfInfoInstance == NULL)
|
||||
mfInfoInstance = mf_info_init();
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <winpr/string.h>
|
||||
|
||||
#include "../utils/android.h"
|
||||
#include "unicode.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (a) < (b) ? (a) : (b)
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <winpr/error.h>
|
||||
#include <winpr/print.h>
|
||||
|
||||
#include "unicode.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (a) < (b) ? (a) : (b)
|
||||
#endif
|
||||
|
@ -648,8 +648,8 @@ static BOOL FileSetFileTime(HANDLE hFile, const FILETIME* lpCreationTime,
|
||||
|
||||
// TODO: Creation time can not be handled!
|
||||
{
|
||||
const int rc = utimes(pFile->lpFileName, timevals);
|
||||
if (rc != 0)
|
||||
const int res = utimes(pFile->lpFileName, timevals);
|
||||
if (res != 0)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -218,20 +218,21 @@ static char* GetPath_XDG_CONFIG_HOME(void)
|
||||
static char* GetPath_XDG_CACHE_HOME(void)
|
||||
{
|
||||
char* path = NULL;
|
||||
char* home = NULL;
|
||||
#if defined(WIN32)
|
||||
home = GetPath_XDG_RUNTIME_DIR();
|
||||
|
||||
if (home)
|
||||
{
|
||||
path = GetCombinedPath(home, "cache");
|
||||
char* home = GetPath_XDG_RUNTIME_DIR();
|
||||
|
||||
if (!winpr_PathFileExists(path))
|
||||
if (!CreateDirectoryA(path, NULL))
|
||||
path = NULL;
|
||||
if (home)
|
||||
{
|
||||
path = GetCombinedPath(home, "cache");
|
||||
|
||||
if (!winpr_PathFileExists(path))
|
||||
if (!CreateDirectoryA(path, NULL))
|
||||
path = NULL;
|
||||
}
|
||||
|
||||
free(home);
|
||||
}
|
||||
|
||||
free(home);
|
||||
#elif defined(__IOS__)
|
||||
path = ios_get_cache();
|
||||
#else
|
||||
@ -249,7 +250,7 @@ static char* GetPath_XDG_CACHE_HOME(void)
|
||||
if (path)
|
||||
return path;
|
||||
|
||||
home = GetPath_HOME();
|
||||
char* home = GetPath_HOME();
|
||||
|
||||
if (!home)
|
||||
return NULL;
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "shell_ios.h"
|
||||
|
||||
NSString *ios_get_directory_for_search_path(NSSearchPathDirectory searchPath)
|
||||
static NSString *ios_get_directory_for_search_path(NSSearchPathDirectory searchPath)
|
||||
{
|
||||
return [NSSearchPathForDirectoriesInDomains(searchPath, NSUserDomainMask, YES) lastObject];
|
||||
}
|
||||
|
@ -111,8 +111,6 @@ BOOL winpr_event_init(WINPR_EVENT_IMPL* event)
|
||||
|
||||
return event->fds[0] >= 0;
|
||||
#else
|
||||
int flags;
|
||||
|
||||
if (pipe(event->fds) < 0)
|
||||
return FALSE;
|
||||
|
||||
|
@ -64,8 +64,6 @@ static int TimerGetFd(HANDLE handle)
|
||||
|
||||
static DWORD TimerCleanupHandle(HANDLE handle)
|
||||
{
|
||||
SSIZE_T length = 0;
|
||||
UINT64 expirations = 0;
|
||||
WINPR_TIMER* timer = (WINPR_TIMER*)handle;
|
||||
|
||||
if (!TimerIsHandled(handle))
|
||||
@ -75,8 +73,10 @@ static DWORD TimerCleanupHandle(HANDLE handle)
|
||||
return WAIT_OBJECT_0;
|
||||
|
||||
#ifdef TIMER_IMPL_TIMERFD
|
||||
SSIZE_T length = 0;
|
||||
do
|
||||
{
|
||||
UINT64 expirations = 0;
|
||||
length = read(timer->fd, (void*)&expirations, sizeof(UINT64));
|
||||
} while (length < 0 && errno == EINTR);
|
||||
|
||||
@ -232,7 +232,6 @@ static BOOL InstallTimerSignalHandler(PINIT_ONCE InitOnce, PVOID Parameter, PVOI
|
||||
#ifdef TIMER_IMPL_DISPATCH
|
||||
static void WaitableTimerHandler(void* arg)
|
||||
{
|
||||
UINT64 data = 1;
|
||||
WINPR_TIMER* timer = (WINPR_TIMER*)arg;
|
||||
|
||||
if (!timer)
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <winpr/config.h>
|
||||
|
||||
#include <winpr/winpr.h>
|
||||
#include <winpr/assert.h>
|
||||
|
||||
#include <winpr/handle.h>
|
||||
@ -628,8 +629,6 @@ BOOL SetThreadPriority(HANDLE hThread, int nPriority)
|
||||
if (!winpr_Handle_GetInfo(hThread, &Type, &Object) || Object->Type != HANDLE_TYPE_THREAD)
|
||||
return FALSE;
|
||||
|
||||
WINPR_THREAD* thread = (WINPR_THREAD*)Object;
|
||||
|
||||
const int min = 19;
|
||||
const int max = 0;
|
||||
const int diff = (max - min);
|
||||
@ -663,6 +662,7 @@ BOOL SetThreadPriority(HANDLE hThread, int nPriority)
|
||||
break;
|
||||
}
|
||||
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) && defined(PTHREAD_SETSCHEDPRIO)
|
||||
WINPR_THREAD* thread = (WINPR_THREAD*)Object;
|
||||
const int rc = pthread_setschedprio(thread->thread, sched_priority);
|
||||
if (rc != 0)
|
||||
WLog_ERR(TAG, "pthread_setschedprio(%d) %s [%d]", sched_priority, strerror(rc), rc);
|
||||
@ -906,7 +906,7 @@ DWORD GetCurrentThreadId(VOID)
|
||||
tid = pthread_self();
|
||||
/* Since pthread_t can be 64-bits on some systems, take just the */
|
||||
/* lower 32-bits of it for the thread ID returned by this function. */
|
||||
return (DWORD)tid & 0xffffffffUL;
|
||||
return WINPR_REINTERPRET_CAST(tid, pthread_t, DWORD) & 0xffffffffUL;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
Loading…
Reference in New Issue
Block a user