Attention is currently required from: neels, pespin, fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/30114 )
Change subject: add codec_mapping.h,c ......................................................................
Patch Set 4:
(2 comments)
File include/osmocom/msc/codec_mapping.h:
https://gerrit.osmocom.org/c/osmo-msc/+/30114/comment/884cf9a5_8efb05bd PS4, Line 44: for ((CODEC_MAPPING) = codec_map; (CODEC_MAPPING) < codec_map + ARRAY_SIZE(codec_map); (CODEC_MAPPING)++)
this looks buggy to me. […]
It's an interesting question if the preprocessor really can determine the size here or not. In general, the codec_mapping codec_map[] is just a forward-declaration. My gut feeling is that the code as written here will work. But whether it's a gcc side-effect or something guaranteed to work, I don't know.
File src/libmsc/codec_mapping.c:
https://gerrit.osmocom.org/c/osmo-msc/+/30114/comment/b7acbf05_3a1cecfc PS4, Line 290: if (bearer_cap->speech_ver[i] == -1) {
Better add this "-1" as a define "FOOBAR_UNSET"
I actually think -1 is more obvious, and I think we have plenty of similar examples