use enums consistently instead of falling back to int

The two existing enums defined in gprs_sndcp_xid.h, for protocol
and data compression algorithm numbers respectively, were assigned
to 'int' variables when their values were copied to other structures.

This prevented the compiler from checking the enum value coverage
during switch statements and also tripped up Coverity scans looking
for enum value mismatch problems.

So instead of copying enums to ints, make use of the enums throughout.
Structures which can contain values from both enums now use a union
of both, forcing us to be very explicit about which set of values
we are dealing with.

Change-Id: I3771a5c59f4e6fee24083b3c914965baf192cbd7
Depends: If6f3598cd6da4643ff2214e21c0d21f6eff0eb67
Depends: I8444c1ed052707c76a979fb06cb018ac678defa7
Related: CID#149102
diff --git a/include/osmocom/sgsn/gprs_sndcp_comp.h b/include/osmocom/sgsn/gprs_sndcp_comp.h
index c04f7d4..e01a9d7 100644
--- a/include/osmocom/sgsn/gprs_sndcp_comp.h
+++ b/include/osmocom/sgsn/gprs_sndcp_comp.h
@@ -41,9 +41,9 @@
 	uint8_t comp[MAX_COMP];	/* see also: 6.5.1.1.5 and 6.6.1.1.5 */
 
 	/* Algorithm parameters */
-	int algo;		/* Algorithm type (see gprs_sndcp_xid.h) */
-	int compclass;		/* See gprs_sndcp_xid.h/c */
-	void *state;		/* Algorithm status and parameters */
+	union gprs_sndcp_comp_algo algo;
+	enum gprs_sndcp_xid_param_types compclass;	/* See gprs_sndcp_xid.h/c */
+	void *state;					/* Algorithm status and parameters */
 };
 
 #define MAX_COMP 16	/* Maximum number of possible pcomp/dcomp values */