<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/9375">View Change</a></p><p>10 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c">File res/parking/parking_bridge_features.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.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@47">Patch Set #1, Line 47:</a> <code style="font-family:monospace,monospace">        <function name="CHECK_PARKING_SLOT" language="en_US"></code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I lean toward renaming this function to "IS_PARKING_SLOT_OCCUPIED".</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@72">Patch Set #1, Line 72:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">                <description><br>                        <para>This function returns true if the current parking slot<br>                        in the parking lot space is occupied.</para><br>                </description><br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This descriptions appears to be copy/pasted from the other function. Update this to reflect what GET_PARKING_SLOT_CHANNEL does.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@772">Patch Set #1, Line 772:</a> <code style="font-family:monospace,monospace"> if (ast_strlen_zero(args.parking_space) || sscanf(args.parking_space, "%30d", &space) != 1) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Probably want to check for a negative space value?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@779">Patch Set #1, Line 779:</a> <code style="font-family:monospace,monospace">        </code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Remove extra whitespace</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@782">Patch Set #1, Line 782:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> } else {<br>              ret = 0;<br>      }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">No need to set 'ret' again here as you did it above. Alternatively you could just copy the string here in this if/else branch and remove the variable altogether.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@788">Patch Set #1, Line 788:</a> <code style="font-family:monospace,monospace">       return 0;       </code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Remove the extra spaces at the end of the line.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@823">Patch Set #1, Line 823:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">        if (!ast_strlen_zero(args.parking_space)) {<br>                if (sscanf(args.parking_space, "%d", &space) != 1 || space < 0) {<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Might be able to use 'ast_str_to_uint' here instead of the sscanf nomenclature? As it converts and checks for negatives. (see conversions.h)</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@809">Patch Set #1, Line 809:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  if (args.argc < 2) {<br>               /* Didn't receive enough arguments to do anything */<br>              ast_log(LOG_ERROR,<br>                    "Usage: %s(<parking_space>,<parking_lot>)\n",<br>                   function);<br>            return -1;<br>    }<br><br>   lot = parking_lot_find_by_name(args.parking_lot);<br>     if (!lot) {<br>           ast_log(LOG_ERROR, "Could not find parking lot: '%s'\n", args.parking_lot);<br>         return -1;<br>    }<br><br>        if (!ast_strlen_zero(args.parking_space)) {<br>                if (sscanf(args.parking_space, "%d", &space) != 1 || space < 0) {<br>                        ast_log(LOG_ERROR, "value '%s' for parking_space argument is invalid. Must be an integer greater than 0.\n", args.parking_space);<br>                        return -1;<br>                }<br>        }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">A lot of code is duplicated in the other function. It might make sense to combine the duplicated code into a single function called by both of these.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@823">Patch Set #1, Line 823:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">       if (!ast_strlen_zero(args.parking_space)) {<br>                if (sscanf(args.parking_space, "%d", &space) != 1 || space < 0) {<br>                        ast_log(LOG_ERROR, "value '%s' for parking_space argument is invalid. Must be an integer greater than 0.\n", args.parking_space);<br>                        return -1;<br>                }<br>        }<br><br>        pu = parking_lot_retrieve_parked_user(lot, space);<br>        if (!pu) {<br>                return -1;<br>        }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">tabify this block.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9375/1/res/parking/parking_bridge_features.c@838">Patch Set #1, Line 838:</a> <code style="font-family:monospace,monospace">     return 0;       </code></p><p style="white-space: pre-wrap; word-wrap: break-word;">remove extra whitespace.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/9375">change 9375</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.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.asterisk.org/9375"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Idba6ae55b8a53f734238cb3d995cedb95c0e7b74 </div>
<div style="display:none"> Gerrit-Change-Number: 9375 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Elson <joshelson@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 06 Jul 2018 23:07:11 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>