Ethereal-dev: Re: [Ethereal-dev] Some more unused parameter patches

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sun, 14 Apr 2002 16:23:16 -0700
On Sun, Apr 14, 2002 at 02:48:39PM +0200, Joerg Mayer wrote:
> the attached patch fixes some more unused warnings.

Checked in (except for the capture_ patches, as per your later mail).

>    /* Build TCP and IP headers */
>    hdrlen = lo_nibble(ip->ihl_version) * 4 + TCP_OFFSET(thp) * 4;
> -  thp->cksum = htons((tvb_get_guint8(src_tvb, offset++) << 8) | 
> -                      tvb_get_guint8(src_tvb, offset++));
> +  thp->cksum = tvb_get_guint8(src_tvb, offset++) << 8;
> +  thp->cksum |= tvb_get_guint8(src_tvb, offset++);
> +  thp->cksum = htons(thp->cksum);

I also changed that to just use "tvb_get_ntohs()" rather than to do the
"ntohs" by hand.