Skip to Content.
Sympa Menu

freetds - Re: Getting FreeTDS up under Solaris

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Tom May <tom AT go2net.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Getting FreeTDS up under Solaris
  • Date: 18 Dec 1998 13:32:30 -0800


Kevin <root AT zazu.nol.org> writes:

> Actually, my boss (who thinks pound defines to be the root of
> all evil) had me rewrite that section without the pound defines, and
> perhaps this is a little cleaner after all...
>
> TDS_SMALLINT tds_get_smallint(TDSSOCKET *tds) {
> char buff[2];
> u_short ms_kludge;
>
> buff[0] = tds_get_byte(tds);
> buff[1] = tds_get_byte(tds);
> ms_kludge = *((short*)buff);
> return ((TDS_SMALLINT)ms_kludge);
> }

Assuming that a short is two chars is not a portable way to do things.
If I were sure of exactly what you're trying to do, I would suggest a
better way, but I'm not, so I won't.

Tom.




Archive powered by MHonArc 2.6.24.

Top of Page