|
From: Olly B. <ol...@su...> - 2006-03-08 01:40:01
|
On 2006-03-08, Nicholas Nethercote <nj...@cs...> wrote:
> ULong data;
> switch (size) {
> case 1: data = *(UChar*)addr;
> case 2: data = *(UShort*)addr;
> case 4: data = *(UInt*)addr;
> case 8: data = *(ULong*)addr;
> default: /*barf*/
> }
>
> I think that'll work.
Not without the addition of "break;" after each case!
Cheers,
Olly
|