<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/13808">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  lynxis lazus: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Deprecate usage of osmo_counter_*<br><br>There's not many of those around any more, let's try to move them to<br>osmo_stat_items<br><br>Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2<br>---<br>M include/osmocom/core/counter.h<br>1 file changed, 10 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/core/counter.h b/include/osmocom/core/counter.h</span><br><span>index 259f1ed..dc62791 100644</span><br><span>--- a/include/osmocom/core/counter.h</span><br><span>+++ b/include/osmocom/core/counter.h</span><br><span>@@ -1,5 +1,7 @@</span><br><span> #pragma once</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/core/defs.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! \file counter.h</span><br><span>  *  Common routines regarding counter handling */</span><br><span> </span><br><span>@@ -14,6 +16,7 @@</span><br><span> </span><br><span> /*! Decrement given counter by one</span><br><span>  *  \param[in] ctr Counter that's to be decremented */</span><br><span style="color: hsl(120, 100%, 40%);">+OSMO_DEPRECATED("Implement as osmo_stat_item instead")</span><br><span> static inline void osmo_counter_dec(struct osmo_counter *ctr)</span><br><span> {</span><br><span>  ctr->value--;</span><br><span>@@ -21,26 +24,31 @@</span><br><span> </span><br><span> /*! Increment counter by one.</span><br><span>  *  \param[in] Counter that's to be incremented */</span><br><span style="color: hsl(120, 100%, 40%);">+OSMO_DEPRECATED("Implement as osmo_stat_item instead")</span><br><span> static inline void osmo_counter_inc(struct osmo_counter *ctr)</span><br><span> {</span><br><span>        ctr->value++;</span><br><span> }</span><br><span> </span><br><span> /*! Get current value of counter */</span><br><span style="color: hsl(120, 100%, 40%);">+OSMO_DEPRECATED("Implement as osmo_stat_item instead")</span><br><span> static inline unsigned long osmo_counter_get(struct osmo_counter *ctr)</span><br><span> {</span><br><span>    return ctr->value;</span><br><span> }</span><br><span> </span><br><span> /*! Reset current value of counter to 0 */</span><br><span style="color: hsl(120, 100%, 40%);">+OSMO_DEPRECATED("Implement as osmo_stat_item instead")</span><br><span> static inline void osmo_counter_reset(struct osmo_counter *ctr)</span><br><span> {</span><br><span>       ctr->value = 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-struct osmo_counter *osmo_counter_alloc(const char *name);</span><br><span style="color: hsl(120, 100%, 40%);">+struct osmo_counter *osmo_counter_alloc(const char *name)</span><br><span style="color: hsl(120, 100%, 40%);">+      OSMO_DEPRECATED("Implement as osmo_stat_item instead");</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-void osmo_counter_free(struct osmo_counter *ctr);</span><br><span style="color: hsl(120, 100%, 40%);">+void osmo_counter_free(struct osmo_counter *ctr)</span><br><span style="color: hsl(120, 100%, 40%);">+      OSMO_DEPRECATED("Implement as osmo_stat_item instead");</span><br><span> </span><br><span> int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/13808">change 13808</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/13808"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2 </div>
<div style="display:none"> Gerrit-Change-Number: 13808 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Daniel Willmann <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Daniel Willmann <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> </div>