Skip to Content.
Sympa Menu

freetds - Re: testing latest snapshot...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Sam Denton <denton AT wantec.com>
  • To: 'TDS Development Group' <freetds AT franklin.oit.unc.edu>
  • Subject: Re: testing latest snapshot...
  • Date: Tue, 28 May 2002 10:52:48 -0500


This is more of a coding style criticism, but instead of 4294967295U,
wouldn't it make more sense to just use 0xffffffff? When I see something
like the former, my first thought *isn't* "Oh, that's the largest unsigned
number expressible in 32 bits!", it's more like "Uh, is that the number of
days between the Unix epoch and some other event?"

Sam Denton, WAN Technologies, INC.
(314) 428-0888 / (800) 926-7771 Main Office


-----Original Message-----
From: Bill Thompson [mailto:thompbil AT exchange.uk.ml.com]
Sent: Monday, May 27, 2002 9:35 AM
To: TDS Development Group
Subject: [freetds] Re: testing latest snapshot...


Replying to myself...something wrong surely....
P'raps someone can patch these fixes in :

convert.c

line 590 should read:

dt_days = (unsigned int)4294967295U - dt_days;

and line 1212 should read:

dt_days = 4294967295U; /* 0xffffffff */

dblib.c

We need this declaration at the top of dblib.c :

static int days_this_year (int years);

and the line in dbdatecrack should read :

dt_days = (unsigned int)4294967295U - dt_days;

Also, I made some changes to function buffer_transfer_bound_data, which
are required to be compatible with changes I made to convert.c .
It's possible Brian left these out for good reason. However my copy now
looks like this:

declare variable destlen at the top:

int destlen;

...and the section of code near the bottom should now look like this:

if (tds_get_null(resinfo->current_row,i)) {
_set_null_value(dbproc, curcol->varaddr, desttype,
curcol->column_bindlen);
} else {

if (curcol->column_bindtype == STRINGBIND)
destlen = -2;
else if (curcol->column_bindtype == NTBSTRINGBIND)
destlen = -1;
else
destlen = curcol->column_bindlen;

dbconvert(dbproc,
srctype, /* srctype */
src, /* src */
srclen, /* srclen */
desttype, /* desttype */
(BYTE *)curcol->varaddr, /* dest */
destlen); /* destlen */
} /* else not null */

cheers!

Bill

---
You are currently subscribed to freetds as: [denton AT wantec.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')




Archive powered by MHonArc 2.6.24.

Top of Page