mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
Merge pull request #11232 from akallabeth/android-more-fixes
[channels,rdpsnd] fix android build warnings
This commit is contained in:
@@ -285,11 +285,8 @@ static void rdpsnd_opensles_start(rdpsndDevicePlugin* device)
|
||||
DEBUG_SND("opensles=%p", (void*)opensles);
|
||||
}
|
||||
|
||||
static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args)
|
||||
static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, const ADDIN_ARGV* args)
|
||||
{
|
||||
int status;
|
||||
DWORD flags;
|
||||
const COMMAND_LINE_ARGUMENT_A* arg;
|
||||
rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*)device;
|
||||
COMMAND_LINE_ARGUMENT_A rdpsnd_opensles_args[] = {
|
||||
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
|
||||
@@ -299,15 +296,15 @@ static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_AR
|
||||
WINPR_ASSERT(opensles);
|
||||
WINPR_ASSERT(args);
|
||||
DEBUG_SND("opensles=%p, args=%p", (void*)opensles, (void*)args);
|
||||
flags =
|
||||
const DWORD flags =
|
||||
COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
|
||||
status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_opensles_args, flags,
|
||||
opensles, NULL, NULL);
|
||||
const int status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_opensles_args,
|
||||
flags, opensles, NULL, NULL);
|
||||
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
arg = rdpsnd_opensles_args;
|
||||
const COMMAND_LINE_ARGUMENT_A* arg = rdpsnd_opensles_args;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@@ -369,22 +369,17 @@ static UINT
|
||||
android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr,
|
||||
const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
|
||||
{
|
||||
BYTE* data;
|
||||
UINT32 size;
|
||||
UINT32 formatId;
|
||||
CLIPRDR_FORMAT* format = NULL;
|
||||
androidContext* afc;
|
||||
freerdp* instance;
|
||||
|
||||
if (!cliprdr || !formatDataResponse)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
afc = (androidContext*)cliprdr->custom;
|
||||
androidContext* afc = (androidContext*)cliprdr->custom;
|
||||
|
||||
if (!afc)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
instance = ((rdpContext*)afc)->instance;
|
||||
freerdp* instance = ((rdpContext*)afc)->instance;
|
||||
|
||||
if (!instance)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
@@ -401,12 +396,11 @@ android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr,
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
UINT32 formatId = format->formatId;
|
||||
if (format->formatName)
|
||||
formatId = ClipboardRegisterFormat(afc->clipboard, format->formatName);
|
||||
else
|
||||
formatId = format->formatId;
|
||||
|
||||
size = formatDataResponse->common.dataLen;
|
||||
size_t size = formatDataResponse->common.dataLen;
|
||||
|
||||
if (!ClipboardSetData(afc->clipboard, formatId, formatDataResponse->requestedFormatData, size))
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
@@ -415,14 +409,12 @@ android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr,
|
||||
|
||||
if ((formatId == CF_TEXT) || (formatId == CF_UNICODETEXT))
|
||||
{
|
||||
JNIEnv* env;
|
||||
jstring jdata;
|
||||
jboolean attached;
|
||||
JNIEnv* env = NULL;
|
||||
formatId = ClipboardRegisterFormat(afc->clipboard, "text/plain");
|
||||
data = (void*)ClipboardGetData(afc->clipboard, formatId, &size);
|
||||
attached = jni_attach_thread(&env);
|
||||
char* data = (char*)ClipboardGetData(afc->clipboard, formatId, &size);
|
||||
jboolean attached = jni_attach_thread(&env);
|
||||
size = strnlen(data, size);
|
||||
jdata = jniNewStringUTF(env, data, size);
|
||||
jstring jdata = jniNewStringUTF(env, data, size);
|
||||
freerdp_callback("OnRemoteClipboardChanged", "(JLjava/lang/String;)V", (jlong)instance,
|
||||
jdata);
|
||||
(*env)->DeleteLocalRef(env, jdata);
|
||||
|
||||
@@ -84,7 +84,7 @@ static int dump_data(const wImage* img, const char* file)
|
||||
count = fprintf(fp, "static const uint8_t img_data[] ={\n");
|
||||
if (count < 0)
|
||||
goto fail;
|
||||
count = dump_data_hex(fp, img->data, img->height * img->scanline);
|
||||
count = dump_data_hex(fp, img->data, 1ULL * img->height * img->scanline);
|
||||
if (count < 0)
|
||||
goto fail;
|
||||
count = fprintf(fp, "};\n");
|
||||
|
||||
Reference in New Issue
Block a user