Skip to Content.
Sympa Menu

freetds - typedef struct tdsmoney

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: typedef struct tdsmoney
  • Date: Thu, 8 Aug 2002 00:42:04 -0400


Hello,

Attached is a cvs diff showing a change to tds.h.in last week that broke
money (you might say). I wonder if I'll ever be able to talk about the
money datatype without being tempted by punnery?

I did something a little overfancy. tdsmoney is now a union of the old
and new definitions (they want the same 64 bits anyway.) This let me put
conditional compilation in tds/convert.c, re-introducing the call to
tds_money_to_string().

The good news: money->char works for me.
The bad news: the warning about atoll regarding money is now bogus.

:)

--jkl

$ cvs diff -u -r 1.23 -r 1.24 tds.h.in
jklowden AT cvs.freetds.sourceforge.net's password:
Index: tds.h.in
===================================================================
RCS file: /cvsroot/freetds/freetds/include/tds.h.in,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- tds.h.in 2 Aug 2002 03:13:00 -0000 1.23
+++ tds.h.in 2 Aug 2002 03:20:29 -0000 1.24
@@ -21,7 +21,7 @@
#define _tds_h_

static char rcsid_tds_h[]=
- "$Id: tds.h.in,v 1.23 2002/08/02 03:13:00 brianb Exp $";
+ "$Id: tds.h.in,v 1.24 2002/08/02 03:20:29 brianb Exp $";
static void *no_unused_tds_h_warn[]={rcsid_tds_h, no_unused_tds_h_warn};

#include "tds_configs.h"
@@ -92,6 +92,7 @@
typedef unsigned @int@ TDS_UINT; /* 32 bit unsigned */
typedef @real@ TDS_REAL; /* 32 bit float */
typedef @float@ TDS_FLOAT; /* 64 bit float */
+typedef long long TDS_INT8; /* 64 bit float */
typedef struct tdsnumeric
{
unsigned char precision;
@@ -100,8 +101,7 @@
} TDS_NUMERIC;
typedef struct tdsmoney
{
- TDS_INT mnyhigh;
- TDS_INT mnylow;
+ TDS_INT8 mny;
} TDS_MONEY;
typedef struct tdsmoney4
{



  • typedef struct tdsmoney, James K. Lowden, 08/08/2002

Archive powered by MHonArc 2.6.24.

Top of Page