<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>

</head>

<body lang="DE" link="blue" vlink="purple">

<div class="WordSection1">

<p class="MsoNormal">Hi all.</p>

<p class="MsoNormal"> </p>

<p class="MsoNormal"><span lang="EN-US">What is the reason enet uses unsigned int
and these time overflow macros in time.h?</span></p>

<p class="MsoNormal"><span lang="EN-US">I enet would simply use signed int, these
macros would not be needed at all.</span></p>

<p class="MsoNormal"><span lang="EN-US">For example if we have a time INT_MAX and a
second one INT_MIN , 1ms later, directly after the overflow, INT_MIN-INT_MAX
would result in the correct difference 1 and INT_MAX-INT_MIN in the correct
difference -1. No need for the use of ENET_TIME_DIFFERENCE at all for signed
int.</span></p>

<p class="MsoNormal"><span lang="EN-US">On the other hand, if we call
ENET_TIME_DIFFERENCE(a, b) with a==1 and b==2, the result is b-a -&gt; 1,
although the correct result would have been -1.</span></p>

<p class="MsoNormal"><span lang="EN-US">If some functions need unsigned times or
return unsigned times, you could simply them from/to signed int, and all would
be fine.</span></p>

<p class="MsoNormal"><span lang="EN-US">So I do not see any advantage in using
unsigned int and time.h macros instead of simply use signed int. Can you tell
me the reasons for the unsigned + time.h solution?</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Thx,</span></p>

<p class="MsoNormal"><span lang="EN-US">Stefan.</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

</div>

</body>

</html>