[Click] x86_64 compilation fixes
Eddie Kohler
kohler at cs.ucla.edu
Mon Feb 13 12:33:21 EST 2006
Thanks, applied!
E
Mark Huang wrote:
> A few more.
>
> --Mark
>
> Eddie Kohler wrote:
>
>> Thanks! Thought I got all these a while ago... Checked in.
>
>
> ------------------------------------------------------------------------
>
> Patch: Fix various pointer-to-integer-cast fatal warnings. Pointers are
> 8 bytes on x86_64.
> Signed-off-by: Mark Huang <mlhuang at cs.princeton.edu>
>
> Index: elements/analysis/aggcounter.cc
> ===================================================================
> RCS file: /cvs/click/elements/analysis/aggcounter.cc,v
> retrieving revision 1.1.1.6
> diff -u -r1.1.1.6 aggcounter.cc
> --- elements/analysis/aggcounter.cc 2 Feb 2006 20:04:53 -0000 1.1.1.6
> +++ elements/analysis/aggcounter.cc 10 Feb 2006 20:44:47 -0000
> @@ -423,7 +423,7 @@
> String fn;
> if (!cp_filename(cp_uncomment(data), &fn))
> return errh->error("argument should be filename");
> - int int_thunk = (int)thunk;
> + int int_thunk = (intptr_t)thunk;
> return ac->write_file(fn, (WriteFormat)int_thunk, errh);
> }
>
> @@ -436,7 +436,7 @@
> AggregateCounter::read_handler(Element *e, void *thunk)
> {
> AggregateCounter *ac = static_cast<AggregateCounter *>(e);
> - switch ((int)thunk) {
> + switch ((intptr_t)thunk) {
> case AC_FROZEN:
> return cp_unparse_bool(ac->_frozen);
> case AC_ACTIVE:
> @@ -467,7 +467,7 @@
> {
> AggregateCounter *ac = static_cast<AggregateCounter *>(e);
> String s = cp_uncomment(data);
> - switch ((int)thunk) {
> + switch ((intptr_t)thunk) {
> case AC_FROZEN: {
> bool val;
> if (!cp_bool(s, &val))
> Index: elements/analysis/timestampaccum.cc
> ===================================================================
> RCS file: /cvs/click/elements/analysis/timestampaccum.cc,v
> retrieving revision 1.1.1.3
> diff -u -r1.1.1.3 timestampaccum.cc
> --- elements/analysis/timestampaccum.cc 2 Feb 2006 20:04:53 -0000 1.1.1.3
> +++ elements/analysis/timestampaccum.cc 10 Feb 2006 20:44:47 -0000
> @@ -49,7 +49,7 @@
> TimestampAccum::read_handler(Element *e, void *thunk)
> {
> TimestampAccum *ta = static_cast<TimestampAccum *>(e);
> - int which = reinterpret_cast<int>(thunk);
> + int which = reinterpret_cast<intptr_t>(thunk);
> switch (which) {
> case 0:
> return String(ta->_count);
> Index: elements/userlevel/ipflowrawsockets.cc
> ===================================================================
> RCS file: /cvs/click/elements/userlevel/ipflowrawsockets.cc,v
> retrieving revision 1.10
> diff -u -r1.10 ipflowrawsockets.cc
> --- elements/userlevel/ipflowrawsockets.cc 2 Feb 2006 20:37:08 -0000 1.10
> +++ elements/userlevel/ipflowrawsockets.cc 10 Feb 2006 20:44:47 -0000
> @@ -331,7 +331,7 @@
> pcap_dispatch(f->pcap(), 1, IPFlowRawSockets_get_packet, (u_char *) p);
> if (p->length() && fake_pcap_force_ip(p, f->datalink())) {
> // Pull off the link header
> - p->pull((unsigned)p->ip_header() - (unsigned)p->data());
> + p->pull((intptr_t)p->ip_header() - (intptr_t)p->data());
> output(0).push(p);
> } else
> p->kill();
More information about the click
mailing list