mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-12-04 15:23:32 +08:00
Renamed ArrayList_Add to ArrayList_Append
* Do not break API silently
This commit is contained in:
parent
a1c8e4cf85
commit
d6c84c28fb
@ -98,7 +98,7 @@ static UINT dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr,
|
||||
if (ppListener)
|
||||
*ppListener = (IWTSListener*)listener;
|
||||
|
||||
if (!ArrayList_Add(dvcman->listeners, listener))
|
||||
if (!ArrayList_Append(dvcman->listeners, listener))
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
@ -129,9 +129,9 @@ static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const ch
|
||||
{
|
||||
DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*)pEntryPoints)->dvcman;
|
||||
|
||||
if (!ArrayList_Add(dvcman->plugin_names, _strdup(name)))
|
||||
if (!ArrayList_Append(dvcman->plugin_names, _strdup(name)))
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
if (!ArrayList_Add(dvcman->plugins, pPlugin))
|
||||
if (!ArrayList_Append(dvcman->plugins, pPlugin))
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
|
||||
WLog_DBG(TAG, "register_plugin: num_plugins %d", ArrayList_Count(dvcman->plugins));
|
||||
@ -502,7 +502,7 @@ static UINT dvcman_create_channel(drdynvcPlugin* drdynvc, IWTSVirtualChannelMana
|
||||
}
|
||||
|
||||
channel->status = ERROR_NOT_CONNECTED;
|
||||
if (!ArrayList_Add(dvcman->channels, channel))
|
||||
if (!ArrayList_Append(dvcman->channels, channel))
|
||||
return ERROR_INTERNAL_ERROR;
|
||||
|
||||
ArrayList_Lock(dvcman->listeners);
|
||||
|
@ -373,7 +373,7 @@ TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid,
|
||||
goto error_add;
|
||||
obj->fnObjectFree = _tsmf_stream_free;
|
||||
|
||||
if (ArrayList_Add(presentation_list, presentation) < 0)
|
||||
if (ArrayList_Append(presentation_list, presentation) < 0)
|
||||
goto error_add;
|
||||
|
||||
return presentation;
|
||||
@ -1279,7 +1279,7 @@ TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id,
|
||||
if (!stream->ack_thread)
|
||||
goto error_ack_thread;
|
||||
|
||||
if (ArrayList_Add(presentation->stream_list, stream) < 0)
|
||||
if (ArrayList_Append(presentation->stream_list, stream) < 0)
|
||||
goto error_add;
|
||||
|
||||
stream->rdpcontext = rdpcontext;
|
||||
|
@ -1238,7 +1238,7 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, URBDRC_CHANNEL_CALLBACK* c
|
||||
set_stream_id_for_buffer(iso_transfer, streamID);
|
||||
libusb_set_iso_packet_lengths(iso_transfer, iso_packet_size);
|
||||
|
||||
if (!ArrayList_Add(pdev->request_queue, iso_transfer))
|
||||
if (!ArrayList_Append(pdev->request_queue, iso_transfer))
|
||||
{
|
||||
WLog_Print(urbdrc->log, WLOG_WARN,
|
||||
"Failed to queue iso transfer, streamID %08" PRIx32 " already in use!",
|
||||
@ -1349,7 +1349,7 @@ static int libusb_udev_bulk_or_interrupt_transfer(IUDEVICE* idev, URBDRC_CHANNEL
|
||||
|
||||
set_stream_id_for_buffer(transfer, streamID);
|
||||
|
||||
if (!ArrayList_Add(pdev->request_queue, transfer))
|
||||
if (!ArrayList_Append(pdev->request_queue, transfer))
|
||||
{
|
||||
WLog_Print(urbdrc->log, WLOG_WARN,
|
||||
"Failed to queue transfer, streamID %08" PRIx32 " already in use!", streamID);
|
||||
|
@ -700,7 +700,7 @@ static BOOL urbdrc_udevman_register_devices(UDEVMAN* udevman, const char* device
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
idpair->vid = id1;
|
||||
idpair->pid = id2;
|
||||
if (!ArrayList_Add(udevman->hotplug_vid_pids, idpair))
|
||||
if (!ArrayList_Append(udevman->hotplug_vid_pids, idpair))
|
||||
{
|
||||
free(idpair);
|
||||
return CHANNEL_RC_NO_MEMORY;
|
||||
|
@ -140,7 +140,7 @@ BOOL wlf_handle_pointer_axis(freerdp* instance, const UwacPointerAxisEvent* ev)
|
||||
return FALSE;
|
||||
|
||||
context = (wlfContext*)instance->context;
|
||||
ArrayList_Add(context->events, ev);
|
||||
ArrayList_Append(context->events, ev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ BOOL wlf_handle_pointer_axis_discrete(freerdp* instance, const UwacPointerAxisEv
|
||||
return FALSE;
|
||||
|
||||
context = (wlfContext*)instance->context;
|
||||
ArrayList_Add(context->events, ev);
|
||||
ArrayList_Append(context->events, ev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ BOOL wlf_handle_pointer_source(freerdp* instance, const UwacPointerSourceEvent*
|
||||
return FALSE;
|
||||
|
||||
context = (wlfContext*)instance->context;
|
||||
ArrayList_Add(context->events, ev);
|
||||
ArrayList_Append(context->events, ev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1831,7 +1831,7 @@ static BOOL xf_cliprdr_fuse_create_nodes(xfClipboard* clipboard, wStream* s, siz
|
||||
break;
|
||||
inode->parent_ino = 1;
|
||||
inode->name = baseName;
|
||||
if (ArrayList_Add(rootNode->child_inos, (void*)inode->ino) < 0)
|
||||
if (ArrayList_Append(rootNode->child_inos, (void*)inode->ino) < 0)
|
||||
break;
|
||||
}
|
||||
else
|
||||
@ -1850,7 +1850,7 @@ static BOOL xf_cliprdr_fuse_create_nodes(xfClipboard* clipboard, wStream* s, siz
|
||||
break;
|
||||
inode->parent_ino = parent->ino;
|
||||
inode->name = baseName;
|
||||
if (ArrayList_Add(parent->child_inos, (void*)inode->ino) < 0)
|
||||
if (ArrayList_Append(parent->child_inos, (void*)inode->ino) < 0)
|
||||
break;
|
||||
free(dirName);
|
||||
dirName = NULL;
|
||||
@ -1908,7 +1908,7 @@ static BOOL xf_cliprdr_fuse_create_nodes(xfClipboard* clipboard, wStream* s, siz
|
||||
inode->st_mtim.tv_nsec = 0;
|
||||
}
|
||||
|
||||
if (ArrayList_Add(clipboard->ino_list, inode) < 0)
|
||||
if (ArrayList_Append(clipboard->ino_list, inode) < 0)
|
||||
break;
|
||||
}
|
||||
/* clean up incomplete ino_list*/
|
||||
@ -1960,7 +1960,7 @@ static BOOL xf_cliprdr_fuse_generate_list(xfClipboard* clipboard, const BYTE* da
|
||||
ArrayList_Lock(clipboard->ino_list);
|
||||
xfCliprdrFuseInode* rootNode = xf_cliprdr_fuse_create_root_node();
|
||||
|
||||
if (!rootNode || ArrayList_Add(clipboard->ino_list, rootNode) < 0)
|
||||
if (!rootNode || ArrayList_Append(clipboard->ino_list, rootNode) < 0)
|
||||
{
|
||||
xf_cliprdr_fuse_inode_free(rootNode);
|
||||
WLog_ERR(TAG, "fail to alloc rootNode to ino_list");
|
||||
@ -2386,7 +2386,7 @@ static int xf_cliprdr_fuse_util_add_stream_list(xfClipboard* clipboard, fuse_req
|
||||
*stream_id = stream->stream_id;
|
||||
stream->req_ino = 0;
|
||||
clipboard->current_stream_id++;
|
||||
if (ArrayList_Add(clipboard->stream_list, stream) < 0)
|
||||
if (ArrayList_Append(clipboard->stream_list, stream) < 0)
|
||||
{
|
||||
err = ENOMEM;
|
||||
goto error;
|
||||
@ -2632,7 +2632,7 @@ static void xf_cliprdr_fuse_lookup(fuse_req_t req, fuse_ino_t parent, const char
|
||||
stream_id = stream->stream_id;
|
||||
stream->req_ino = ino;
|
||||
clipboard->current_stream_id++;
|
||||
res = ArrayList_Add(clipboard->stream_list, stream);
|
||||
res = ArrayList_Append(clipboard->stream_list, stream);
|
||||
ArrayList_Unlock(clipboard->stream_list);
|
||||
if (res < 0)
|
||||
{
|
||||
|
@ -193,7 +193,7 @@ BOOL xf_event_action_script_init(xfContext* xfc)
|
||||
strtok_s(buffer, "\n", &context);
|
||||
xevent = _strdup(buffer);
|
||||
|
||||
if (!xevent || !ArrayList_Add(xfc->xevents, xevent))
|
||||
if (!xevent || !ArrayList_Append(xfc->xevents, xevent))
|
||||
{
|
||||
pclose(actionScript);
|
||||
ArrayList_Free(xfc->xevents);
|
||||
|
@ -90,7 +90,7 @@ static BOOL xf_keyboard_action_script_init(xfContext* xfc)
|
||||
strtok_s(buffer, "\n", &context);
|
||||
keyCombination = _strdup(buffer);
|
||||
|
||||
if (!keyCombination || !ArrayList_Add(xfc->keyCombinations, keyCombination))
|
||||
if (!keyCombination || !ArrayList_Append(xfc->keyCombinations, keyCombination))
|
||||
{
|
||||
ArrayList_Free(xfc->keyCombinations);
|
||||
xfc->actionScriptExists = FALSE;
|
||||
|
@ -266,7 +266,7 @@ int rpc_send_bind_pdu(rdpRpc* rpc)
|
||||
if (!clientCall)
|
||||
goto fail;
|
||||
|
||||
if (!ArrayList_Add(rpc->client->ClientCallList, clientCall))
|
||||
if (!ArrayList_Append(rpc->client->ClientCallList, clientCall))
|
||||
{
|
||||
rpc_client_call_free(clientCall);
|
||||
goto fail;
|
||||
@ -410,7 +410,7 @@ int rpc_send_rpc_auth_3_pdu(rdpRpc* rpc)
|
||||
length = auth_3_pdu->header.frag_length;
|
||||
clientCall = rpc_client_call_new(auth_3_pdu->header.call_id, 0);
|
||||
|
||||
if (ArrayList_Add(rpc->client->ClientCallList, clientCall))
|
||||
if (ArrayList_Append(rpc->client->ClientCallList, clientCall))
|
||||
{
|
||||
status = rpc_in_channel_send_pdu(inChannel, buffer, length);
|
||||
}
|
||||
|
@ -950,7 +950,7 @@ BOOL rpc_client_write_call(rdpRpc* rpc, wStream* s, UINT16 opnum)
|
||||
if (!clientCall)
|
||||
goto fail;
|
||||
|
||||
if (!ArrayList_Add(rpc->client->ClientCallList, clientCall))
|
||||
if (!ArrayList_Append(rpc->client->ClientCallList, clientCall))
|
||||
{
|
||||
rpc_client_call_free(clientCall);
|
||||
goto fail;
|
||||
|
@ -1218,7 +1218,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualNam
|
||||
|
||||
channel->channelId = InterlockedIncrement(&vcm->dvc_channel_id_seq);
|
||||
|
||||
if (!ArrayList_Add(vcm->dynamicVirtualChannels, channel))
|
||||
if (!ArrayList_Append(vcm->dynamicVirtualChannels, channel))
|
||||
goto fail;
|
||||
|
||||
s = Stream_New(NULL, 64);
|
||||
|
@ -276,7 +276,7 @@ static BOOL pf_modules_register_plugin(proxyPlugin* plugin_to_register)
|
||||
plugin_to_register))
|
||||
return FALSE;
|
||||
|
||||
if (!ArrayList_Add(plugins_list, plugin_to_register))
|
||||
if (!ArrayList_Append(plugins_list, plugin_to_register))
|
||||
{
|
||||
WLog_ERR(TAG, "[%s]: failed adding plugin to list: %s", __FUNCTION__,
|
||||
plugin_to_register->name);
|
||||
@ -364,9 +364,9 @@ static BOOL pf_modules_load_module(const char* module_path)
|
||||
}
|
||||
|
||||
/* save module handle for freeing the module later */
|
||||
if (!ArrayList_Add(handles_list, handle))
|
||||
if (!ArrayList_Append(handles_list, handle))
|
||||
{
|
||||
WLog_ERR(TAG, "ArrayList_Add failed!");
|
||||
WLog_ERR(TAG, "ArrayList_Append failed!");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ static BOOL pf_server_initialize_peer_connection(freerdp_peer* peer)
|
||||
server_receive_channel_data_original = peer->ReceiveChannelData;
|
||||
peer->ReceiveChannelData = pf_server_receive_channel_data_hook;
|
||||
|
||||
if (!ArrayList_Add(server->clients, pdata))
|
||||
if (!ArrayList_Append(server->clients, pdata))
|
||||
return FALSE;
|
||||
|
||||
CountdownEvent_AddCount(server->waitGroup, 1);
|
||||
|
@ -184,7 +184,7 @@ static BOOL shadow_client_context_new(freerdp_peer* peer, rdpShadowClient* clien
|
||||
if (!(client->encoder = shadow_encoder_new(client)))
|
||||
goto fail_encoder_new;
|
||||
|
||||
if (ArrayList_Add(server->clients, (void*)client))
|
||||
if (ArrayList_Append(server->clients, (void*)client))
|
||||
return TRUE;
|
||||
|
||||
shadow_encoder_free(client->encoder);
|
||||
|
@ -270,7 +270,7 @@ void* shadow_multiclient_get_subscriber(rdpShadowMultiClientEvent* event)
|
||||
subscriber->ref = event;
|
||||
subscriber->pleaseHandle = FALSE;
|
||||
|
||||
if (!ArrayList_Add(event->subscribers, subscriber))
|
||||
if (!ArrayList_Append(event->subscribers, subscriber))
|
||||
goto out_free;
|
||||
|
||||
WLog_VRB(TAG, "Get subscriber %p. Wait event %d. %d clients.\n", (void*)subscriber,
|
||||
|
@ -124,7 +124,7 @@ extern "C"
|
||||
WINPR_API void ArrayList_Clear(wArrayList* arrayList);
|
||||
WINPR_API BOOL ArrayList_Contains(wArrayList* arrayList, const void* obj);
|
||||
|
||||
WINPR_API BOOL ArrayList_Add(wArrayList* arrayList, const void* obj);
|
||||
WINPR_API BOOL ArrayList_Append(wArrayList* arrayList, const void* obj);
|
||||
WINPR_API BOOL ArrayList_Insert(wArrayList* arrayList, size_t index, const void* obj);
|
||||
|
||||
WINPR_API BOOL ArrayList_Remove(wArrayList* arrayList, const void* obj);
|
||||
@ -328,7 +328,7 @@ extern "C"
|
||||
{
|
||||
wObject* obj;
|
||||
|
||||
if (!HashTable_SetHashFunction(table, ))
|
||||
if (!HashTable_SetHashFunction(table, HashTable_StringHash))
|
||||
return FALSE;
|
||||
|
||||
obj = HashTable_KeyObject(table);
|
||||
|
@ -360,7 +360,7 @@ static BOOL add_file_to_list(const char* local_name, const WCHAR* remote_name, w
|
||||
if (!file)
|
||||
return FALSE;
|
||||
|
||||
if (!ArrayList_Add(files, file))
|
||||
if (!ArrayList_Append(files, file))
|
||||
{
|
||||
free_posix_file(file);
|
||||
return FALSE;
|
||||
|
@ -200,11 +200,11 @@ static void _HandleCreatorsInit()
|
||||
/*
|
||||
* Register all file handle creators.
|
||||
*/
|
||||
ArrayList_Add(_HandleCreators, GetNamedPipeClientHandleCreator());
|
||||
ArrayList_Append(_HandleCreators, GetNamedPipeClientHandleCreator());
|
||||
#if defined __linux__ && !defined ANDROID
|
||||
ArrayList_Add(_HandleCreators, GetCommHandleCreator());
|
||||
ArrayList_Append(_HandleCreators, GetCommHandleCreator());
|
||||
#endif /* __linux__ && !defined ANDROID */
|
||||
ArrayList_Add(_HandleCreators, GetFileHandleCreator());
|
||||
ArrayList_Append(_HandleCreators, GetFileHandleCreator());
|
||||
}
|
||||
|
||||
#ifdef HAVE_AIO_H
|
||||
|
@ -688,7 +688,7 @@ HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD
|
||||
baseSocket->serverfd = serverfd;
|
||||
baseSocket->references = 0;
|
||||
|
||||
if (!ArrayList_Add(g_NamedPipeServerSockets, baseSocket))
|
||||
if (!ArrayList_Append(g_NamedPipeServerSockets, baseSocket))
|
||||
{
|
||||
free(baseSocket->name);
|
||||
goto out;
|
||||
|
@ -137,7 +137,7 @@ static BOOL InitializeThreadpool(PTP_POOL pool)
|
||||
goto fail_create_threads;
|
||||
}
|
||||
|
||||
if (!ArrayList_Add(pool->Threads, thread))
|
||||
if (!ArrayList_Append(pool->Threads, thread))
|
||||
goto fail_create_threads;
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ BOOL winpr_SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!ArrayList_Add(ptpp->Threads, thread))
|
||||
if (!ArrayList_Append(ptpp->Threads, thread))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ PTP_WORK winpr_CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, PTP_CALLB
|
||||
#ifndef _WIN32
|
||||
|
||||
if (pcbe->CleanupGroup)
|
||||
ArrayList_Add(pcbe->CleanupGroup->groups, work);
|
||||
ArrayList_Append(pcbe->CleanupGroup->groups, work);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ BOOL ArrayList_Contains(wArrayList* arrayList, const void* obj)
|
||||
* Adds an object to the end of the ArrayList.
|
||||
*/
|
||||
|
||||
BOOL ArrayList_Add(wArrayList* arrayList, const void* obj)
|
||||
BOOL ArrayList_Append(wArrayList* arrayList, const void* obj)
|
||||
{
|
||||
size_t index;
|
||||
BOOL rc = FALSE;
|
||||
|
@ -18,7 +18,7 @@ int TestArrayList(int argc, char* argv[])
|
||||
|
||||
for (index = 0; index < elemsToInsert; index++)
|
||||
{
|
||||
if (!ArrayList_Add(arrayList, (void*)index))
|
||||
if (!ArrayList_Append(arrayList, (void*)index))
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA* lpwcx)
|
||||
|
||||
_lpwcx = CloneWindowClass(lpwcx);
|
||||
|
||||
return ArrayList_Add(g_WindowClasses, (void*)_lpwcx);
|
||||
return ArrayList_Append(g_WindowClasses, (void*)_lpwcx);
|
||||
}
|
||||
|
||||
ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW* lpwcx)
|
||||
|
Loading…
Reference in New Issue
Block a user