Skip to Content.
Sympa Menu

freetds - [freetds] _DB_GETCOLINFO whacked

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] _DB_GETCOLINFO whacked
  • Date: Sun, 2 Dec 2007 13:23:21 -0500

I removed the _DB_GETCOLINFO macro, replacing it with a function
dbcolptr(). The macro had gotten too complicated and wasn't all that well
conceived to begin with.

In general I think it's a bad idea for macros to have side effects. This
one required two variables to be declared, so it could assign them, and
contained return statements in case its checks turned up an error. I
didn't think "get column info" suggested "exit if you can't".

The new function calls dbperror() for you and returns the error code, so
the caller can decide what to do next. It takes the address of a
TDSCOLUMN pointer, which is sets. I think it makes what's going on a
little clearer.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page