Max has posted comments on this change. ( https://gerrit.osmocom.org/12682 )

Change subject: Support Emergency Calling
......................................................................


Patch Set 6: Code-Review-1

(2 comments)

It kinda feels like you're "cheating" compiler in here to keep the 'const' in 
place. Sure, you can outsmart compiler but I don't think you should. The 
'const' is just an indicator for you (and any other person reading the code) to 
make it easier to understand what the code touches. Compiler is trying its best 
to check this expectation at compile-time - this check isn't perfect and we 
shouldn't make it even harder.

If you change some data - just drop the 'const' from corresponding pointer, 
even if compiler fails to warn you about it.

Especially in this case where all the check_*() functions are called on buffer 
local to the mncc_data(), which isn't used after it's checked by single 
check_() function.

https://gerrit.osmocom.org/#/c/12682/6/src/mncc.c
File src/mncc.c:

https://gerrit.osmocom.org/#/c/12682/6/src/mncc.c@418
PS6, Line 418:  uint32_t fields;
Erm, why?


https://gerrit.osmocom.org/#/c/12682/6/src/mncc.c@440
PS6, Line 440:  if ((fields & MNCC_F_CALLING) == 0) {
I'd rather avoid changing this.



--
To view, visit https://gerrit.osmocom.org/12682
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5d0adb61dfa82e7ded5f41d9bc773d546112c9f1
Gerrit-Change-Number: 12682
Gerrit-PatchSet: 6
Gerrit-Owner: Keith Whyte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Keith Whyte <[email protected]>
Gerrit-Reviewer: Max <[email protected]>
Gerrit-CC: Harald Welte <[email protected]>
Gerrit-Comment-Date: Mon, 28 Jan 2019 10:58:33 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes

Reply via email to