Change in osmo-sgsn[master]: use enums consistently instead of falling back to int

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Thu Nov 15 13:27:57 UTC 2018


Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, 

I'd like you to reexamine a change. Please visit

    https://gerrit.osmocom.org/11656

to look at the new patch set (#3).

Change subject: use enums consistently instead of falling back to int
......................................................................

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
---
M include/osmocom/sgsn/gprs_sndcp_comp.h
M include/osmocom/sgsn/gprs_sndcp_xid.h
M src/gprs/gprs_sndcp.c
M src/gprs/gprs_sndcp_comp.c
M src/gprs/gprs_sndcp_dcomp.c
M src/gprs/gprs_sndcp_pcomp.c
M src/gprs/gprs_sndcp_xid.c
M tests/sndcp_xid/sndcp_xid_test.c
8 files changed, 180 insertions(+), 88 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/56/11656/3
-- 
To view, visit https://gerrit.osmocom.org/11656
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3771a5c59f4e6fee24083b3c914965baf192cbd7
Gerrit-Change-Number: 11656
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-CC: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181115/e8e8a54a/attachment.htm>


More information about the gerrit-log mailing list