base: use reference for ascii_to output argument

Issue #1477
This commit is contained in:
Norman Feske
2015-04-10 17:45:35 +02:00
committed by Christian Helmuth
parent d884cf1a9a
commit d9d65aa86b
22 changed files with 86 additions and 51 deletions

View File

@ -23,9 +23,7 @@ namespace Genode {
/**
* Convert ASCII string to mac address
*/
template <>
inline size_t ascii_to<Nic::Mac_address>(char const *s,
Nic::Mac_address* mac, unsigned)
inline size_t ascii_to(char const *s, Nic::Mac_address &mac)
{
enum {
HEX = true,
@ -47,7 +45,7 @@ namespace Genode {
mac_str[i] = (digit(s[hi], HEX) << 4) | digit(s[lo], HEX);
}
Genode::memcpy(mac->addr, mac_str, MAC_SIZE);
Genode::memcpy(mac.addr, mac_str, MAC_SIZE);
return MAC_CHAR_LEN;
}