On Wed, 05.10.05 15:04, pHilipp Zabel ([EMAIL PROTECTED]) wrote: > > First you disassemble the bytes in the packet. This looks right to me. > > > > > + d = (uint8_t*) ret_v; > > > + d[0] = ((uint8_t*)(&tmp_v))[0]; > > > + d[1] = ((uint8_t*)(&tmp_v))[1]; > > > > And now you copy a 16 bit value to a 16 bit value? > > > > What about just using *ret_v = tmp_v? Or even shorter: dumping tmp_v > > and write directly to ret_v? > > I can only do this on arm if ret_v is aligned. If ret_v is guaranteed > to be aligned, this is indeed superfluous.
It certainly is guaranteed. That pointer points to some uint16_t variable owned by the caller, which should be aligned. And if it isn't it is a bug in the caller. Lennart -- Lennart Poettering; lennart [at] poettering [dot] de ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.de/lennart/ _______________________________________________ avahi mailing list avahi@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/avahi