<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>



<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.com/rockdaboot">Tim Rühsen</a>
commented on a
discussion on <a href="https://gitlab.com/gnutls/gnutls/merge_requests/1151#note_276085450">lib/hello_ext.c</a>:
</p>
<table>
<tr class="line_holder" id="">
<td class="diff-line-num old_line" data-linenumber="295" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
295
</td>
<td class="diff-line-num new_line" data-linenumber="295" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
295
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC295" class="line" lang="c">    <span class="kt" style="color: #458; font-weight: 600;">int</span> <span class="n" style="color: #333;">ret</span><span class="p">;</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="">
<td class="diff-line-num old_line" data-linenumber="296" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
296
</td>
<td class="diff-line-num new_line" data-linenumber="296" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
296
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC296" class="line" lang="c">    <span class="n" style="color: #333;">hello_ext_ctx_st</span> <span class="n" style="color: #333;">ctx</span><span class="p">;</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="">
<td class="diff-line-num old_line" data-linenumber="297" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
297
</td>
<td class="diff-line-num new_line" data-linenumber="297" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
297
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC297" class="line" lang="c"></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="">
<td class="diff-line-num old old_line" data-linenumber="298" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
298
</td>
<td class="diff-line-num new_line old" data-linenumber="298" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC298" class="line" lang="c">    <span class="n" style="color: #333;">msg</span> <span class="o" style="font-weight: 600;">&=</span> <span class="n" style="color: #333;">GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK</span><span class="p">;</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="">
<td class="diff-line-num new old_line" data-linenumber="299" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="298" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
298
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC298" class="line" lang="c">    <span class="n" style="color: #333;">msg</span> <span class="o" style="font-weight: 600;">&=</span> <span class="p"><span class="idiff left">(</span></span><span class="n" style="color: #333;"><span class="idiff">gnutls_ext_flags_t</span></span><span class="p"><span class="idiff">)</span></span><span class="idiff right"> </span><span class="n" style="color: #333;">GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK</span><span class="p">;</span></span>
</pre>
</td>
</tr>

</table>
<div style="">
<p dir="auto">No - we need enum type safety here. <code>gnutls_ext_flags_t</code> is a collection of some single bit values. <code>GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK</code> is <em>not</em> a <code>gnutls_ext_flags_t</code>. Since an enum has no fixed type (every compiler is free to use any integer type, signed or unsigned), we'll either need this cast <em>or</em> we have to make <code>GNUTLS_EXT_FLAG_SET_ONLY_FLAGS_MASK</code> a <code>gnutls_ext_flags_t</code>.</p>
<p dir="auto">I chose the first possibility. If you like the second possibility more, I can change it (but fear it will become even more strange). Using unsigned int for <code>msg</code> doesn't really help here.</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/merge_requests/1151#note_276085450">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/0b95d2a5449891ee5d618fa0be5e6514/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.com/gnutls/gnutls/merge_requests/1151#note_276085450"}}</script>


</p>
</div>
</body>
</html>