Commit fa4aa616 authored by Olivier Bertrand's avatar Olivier Bertrand

- Rewriting the VALUE classes as template classes

modified:
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabxml.cpp
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xobject.h
parent f2b8155a
......@@ -991,7 +991,7 @@ bool DOSCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision());
value->SetPrec(GetPrecision());
Value = value; // Directly access the external value
} else {
......@@ -1032,6 +1032,7 @@ void DOSCOL::ReadColumn(PGLOBAL g)
char *p;
int i, rc;
int field;
double dval;
PTDBDOS tdbp = (PTDBDOS)To_Tdb;
if (trace > 1)
......@@ -1066,14 +1067,17 @@ void DOSCOL::ReadColumn(PGLOBAL g)
if (Nod) switch (Buf_Type) {
case TYPE_INT:
case TYPE_SHORT:
case TYPE_BIGINT:
Value->SetValue_char(p, field - Dcm);
break;
case TYPE_FLOAT:
Value->SetValue_char(p, field);
dval = Value->GetFloatValue();
for (i = 0; i < Dcm; i++)
((DFVAL*)Value)->Divide(10.0);
dval /= 10.0;
Value->SetValue(dval);
break;
default:
Value->SetValue_char(p, field);
......
......@@ -13,7 +13,7 @@
#include "colblk.h" // Column base class declares
#include "xindex.h"
typedef struct _tabdesc *PTABD; // For friend setting
//pedef struct _tabdesc *PTABD; // For friend setting
typedef class TXTFAM *PTXF;
/***********************************************************************/
......
......@@ -960,7 +960,7 @@ bool MYSQLCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision());
value->SetPrec(GetPrecision());
Value = value; // Directly access the external value
} else {
......
......@@ -757,7 +757,7 @@ bool ODBCCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision());
value->SetPrec(GetPrecision());
Value = value; // Directly access the external value
} else {
......
......@@ -455,7 +455,7 @@ bool INICOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision());
value->SetPrec(GetPrecision());
Value = value; // Directly access the external value
} else {
......
......@@ -1148,7 +1148,7 @@ bool XMLCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check)
} else if (Buf_Type == TYPE_FLOAT)
// Float values must be written with the correct (column) precision
// Note: maybe this should be forced by ShowValue instead of this ?
((DFVAL *)value)->SetPrec(GetPrecision());
value->SetPrec(GetPrecision());
Value = value; // Directly access the external value
} else {
......
This diff is collapsed.
This diff is collapsed.
......@@ -19,7 +19,7 @@
/***********************************************************************/
/* Types used in some class definitions. */
/***********************************************************************/
typedef struct _tabdesc *PTABD; // For friend setting
//typedef struct _tabdesc *PTABD; // For friend setting
/***********************************************************************/
/* The pointer to the one and only needed void object. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment