vbox5: remove use of base/snprintf.h

Issue #2064
This commit is contained in:
Norman Feske 2023-03-06 12:30:48 +01:00 committed by Christian Helmuth
parent 36c00cc294
commit 8b44f49d75
2 changed files with 5 additions and 11 deletions

View File

@ -39,7 +39,6 @@
#include <nic_session/connection.h> #include <nic_session/connection.h>
#include <nic/packet_allocator.h> #include <nic/packet_allocator.h>
#include <base/snprintf.h>
#include <internal/thread_create.h> #include <internal/thread_create.h>
@ -187,7 +186,8 @@ class Nic_client
public: public:
Nic_client(Genode::Env &env, PDRVNIC drvtap, char const *label) Nic_client(Genode::Env &env, PDRVNIC drvtap,
Genode::Session::Label const &label)
: :
_tx_block_alloc(_packet_allocator()), _tx_block_alloc(_packet_allocator()),
_nic(env, _tx_block_alloc, BUF_SIZE, BUF_SIZE, label), _nic(env, _tx_block_alloc, BUF_SIZE, BUF_SIZE, label),
@ -540,19 +540,17 @@ static DECLCALLBACK(int) drvNicConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uin
N_("Configuration error: the above device/driver" N_("Configuration error: the above device/driver"
" didn't export the network config interface!\n")); " didn't export the network config interface!\n"));
char label[8];
uint64_t slot; uint64_t slot;
rc = CFGMR3QueryInteger(pCfg, "Slot", &slot); rc = CFGMR3QueryInteger(pCfg, "Slot", &slot);
if (RT_FAILURE(rc)) if (RT_FAILURE(rc))
return PDMDRV_SET_ERROR(pDrvIns, rc, return PDMDRV_SET_ERROR(pDrvIns, rc,
N_("Configuration error: Failed to retrieve the network interface slot")); N_("Configuration error: Failed to retrieve the network interface slot"));
Genode::snprintf(label, sizeof(label), "%d", slot);
/* /*
* Setup Genode nic_session connection * Setup Genode nic_session connection
*/ */
try { try {
pThis->nic_client = new (vmm_heap()) Nic_client(genode_env(), pThis, label); pThis->nic_client = new (vmm_heap()) Nic_client(genode_env(), pThis, slot);
} catch (...) { } catch (...) {
return VERR_HOSTIF_INIT_FAILED; return VERR_HOSTIF_INIT_FAILED;
} }

View File

@ -70,13 +70,9 @@ static Genode::Cpu_connection * cpu_connection(RTTHREADTYPE type)
if (con[type - 1]) if (con[type - 1])
return con[type - 1]; return con[type - 1];
char * data = new (vmm_heap()) char[16]; con[type - 1] = new (vmm_heap()) Cpu_connection(genode_env(),
{ "vbox ", unsigned(type) },
Genode::snprintf(data, 16, "vbox %u", type);
con[type - 1] = new (vmm_heap()) Cpu_connection(genode_env(), data,
prio_class(type)); prio_class(type));
return con[type - 1]; return con[type - 1];
} }