Skip to content

Commit

Permalink
Merge pull request FreeRDP#11232 from akallabeth/android-more-fixes
Browse files Browse the repository at this point in the history
[channels,rdpsnd] fix android build warnings
  • Loading branch information
akallabeth authored Feb 23, 2025
2 parents 4fb4aaf + 52fb11d commit 9798bae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
13 changes: 5 additions & 8 deletions channels/rdpsnd/client/opensles/rdpsnd_opensles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand All @@ -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
{
Expand Down
24 changes: 8 additions & 16 deletions client/Android/Studio/freeRDPCore/src/main/cpp/android_cliprdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libfreerdp/codec/test/img2bgra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 9798bae

Please sign in to comment.