<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 1:</p><p style="white-space: pre-wrap; word-wrap: break-word;">doesn't it much rather make sense to have at least a helper library containing those things that you are copy+pasting here? something like libosmo-sdp-utils, which then can be used by any of the actual parser codebases? Copy+Pasting of such code really hurts me :/</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Agree.</p><p><a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947/1/include/osmocom/msc/debug.h">File include/osmocom/msc/debug.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947/1/include/osmocom/msc/debug.h@38">Patch Set #1, Line 38:</a> <code style="font-family:monospace,monospace"> size_t len = 64; \</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Makes much more sense having len as a param to avoid almost-sure talloc_realloc on some functions.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947/1/include/osmocom/msc/debug.h@40">Patch Set #1, Line 40:</a> <code style="font-family:monospace,monospace"> char *str = (char*)talloc_named_const(ctx, len, #FUNC_BUF "_c()"); \</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">where does this "ctx" var come from?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947/1/include/osmocom/msc/debug.h@63">Patch Set #1, Line 63:</a> <code style="font-family:monospace,monospace">#define NAME_IMPL(FUNC_C, FUNC_C_ARGS...) \</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">So you return a talloc'ed pointer on success and a static string pointer on error? That will break when you attempt to free it. I'd drop this function completely, null is your friend!</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947/1/src/libmsc/sdp_msg.c">File src/libmsc/sdp_msg.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947/1/src/libmsc/sdp_msg.c@105">Patch Set #1, Line 105:</a> <code style="font-family:monospace,monospace"> codec->fmtp[0] ? codec->fmtp : NULL);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">shouldn't you compare against '\0' here? codec->fmtp[0] != '\0' ? ...</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-msc/+/15947">change 15947</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-msc/+/15947"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If3ce23cd5bab15e2ab4c52ef3e4c75979dffe931 </div>
<div style="display:none"> Gerrit-Change-Number: 15947 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 04 Nov 2019 10:38:27 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>