<div dir="ltr">On Mon, Jul 8, 2013 at 2:30 PM, Alexander Monakov <span dir="ltr"><<a href="mailto:amonakov@ispras.ru" target="_blank">amonakov@ispras.ru</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br>
On Mon, 8 Jul 2013, Alexander Monakov wrote:<br>
<br>
> Looks awesome.  Quick question -- is handling Xlib-style attrib-lists where<br>
> some keys stand alone without a corresponding value possible/easy?  This<br>
> should not block the patch, I'm just asking the question while the code is<br>
> hot (and I'm interested to have this functionality work for glXChooseVisual).<br>
<br>
</div>Ah, sorry, I spoke too soon.  My concern is addressed by the pull request<br>
itself, to quote:<br>
<br>
> Note that the current code assumes no value for unknown keys when<br>
> determining attrib_list length, but int value when iterating over<br>
> attrib_list later. This has the effect that a null value after an unknown<br>
> key terminates the attrib_list as currently interpreted.<br>
<br>
You seem to explain a bug in your implementation? :)<br>
<br>
For GLX-style attrib-lists, you have a guarantee that a key is followed by a<br>
(possibly zero-bit-pattern) value.  Thus the attrib list is terminated by a<br>
zero-bit-pattern Int at an even position (thus, a key).  All values are at odd<br>
positions.<br>
<br>
For Xlib-style attrib-lists, you don't have that guarantee: keys for Boolean<br>
arguments do not have a value (it is implicitely 'True').<br>
<br>
Initially I thought your patch does not handle Xlib-style lists at all, but<br>
now it seems the ground work is in place?<br>
<div class=""><div class="h5"><br>
Alexander</div></div></blockquote><div><br></div><div style>I like the direction of the patch. I'd recommend adding a bool option to AttribArray's constructor, so that when true, it would not assume a list of pairs, but that bool attributes have implicit true value.</div>
<div style><br></div><div style>Jose </div></div><br></div></div>