<p>Daniel Willmann has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/13808">View Change</a></p><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, 8 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/13808/1</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..5ab6578 100644</span><br><span>--- a/include/osmocom/core/counter.h</span><br><span>+++ b/include/osmocom/core/counter.h</span><br><span>@@ -15,6 +15,7 @@</span><br><span> /*! Decrement given counter by one</span><br><span>  *  \param[in] ctr Counter that's to be decremented */</span><br><span> static inline void osmo_counter_dec(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>        ctr->value--;</span><br><span> }</span><br><span>@@ -22,25 +23,30 @@</span><br><span> /*! Increment counter by one.</span><br><span>  *  \param[in] Counter that's to be incremented */</span><br><span> static inline void osmo_counter_inc(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>        ctr->value++;</span><br><span> }</span><br><span> </span><br><span> /*! Get current value of counter */</span><br><span> static inline unsigned long osmo_counter_get(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>        return ctr->value;</span><br><span> }</span><br><span> </span><br><span> /*! Reset current value of counter to 0 */</span><br><span> static inline void osmo_counter_reset(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>        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: newchange </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: 1 </div>
<div style="display:none"> Gerrit-Owner: Daniel Willmann <dwillmann@sysmocom.de> </div>