[ts-gen] MacOS Shim problems
Richard Pruss
boadie at gmail.com
Fri May 22 01:07:29 EDT 2009
Tried the patches, still seems to lock in leaf.c the modified print line works;
here is the output:
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Pidx: < 30449 30649 CASH CASH, USD USD, n/a n/a, AUD != HKD: 12345795
Sorry,
Ric
On Fri, May 22, 2009 at 9:14 AM, Bill Pippin <pippin at owlriver.net> wrote:
>> Ric,
>
> Here I need to reply to my previous post, as the fix I posted was
> flawed in two ways: the fix is still incorrect for some cases; and
> there are related problems elsewhere in the code.
>
> Below is a comprehensive patch, to be applied to the original code, so
> that you need to start *without* having applied my previous patch for
> leaf.c; if you have, you'll need to either back it out, or start from
> another copy of the sources you've derived from the shim-090428.tgz
> tarball.
>
> The patch follows my sig. If any one is interested in the details of
> the implementation, please feel free to ask on the list, and I'll
> post an explanation of the patch.
>
> In any case, Ric, please consider applying the patch below to your
> code as noted above, or else wait for the next release, and once having
> done one or the other, please let us know whether your installation of
> the shim works.
>
> Thanks,
>
> Bill
>
> -------- cut here ------------------------------------------------------
>
> *** old/leaf.c Thu May 7 19:34:16 2009
> --- src/leaf.c Thu May 21 18:51:01 2009
> ***************
> *** 167,174 ****
> Product_1 t(vecs.product);
> Prod_0 p(0);
> int x(0);
> ! nat a(t.base()),
> ! b(t.next());
>
> // fprintf(stderr, "Desc: %13s %-4s %4s %4s %3s %4s\n", "",
> // d.type .text(),
> --- 167,174 ----
> Product_1 t(vecs.product);
> Prod_0 p(0);
> int x(0);
> ! nat a(t.base() + 1),
> ! b(t.size());
>
> // fprintf(stderr, "Desc: %13s %-4s %4s %4s %3s %4s\n", "",
> // d.type .text(),
> ***************
> *** 177,189 ****
> // d.unit .text(),
> // d.region.text());
>
> ! for(nat i(mid(a, b)); a<b && !p; i = mid(a, b)) {
> ! switch((x = d.compare(t[i]))) {
> ! case -1: b = i ; break;
> case 1: a = i + 1; break;
> ! case 0: p = &t[i];
> }
> ! // d.print_line(t[i], a, b, x);
> }
> // fprintf(stderr, "Desc? %u\n", bool(p));
>
> --- 177,189 ----
> // d.unit .text(),
> // d.region.text());
>
> ! for(nat i(mid(a, b)); a<=i && i<=b && !p; i = mid(a, b)) {
> ! switch((x = d.compare(t[i - 1]))) {
> ! case -1: b = i - 1; break;
> case 1: a = i + 1; break;
> ! case 0: p = &t[i - 1];
> }
> ! // d.print_line(t[i - 1], a, b, x);
> }
> // fprintf(stderr, "Desc? %u\n", bool(p));
>
> *** old/table.h Wed Mar 11 10:42:42 2009
> --- lib/table.h Thu May 21 18:03:45 2009
> ***************
> *** 167,179 ****
> T_0 operator[](char_0 k) const { return self[ids[k].id()]; }
> T_0 operator[](nat key) const
> {
> ! nat a(h.base()),
> b(h.past()), i(Sentinel);
>
> ! for(nat m(mid(a, b)); a<b && sentinel(i); m = mid(a, b)) {
> ! if (key < *data[m]()) b = m ; else
> ! if (key > *data[m]()) a = m + 1; else i = m;
> ! }
>
> return sentinel(i) ? 0 : &data[i]();
> }
> --- 167,179 ----
> T_0 operator[](char_0 k) const { return self[ids[k].id()]; }
> T_0 operator[](nat key) const
> {
> ! nat a(h.base() + 1),
> b(h.past()), i(Sentinel);
>
> ! for(nat m(mid(a, b)); a<=m && m<=b && sentinel(i); m=mid(a, b))
> ! if (key < *data[m - 1]()) b = m - 1; else
> ! if (key > *data[m - 1]()) a = m + 1; else
> ! i = m - 1;
>
> return sentinel(i) ? 0 : &data[i]();
> }
> *** old/search.h Wed Mar 11 10:42:42 2009
> --- lib/search.h Thu May 21 19:09:49 2009
> ***************
> *** 42,62 ****
> size(n),
> key(**k) {}
>
> ! R_0 operator*() const
> ! {
> ! R_0 p(0);
> ! nat a(0), b(size);
> !
> ! for(nat i(mid_point(a, b)); a<b && !p; i = mid_point(a, b))
> ! if (key.id() < (***data[i]).id()) b = i ; else
> ! if (key.id() > (***data[i]).id()) a = i + 1; else p = data[i];
> !
> ! return p;
> ! }
>
> private:
>
> ! nat mid_point(nat a, nat b) const { return (a + b) >> 1; }
>
> R_00 data;
> nat size;
> --- 42,63 ----
> size(n),
> key(**k) {}
>
> ! R_0 operator*() const
> ! {
> ! R_0 p(0);
> ! nat a(1), b(size); /* half open interval, offset by 1 from common case */
> !
> ! if (size)
> ! for(nat i(mid(a, b)); a<=i && i<=b && !p; i = mid(a, b))
> ! if (key.id() < (***data[i-1]).id()) b = i - 1; else
> ! if (key.id() > (***data[i-1]).id()) a = i + 1; else
> ! p = data[i-1];
> ! return p;
> ! }
>
> private:
>
> ! nat mid(nat a, nat b) const { return (a + b) >> 1; }
>
> R_00 data;
> nat size;
>
More information about the ts-general
mailing list