NCBI C++ ToolKit
Classes | Functions | Variables
convert_bounds.c File Reference
#include "common.h"
#include <freetds/convert.h>
#include <freetds/utils/smp.h>
#include <freetds/test_assert.h>
+ Include dependency graph for convert_bounds.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  type_desc
 

Functions

static TDS_INT convert_and_free (int srctype, const void *src, TDS_UINT srclen, int desttype, CONV_RESULT *cr)
 
static bool is_valid (const char *num, int type, CONV_RESULT *cr)
 
static double convert_to_float (smp n, int type)
 
static int64_t get_float_precision_factor (smp n, int type)
 
static void real_test (smp n, int type, bool is_integer)
 
static void double_to_string (char *out, double d)
 
int main (int argc, char **argv)
 

Variables

static TDSCONTEXTctx
 
static const type_desc number_types []
 
static const char * bounds []
 

Function Documentation

◆ convert_and_free()

static TDS_INT convert_and_free ( int  srctype,
const void *  src,
TDS_UINT  srclen,
int  desttype,
CONV_RESULT cr 
)
static

◆ convert_to_float()

static double convert_to_float ( smp  n,
int  type 
)
static

Definition at line 225 of file convert_bounds.c.

References assert, n, smp_to_double, SYBFLT8, and SYBREAL.

Referenced by get_float_precision_factor(), and real_test().

◆ double_to_string()

static void double_to_string ( char *  out,
double  d 
)
static

Definition at line 268 of file convert_bounds.c.

References free(), n, negative(), out(), smp_add, smp_negate, smp_one, smp_to_string, and smp_zero.

Referenced by real_test().

◆ get_float_precision_factor()

static int64_t get_float_precision_factor ( smp  n,
int  type 
)
static

Definition at line 248 of file convert_bounds.c.

References convert_to_float(), n, orig, smp_add, smp_from_int, and smp_sub.

Referenced by real_test().

◆ is_valid()

static bool is_valid ( const char *  num,
int  type,
CONV_RESULT cr 
)
static

◆ main()

int main ( int  argc,
char **  argv 
)

◆ real_test()

static void real_test ( smp  n,
int  type,
bool  is_integer 
)
static

Variable Documentation

◆ bounds

const char* bounds[]
static
Initial value:
= {
"0",
"128",
"256",
"0x8000",
"0x1'0000",
"214748",
"922337203685477",
"0x8000'0000",
"0x1'0000'0000",
"0x8000'0000'0000'0000",
"0x1'0000'0000'0000'0000",
}
#define NULL
Definition: ncbistd.hpp:225

Definition at line 62 of file convert_bounds.c.

Referenced by CCompartmentAccessor< THit >::AsSeqAlignSet(), CHitGlyph::CHitGlyph(), CDockPanel::DropTest(), CReadBlastApp::getBounds(), CMinPanelContainer::Layout(), main(), CProSplignText::Output(), CSearch_Base< LEGACY, NHITS, derived_t >::ProcessBoundaryOffset(), CReadBlastApp::StoreBlast(), CSeq_align_Mapper_Base::x_GetDstSpliced(), and CGvfReader::xFeatureSetLocationPoint().

◆ ctx

TDSCONTEXT* ctx
static

Definition at line 36 of file convert_bounds.c.

Referenced by convert_and_free(), and main().

◆ number_types

const type_desc number_types[]
static
Initial value:
= {
{ SYBINT1, true },
{ SYBUINT1, true },
{ SYBINT2, true },
{ SYBUINT2, true },
{ SYBINT4, true },
{ SYBUINT4, true },
{ SYBINT8, true },
{ SYBUINT8, true },
{ SYBMONEY4, true },
{ SYBMONEY, true },
{ SYBREAL, false },
{ SYBFLT8, false },
{ SYBNUMERIC, true },
{ 0, false },
}
@ SYBUINT8
Definition: proto.h:215
@ SYBUINT2
Definition: proto.h:213
@ SYBUINT4
Definition: proto.h:214
@ SYBUINT1
Definition: proto.h:212
#define SYBINT4
Definition: sybdb.h:170
#define SYBNUMERIC
Definition: sybdb.h:202
#define SYBINT8
Definition: sybdb.h:172
#define SYBINT1
Definition: sybdb.h:166
#define SYBREAL
Definition: sybdb.h:194
#define SYBMONEY
Definition: sybdb.h:190
#define SYBMONEY4
Definition: sybdb.h:188
#define SYBFLT8
Definition: sybdb.h:174
#define SYBINT2
Definition: sybdb.h:168

Definition at line 44 of file convert_bounds.c.

Referenced by main(), and real_test().

Modified on Fri Sep 20 14:57:43 2024 by modify_doxy.py rev. 669887