Skip to Content.
Sympa Menu

freetds - Re: killer query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: killer query
  • Date: Wed, 26 Jun 2002 13:04:28 -0400


> From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
> Sent: June 26, 2002 8:39 AM

Frediano,

Bill's code is easy understand, but I have to say I like your version
better, because it doesn't manhandle the byte ordering. Instead of #if, you
let the compiler do more of the work.

We don't even have to copy src to a TDS_UNIQUE structure. That's what my
friend the pointer is for:

> TDS_UNIQUE uniq;
> memcpy(uniq,src,sizeof(uniq));
> sprintf(any.c,"%08X-04X-04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
> uniq.Data1,uniq.Data2,uniq.Data3,
> uniq.Data4[0],uniq.Data4[1],
>
> uniq.Data5[0],uniq.Data5[1],uniq.Data5[2],uniq.Data5[3],uniq.D
> ata5[4],uniq.D
> ata5[5]);

could be:

TDS_UNIQUE *u = src;
sprintf(any.c,"%08X-04X-04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
u->Data1, u->Data2, u->Data3,
u->Data4[0], u->Data4[1],
u->Data5[0], u->Data5[1], u->Data5[2], u->Data5[3],
u->Data5[4], u->Data5[5]);

If you don't mind, it would help if you could post a patch for this.

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page