mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Remove LOC_DOUBLE macro (mips || next remains)
This commit is contained in:
parent
23c9f9af3c
commit
4e0799f990
@ -28,7 +28,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: canonical.cpp,v 1.15 2003-02-10 13:37:45 eku Exp $
|
||||
$Id: canonical.cpp,v 1.16 2003-03-13 00:49:47 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -677,153 +677,6 @@ static bool_t xdr_quad(XDR* xdrs, SLONG* ip)
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef LOC_DOUBLE
|
||||
static bool_t xdr_double(XDR *xdrs, double *ip)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* x d r _ d o u b l e
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Map from external to internal representation (or vice versa).
|
||||
*
|
||||
**************************************/
|
||||
SSHORT t1;
|
||||
union
|
||||
{
|
||||
double temp_double;
|
||||
SLONG temp_long[2];
|
||||
SSHORT temp_short[4];
|
||||
} temp;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_ENCODE:
|
||||
temp.temp_double = *ip;
|
||||
#ifndef IEEE
|
||||
if (*ip != 0)
|
||||
temp.temp_short[0] -= 0x20;
|
||||
t1 = temp.temp_short[0];
|
||||
temp.temp_short[0] = temp.temp_short[1];
|
||||
temp.temp_short[1] = t1;
|
||||
t1 = temp.temp_short[2];
|
||||
temp.temp_short[2] = temp.temp_short[3];
|
||||
temp.temp_short[3] = t1;
|
||||
#endif
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
if ((*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[1]) &&
|
||||
(*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[0]))
|
||||
return TRUE;
|
||||
#else
|
||||
if ((*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[0]) &&
|
||||
(*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[1]))
|
||||
return TRUE;
|
||||
#endif
|
||||
return FALSE;
|
||||
|
||||
case XDR_DECODE:
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
if (!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[1]) ||
|
||||
!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[0]))
|
||||
return FALSE;
|
||||
#else
|
||||
if (!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[0]) ||
|
||||
!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[1]))
|
||||
return FALSE;
|
||||
#endif
|
||||
#ifndef IEEE
|
||||
t1 = temp.temp_short[0];
|
||||
temp.temp_short[0] = temp.temp_short[1];
|
||||
temp.temp_short[1] = t1;
|
||||
t1 = temp.temp_short[2];
|
||||
temp.temp_short[2] = temp.temp_short[3];
|
||||
temp.temp_short[3] = t1;
|
||||
if (temp.temp_double != 0)
|
||||
temp.temp_short[0] += 0x20;
|
||||
#endif
|
||||
*ip = temp.temp_double;
|
||||
return TRUE;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static bool_t xdr_float(xdrs, ip)
|
||||
XDR *xdrs;
|
||||
float *ip;
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* x d r _ f l o a t
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Map from external to internal representation (or vice versa).
|
||||
*
|
||||
**************************************/
|
||||
SSHORT t1;
|
||||
union
|
||||
{
|
||||
float temp_float;
|
||||
unsigned short temp_short[2];
|
||||
} temp;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_ENCODE:
|
||||
#ifndef IEEE
|
||||
temp.temp_float = *ip;
|
||||
if (temp.temp_float)
|
||||
{
|
||||
t1 = temp.temp_short[0];
|
||||
temp.temp_short[0] = temp.temp_short[1];
|
||||
temp.temp_short[1] = t1 - 0x100;
|
||||
}
|
||||
if (!(*xdrs->x_ops->x_putlong) (xdrs, &temp))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
#else
|
||||
return (*xdrs->x_ops->x_putlong) (xdrs, ip);
|
||||
#endif
|
||||
|
||||
case XDR_DECODE:
|
||||
#ifndef IEEE
|
||||
if (!(*xdrs->x_ops->x_getlong) (xdrs, &temp))
|
||||
return FALSE;
|
||||
if (temp.temp_short[0] | temp.temp_short[1])
|
||||
{
|
||||
t1 = temp.temp_short[1];
|
||||
temp.temp_short[1] = temp.temp_short[0];
|
||||
temp.temp_short[0] = t1 + 0x100;
|
||||
}
|
||||
*ip = temp.temp_float;
|
||||
return TRUE;
|
||||
#else
|
||||
return (*xdrs->x_ops->x_getlong) (xdrs, ip);
|
||||
#endif
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static int xdr_init( XDR * xdrs, LSTRING * buffer, enum xdr_op x_op)
|
||||
{
|
||||
/**************************************
|
||||
|
@ -1874,134 +1874,6 @@ static bool_t xdr_trrq_message( XDR * xdrs, USHORT msg_type)
|
||||
}
|
||||
|
||||
|
||||
#ifdef LOC_DOUBLE
|
||||
static bool_t xdr_double( XDR * xdrs, double *ip)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* x d r _ d o u b l e
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Map from external to internal representation (or vice versa).
|
||||
*
|
||||
**************************************/
|
||||
SSHORT t1;
|
||||
union {
|
||||
double temp_double;
|
||||
SLONG temp_long[2];
|
||||
SSHORT temp_short[4];
|
||||
} temp;
|
||||
|
||||
switch (xdrs->x_op) {
|
||||
case XDR_ENCODE:
|
||||
temp.temp_double = *ip;
|
||||
#ifndef IEEE
|
||||
if (temp.temp_double != 0)
|
||||
temp.temp_short[0] -= 0x20;
|
||||
t1 = temp.temp_short[0];
|
||||
temp.temp_short[0] = temp.temp_short[1];
|
||||
temp.temp_short[1] = t1;
|
||||
t1 = temp.temp_short[2];
|
||||
temp.temp_short[2] = temp.temp_short[3];
|
||||
temp.temp_short[3] = t1;
|
||||
#endif
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
if ((*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[1]) &&
|
||||
(*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[0]))
|
||||
return TRUE;
|
||||
#else
|
||||
if ((*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[0]) &&
|
||||
(*xdrs->x_ops->x_putlong) (xdrs, &temp.temp_long[1]))
|
||||
return TRUE;
|
||||
#endif
|
||||
return FALSE;
|
||||
|
||||
case XDR_DECODE:
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
if (!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[1]) ||
|
||||
!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[0]))
|
||||
return FALSE;
|
||||
#else
|
||||
if (!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[0]) ||
|
||||
!(*xdrs->x_ops->x_getlong) (xdrs, &temp.temp_long[1]))
|
||||
return FALSE;
|
||||
#endif
|
||||
#ifndef IEEE
|
||||
t1 = temp.temp_short[0];
|
||||
temp.temp_short[0] = temp.temp_short[1];
|
||||
temp.temp_short[1] = t1;
|
||||
t1 = temp.temp_short[2];
|
||||
temp.temp_short[2] = temp.temp_short[3];
|
||||
temp.temp_short[3] = t1;
|
||||
if (temp.temp_double != 0)
|
||||
temp.temp_short[0] += 0x20;
|
||||
#endif
|
||||
*ip = temp.temp_double;
|
||||
return TRUE;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static bool_t xdr_float( XDR * xdrs, float *ip)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* x d r _ f l o a t
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Map from external to internal representation (or vice versa).
|
||||
*
|
||||
**************************************/
|
||||
SSHORT t1;
|
||||
union {
|
||||
float temp_float;
|
||||
unsigned short temp_short[2];
|
||||
} temp;
|
||||
|
||||
switch (xdrs->x_op) {
|
||||
case XDR_ENCODE:
|
||||
#ifndef IEEE
|
||||
temp.temp_float = *ip;
|
||||
if (temp.temp_float) {
|
||||
t1 = temp.temp_short[0];
|
||||
temp.temp_short[0] = temp.temp_short[1];
|
||||
temp.temp_short[1] = t1 - 0x100;
|
||||
}
|
||||
if (!(*xdrs->x_ops->x_putlong) (xdrs, &temp))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
#else
|
||||
return (*xdrs->x_ops->x_putlong) (xdrs, ip);
|
||||
#endif
|
||||
|
||||
case XDR_DECODE:
|
||||
#ifndef IEEE
|
||||
if (!(*xdrs->x_ops->x_getlong) (xdrs, &temp))
|
||||
return FALSE;
|
||||
if (temp.temp_short[0] | temp.temp_short[1]) {
|
||||
t1 = temp.temp_short[1];
|
||||
temp.temp_short[1] = temp.temp_short[0];
|
||||
temp.temp_short[0] = t1 + 0x100;
|
||||
}
|
||||
*ip = temp.temp_float;
|
||||
return TRUE;
|
||||
#else
|
||||
return (*xdrs->x_ops->x_getlong) (xdrs, ip);
|
||||
#endif
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static RSR get_statement( XDR * xdrs, SSHORT statement_id)
|
||||
{
|
||||
/**************************************
|
||||
|
Loading…
Reference in New Issue
Block a user