Displaying 1 result from an estimated 1 matches for "byhex".
Did you mean:
cyhex
2007 Aug 01
2
getting hex out of ints
...numerous approaches to do this but i''ve hit a wall every time. I''ve tried:
1) self->arg = sprintf(arg0);
no, cuz dtrace has no sprintf
2) self->arg = string((void*)arg0);
no, cuz it tried to dereference arg0, but it''s a value
Then I wrote a translator:
struct byhex {
string hex;
};
translator struct byhex <uint64_t arg> {
hex = ...
};
....
self->arg = xlate<struct byhex>(arg).hex;
BUT there''s nothing i can do to populate hex! Even if i do conversion myself, by doing stuff like:
arg&0xF < 10 ? (arg&0xF) +...