Common library for all Osmocom projects (libosmocore, libosmogsm, libosmovty, libosmogb, libosmosim, libosmousb, ...) https://osmocom.org/projects/libosmocore
Go to file
Neels Hofmeyr 7c1ec8c8e7 ctrl_type_vals: explicitly terminate
Don't use CTRL_TYPE_UNKNOWN as value_string[] terminator, use an explicit, more
obvious { 0, NULL } termination. Set an explicit string for CTRL_TYPE_UNKNOWN.
No other value_string[]s to date have such a "hidden" terminator.

BTW, a { 0, "string" } item is not a terminator, only { 0, NULL } is, so we can
set a string for CTRL_TYPE_UNKNOWN == 0.

Also, having a string value for CTRL_TYPE_UNKNOWN is not harmful because all
code paths explicitly check for the CTRL_TYPE_*s that are valid.

Adjust the test expectation.

From the ctrl_type_vals enum, remove the = 0, because it is implicitly 0
anyway.

One motivation to press this fixup: I am trying to add a script that checks
whether all value_string[]s are terminated to our jenkins jobs, and to find
that this one is terminated, it would need to interpret the CTRL_TYPE_UNKNOWN
constant, which would make things far more complex. At this point, all of the
value_string[]s have an explicit termination, and I would like to enforce this
from now on -- for readable code and to not spend more time on the validator.

The patch adding ctrl_type_vals (Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28) was
accepted by another reviewer before I could reconfirm my -1, so this is a fixup
to enable the termination checking script patches.

Related: I2bc93ab4781487e7685cfb63091a489cd126b1a8 (adds script to libosmocore)
         I7fe3678b524d602fc6aa14bc0ed06308df809a3e (uses in jenkins.sh)
	 Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28 (adds ctrl_type_vals)

Change-Id: Ia99f37464c7b36b587da2cc78f52c82725f02cbc
2017-03-15 13:47:20 +00:00
contrib contrib: add fsm-to-dot.py to draw osmo_fsm dotty graphs 2016-12-09 11:29:06 +00:00
debian libosmocoding: fix .deb building 2017-03-07 15:36:33 +01:00
doc OAP:remove design doc. osmocom-authn-protocol.txt 2017-02-15 17:56:39 +01:00
include ctrl_type_vals: explicitly terminate 2017-03-15 13:47:20 +00:00
m4 Create a dummy m4 directory to make autoreconf --install --force work 2010-03-24 02:55:33 +01:00
src ctrl_type_vals: explicitly terminate 2017-03-15 13:47:20 +00:00
tests ctrl_type_vals: explicitly terminate 2017-03-15 13:47:20 +00:00
utils osmo_auth_gen_vec: UMTS auth: store last used SQN, not next 2017-03-15 12:46:08 +00:00
.gitignore libosmocoding: migrate transcoding routines from OsmoBTS 2017-03-07 01:06:38 +07:00
.gitreview add .gitreview 2016-05-19 06:39:13 +00:00
.mailmap Add .mailmap file for mapping mail addresses in shortlog 2016-08-08 13:12:17 +02:00
COPYING add GPL to project source 2010-02-21 09:21:30 +01:00
Doxyfile.codec.in Doxygen: enable tagfile generation and usage for cross-project references 2016-04-24 19:48:05 +02:00
Doxyfile.coding.in libosmocoding: migrate transcoding routines from OsmoBTS 2017-03-07 01:06:38 +07:00
Doxyfile.core.in Doxygen: enable tagfile generation and usage for cross-project references 2016-04-24 19:48:05 +02:00
Doxyfile.gsm.in Doxygen: exclude osmocom/core/gsm/protocol/* 2017-03-15 09:13:38 +00:00
Doxyfile.vty.in Doxygen: enable tagfile generation and usage for cross-project references 2016-04-24 19:48:05 +02:00
Makefile.am add osmo-auc-gen_test 2017-03-15 12:46:08 +00:00
TODO-RELEASE GSUP, OAP, osmo-gen-vec: fix AUTS length to 14, not 16 2017-02-02 20:34:16 +01:00
configure.ac libosmocoding: migrate transcoding routines from OsmoBTS 2017-03-07 01:06:38 +07:00
git-version-gen add git-version-gen magic to automatically generate package version 2010-03-23 00:30:19 +08:00
libosmocodec.pc.in codec: Add the missing bits for include to install and pkgconfig to work 2010-10-24 18:23:10 +02:00
libosmocoding.pc.in libosmocoding: migrate transcoding routines from OsmoBTS 2017-03-07 01:06:38 +07:00
libosmocore.pc.in talloc: Untested change to unbreak build 2015-12-10 19:50:29 +01:00
libosmoctrl.pc.in remove our internal copy of talloc, use system libtalloc 2015-12-05 23:38:18 +01:00
libosmogb.pc.in remove our internal copy of talloc, use system libtalloc 2015-12-05 23:38:18 +01:00
libosmogsm.pc.in remove our internal copy of talloc, use system libtalloc 2015-12-05 23:38:18 +01:00
libosmosim.pc.in remove our internal copy of talloc, use system libtalloc 2015-12-05 23:38:18 +01:00
libosmovty.pc.in remove our internal copy of talloc, use system libtalloc 2015-12-05 23:38:18 +01:00