Ethereal-dev: [Ethereal-dev] Solve Compiler Warnings

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

From: Andrew Esh <root@xxxxxxxxxxxxxxxxx>
Date: Thu, 16 May 2002 14:07:18 -0500
This solves a series of compiler warnings gcc (RedHat 7.1/i386) was
giving when it compiled packet-x11.c. In BITMASK32, VALUE16 needed a
typecast. Also added typecasts to VALUE8 and VALUE32, even though they
aren't required at this time.

Compiled, but not tested.

-- 
Andrew C. Esh              mail:Andrew.Esh@xxxxxxxxxxx
Tricord Systems, Inc.
2905 Northwest Blvd., Suite 20   763-557-9005 (main)
Plymouth, MN 55441-2644 USA      763-551-6418 (direct)
http://www.tricord.com - Tricord Home Page


Index: packet-x11.c
===================================================================
RCS file: /cvsroot/ethereal/packet-x11.c,v retrieving revision 1.43
diff -a -u -c -r1.43 packet-x11.c cvs server: conflicting
specifications of output style *** packet-x11.c 2002/04/23 06:06:03
1.43 --- packet-x11.c 2002/05/16 19:02:08
***************
*** 667,675 ****
        int bitmask_offset; \
        int bitmask_size; \
        proto_tree *bitmask_tree; \
!       bitmask_value = ((size == 1) ? VALUE8(tvb, *offsetp) : \
! 		       ((size == 2) ? VALUE16(tvb, *offsetp) : \
! 				      VALUE32(tvb, *offsetp))); \
        bitmask_offset = *offsetp; \
        bitmask_size = size; \
        ti = proto_tree_add_uint(t, hf_x11_##name##_mask, tvb, *offsetp, size, bitmask_value); \
--- 667,675 ----
        int bitmask_offset; \
        int bitmask_size; \
        proto_tree *bitmask_tree; \
!       bitmask_value = ((size == 1) ? (guint32)VALUE8(tvb, *offsetp) : \
! 		       ((size == 2) ? (guint32)VALUE16(tvb, *offsetp) : \
! 			              (guint32)VALUE32(tvb, *offsetp))); \
        bitmask_offset = *offsetp; \
        bitmask_size = size; \
        ti = proto_tree_add_uint(t, hf_x11_##name##_mask, tvb, *offsetp, size, bitmask_value); \