<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7316">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">aoc: Remove silly usage of RAII_VAR.<br><br>Change-Id: I07907f833b81aeb0128bc9442a2abb52679c7511<br>---<br>M main/aoc.c<br>1 file changed, 12 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/16/7316/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/aoc.c b/main/aoc.c<br>index 707dbb0..725e910 100644<br>--- a/main/aoc.c<br>+++ b/main/aoc.c<br>@@ -1664,7 +1664,7 @@<br> <br> static struct ast_json *charge_to_json(const struct ast_aoc_decoded *decoded)<br> {<br>-   RAII_VAR(struct ast_json *, obj, NULL, ast_json_unref);<br>+      struct ast_json *obj;<br>         const char *obj_type;<br> <br>      if (decoded->charge_type != AST_AOC_CHARGE_CURRENCY &&<br>@@ -1686,7 +1686,7 @@<br>              "Type", aoc_charge_type_str(decoded->charge_type),<br>               "BillingID", aoc_billingid_str(decoded->billing_id),<br>             "TotalType", aoc_type_of_totaling_str(decoded->total_type),<br>-             obj_type, ast_json_ref(obj));<br>+                obj_type, obj);<br> }<br> <br> static struct ast_json *association_to_json(const struct ast_aoc_decoded *decoded)<br>@@ -1715,8 +1715,8 @@<br> <br>         for (i = 0; i < decoded->aoc_s_count; ++i) {<br>            struct ast_json *rate;<br>-               RAII_VAR(struct ast_json *, type, NULL, ast_json_unref);<br>-             RAII_VAR(struct ast_json *, currency, NULL, ast_json_unref);<br>+         struct ast_json *type = NULL;<br>+                struct ast_json *currency;<br>            const char *charge_item = aoc_charged_item_str(<br>                       decoded->aoc_s_entries[i].charged_item);<br> <br>@@ -1731,8 +1731,8 @@<br>                 switch (decoded->aoc_s_entries[i].rate_type) {<br>             case AST_AOC_RATE_TYPE_DURATION:<br>              {<br>-                    RAII_VAR(struct ast_json *, time, NULL, ast_json_unref);<br>-                     RAII_VAR(struct ast_json *, granularity, NULL, ast_json_unref);<br>+                      struct ast_json *time;<br>+                       struct ast_json *granularity = NULL;<br> <br>                       currency = currency_to_json(<br>                          decoded->aoc_s_entries[i].rate.duration.currency_name,<br>@@ -1750,11 +1750,11 @@<br>                    }<br> <br>                  type = ast_json_pack("{s:o, s:s, s:o, s:o}",<br>-                               "Currency", ast_json_ref(currency),<br>+                                "Currency", currency,<br>                               "ChargingType", decoded->aoc_s_entries[i].rate.duration.charging_type<br>                                    ? "StepFunction" : "ContinuousCharging",<br>-                         "Time", ast_json_ref(time),<br>-                                "Granularity", granularity ? ast_json_ref(granularity) : ast_json_null());<br>+                         "Time", time,<br>+                              "Granularity", granularity ?: ast_json_null());<br> <br>                  break;<br>                }<br>@@ -1764,7 +1764,7 @@<br>                              decoded->aoc_s_entries[i].rate.flat.amount,<br>                                decoded->aoc_s_entries[i].rate.flat.multiplier);<br> <br>-                       type = ast_json_pack("{s:o}", "Currency", ast_json_ref(currency));<br>+                       type = ast_json_pack("{s:o}", "Currency", currency);<br>                      break;<br>                case AST_AOC_RATE_TYPE_VOLUME:<br>                        currency = currency_to_json(<br>@@ -1775,7 +1775,7 @@<br>                   type = ast_json_pack("{s:s, s:o}",<br>                          "Unit", aoc_volume_unit_str(<br>                                        decoded->aoc_s_entries[i].rate.volume.volume_unit),<br>-                               "Currency", ast_json_ref(currency));<br>+                               "Currency", currency);<br>                      break;<br>                case AST_AOC_RATE_TYPE_SPECIAL_CODE:<br>                  type = ast_json_pack("{s:i}",<br>@@ -1787,7 +1787,7 @@<br> <br>             rate = ast_json_pack("{s:s, s:o}",<br>                  "Chargeable", charge_item,<br>-                 aoc_rate_type_str(decoded->aoc_s_entries[i].rate_type), ast_json_ref(type));<br>+                      aoc_rate_type_str(decoded->aoc_s_entries[i].rate_type), type);<br>             if (ast_json_array_append(rates, rate)) {<br>                     break;<br>                }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7316">change 7316</a>. To unsubscribe, 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/7316"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I07907f833b81aeb0128bc9442a2abb52679c7511 </div>
<div style="display:none"> Gerrit-Change-Number: 7316 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>