<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=4679640" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kaspar030">@kaspar030</a> as I wrote the timer API is inconsistent as it uses <code>0</code> for success for <code>timer_init</code> but <code>1</code> for all other functions. But also it <em>always</em> uses <code>-1</code> for error, hence true/false (bool logic) doesn't work either -> would always be true for <code>timer_set</code> in the current state (master).</p>
<p>So to me the fix is either as proposed in this PR, or change return code for <code>timer_set</code> to <code>0</code> on error. But then it is confusing compared to <code>timer_init</code>.</p>
<p>Also the (not so) funny fact is that in master most implementation already follow the logic for return codes as proposed in this PR. I guess bc the implementer didn't read the API doc and copied from <code>timer_init</code> or was used to have <code>0</code> on success from other C projects and hence assumed RIOT follows that.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/12199?email_source=notifications&email_token=ABE7WYA7KGCB3FBCJH557L3QJDRCPA5CNFSM4IVTDOPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OKVOA#issuecomment-530361016">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYAXJ6FAL3S4ODVT2LLQJDRCPANCNFSM4IVTDOPA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYETVFVWZGUYWSDKFZLQJDRCPA5CNFSM4IVTDOPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OKVOA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/12199?email_source=notifications\u0026email_token=ABE7WYA7KGCB3FBCJH557L3QJDRCPA5CNFSM4IVTDOPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OKVOA#issuecomment-530361016",
"url": "https://github.com/RIOT-OS/RIOT/pull/12199?email_source=notifications\u0026email_token=ABE7WYA7KGCB3FBCJH557L3QJDRCPA5CNFSM4IVTDOPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OKVOA#issuecomment-530361016",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>