[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] kernel32: Implement CompareStringOrdinal. (try 2)
From:       Christian Costa <titan.costa () gmail ! com>
Date:       2012-10-30 10:06:36
Message-ID: CAMo6X8Z-hHrR=jhOu8sT6BOh=Y5n0fqQGt+TeEFDKi0xOr=gMA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2012/10/30 Hans Leidekker <hans@codeweavers.com>

> On Tue, 2012-10-30 at 09:50 +0100, Christian Costa wrote:
> > Just by curiosity. What the difference with strncmpW?
>
> strncmp tests the first string for null termination. You should really
> determine that by yourself though :-)
>
> > >> Do you have a concrete example that does not work with this
> implementation
> > > How about CompareStringOrdinal( "a\0a", 3, "a\0b", 3 )?
> > >
> > >
> > There is a similar test in the patch:
> >
> >      WCHAR test1[] = { 't','e','s','t',0 };
> >      WCHAR test3[] = { 't','e','s','t','3',0 };
> >
> >      ret = pCompareStringOrdinal(test1, 5, test3, 5, TRUE);
> >      ok(ret == CSTR_LESS_THAN, "Got %u, expected %u\n", ret,
> CSTR_LESS_THAN);
>
> It's not the same test. The nulls are not at the same index and you're not
> asking CompareStringOrdinal to read past a null.
>
>
> I just wanted to compare 0 with 3 but you're right, I'll add such a test.

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">2012/10/30 Hans Leidekker <span dir="ltr">&lt;<a \
href="mailto:hans@codeweavers.com" \
target="_blank">hans@codeweavers.com</a>&gt;</span><br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <div class="im">On Tue, 2012-10-30 at 09:50 +0100, Christian \
Costa wrote:<br> &gt; Just by curiosity. What the difference with strncmpW?<br>
<br>
</div>strncmp tests the first string for null termination. You should really<br>
determine that by yourself though :-)<br>
<div class="im"><br>
&gt; &gt;&gt; Do you have a concrete example that does not work with this \
implementation<br> &gt; &gt; How about CompareStringOrdinal( &quot;a\0a&quot;, 3, \
&quot;a\0b&quot;, 3 )?<br> &gt; &gt;<br>
&gt; &gt;<br>
&gt; There is a similar test in the patch:<br>
&gt;<br>
&gt;      WCHAR test1[] = { &#39;t&#39;,&#39;e&#39;,&#39;s&#39;,&#39;t&#39;,0 };<br>
&gt;      WCHAR test3[] = { \
&#39;t&#39;,&#39;e&#39;,&#39;s&#39;,&#39;t&#39;,&#39;3&#39;,0 };<br> &gt;<br>
&gt;      ret = pCompareStringOrdinal(test1, 5, test3, 5, TRUE);<br>
&gt;      ok(ret == CSTR_LESS_THAN, &quot;Got %u, expected %u\n&quot;, ret, \
CSTR_LESS_THAN);<br> <br>
</div>It&#39;s not the same test. The nulls are not at the same index and you&#39;re \
not<br> asking CompareStringOrdinal to read past a null.<br>
<br>
<br>
</blockquote></div>I just wanted to compare 0 with 3 but you&#39;re right, I&#39;ll \
add such a test.





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic