8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

HPUX Port

This commit is contained in:
paulbeach 2007-11-12 14:26:44 +00:00
parent db8e304139
commit 7602a29b94
34 changed files with 150 additions and 141 deletions

View File

@ -161,11 +161,11 @@ case "$target" in
*-*-hpux*)
MAKEFILE_PREFIX=hpux
PLATFORM=hpux
PLATFORM=HPUX
AC_DEFINE(hpux, 1, [Define this if OS is HP-UX])
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=N
SHRLIB_EXT=so
EDITLINE_FLG=Y
SHRLIB_EXT=sl
;;
i386-pc-solaris*)
@ -483,6 +483,8 @@ AC_CHECK_HEADERS(mntent.h mnttab.h sys/mntent.h sys/mnttab.h)
AC_CHECK_HEADERS(sys/ipc.h sys/file.h)
AC_CHECK_HEADERS(socket.h sys/socket.h sys/sockio.h winsock2.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/sem.h)
AC_CHECK_HEADERS(semaphore.h)
dnl Check for libraries
@ -577,7 +579,12 @@ AC_CHECK_FUNCS(pthread_keycreate pthread_key_create)
AC_CHECK_FUNCS(llrint)
AC_CHECK_FUNCS(localtime_r)
AC_CHECK_FUNCS(gmtime_r)
if test "$ac_cv_header_semaphore.h" = "yes"; then
savedFlags="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AC_CHECK_FUNCS(sem_timedwait)
CFLAGS="$savedFlags"
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
@ -670,7 +677,9 @@ case "$PLATFORM" in
dnl thread support compiled into FIREBIRD.
AC_DEFINE(HAVE_POSIX_THREADS)
;;
HPUX)
AC_DEFINE(HAVE_POSIX_THREADS)
;;
FREEBSD|GENTOOFREEBSD)
dnl the AC_CHECK_TYPES for socklen_t doesn't include sys/socket.h
dnl so test for socklen_t with sys/socket.h included

View File

@ -504,7 +504,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
put(tdgbl, (UCHAR) (rec_end));
UINT64 cumul_count = MVOL_fini_write(&tdgbl->io_cnt, &tdgbl->io_ptr);
FB_UINT64 cumul_count = MVOL_fini_write(&tdgbl->io_cnt, &tdgbl->io_ptr);
BURP_verbose(176, SafeArg() << cumul_count);
// msg 176 closing file, committing, and finishing. %ld bytes written
@ -2191,8 +2191,8 @@ void put_int64( SCHAR attribute, SINT64 value)
**************************************/
BurpGlobals* tdgbl = BurpGlobals::getSpecific();
const UINT64 le_value =
(UINT64) isc_portable_integer((const UCHAR*) &value, sizeof(value));
const FB_UINT64 le_value =
(FB_UINT64) isc_portable_integer((const UCHAR*) &value, sizeof(value));
put(tdgbl, (UCHAR) (attribute));
put(tdgbl, (UCHAR) (sizeof(value)));

View File

@ -858,7 +858,7 @@ public:
int RESTORE_ods;
ULONG mvol_io_buffer_size;
ULONG mvol_actual_buffer_size;
UINT64 mvol_cumul_count;
FB_UINT64 mvol_cumul_count;
UCHAR* mvol_io_ptr;
int mvol_io_cnt;
UCHAR* mvol_io_buffer;

View File

@ -116,7 +116,7 @@ static DESC next_volume(DESC, ULONG, bool);
//____________________________________________________________
//
//
UINT64 MVOL_fini_read()
FB_UINT64 MVOL_fini_read()
{
BurpGlobals* tdgbl = BurpGlobals::getSpecific();
@ -144,7 +144,7 @@ UINT64 MVOL_fini_read()
//____________________________________________________________
//
//
UINT64 MVOL_fini_write(int* io_cnt, UCHAR** io_ptr)
FB_UINT64 MVOL_fini_write(int* io_cnt, UCHAR** io_ptr)
{
BurpGlobals* tdgbl = BurpGlobals::getSpecific();

View File

@ -27,8 +27,8 @@
#include "../burp/burp.h"
UINT64 MVOL_fini_read();
UINT64 MVOL_fini_write(int*, UCHAR**);
FB_UINT64 MVOL_fini_read();
FB_UINT64 MVOL_fini_write(int*, UCHAR**);
void MVOL_init(ULONG);
void MVOL_init_read(const char*, const char*, USHORT*, int*, UCHAR**);
void MVOL_init_write(const char*, const char*, int*, UCHAR**);

View File

@ -577,7 +577,7 @@ int RESTORE_restore (const TEXT* file_name,
BURP_verbose (88);
// msg 88 finishing, closing, and going home
UINT64 cumul_count = MVOL_fini_read();
FB_UINT64 cumul_count = MVOL_fini_read();
// Close database before we attach to it again.
FINISH

View File

@ -24,7 +24,7 @@
#define CLASSES_FILE_H
#ifndef SOLARIS
typedef UINT64 offset_t;
typedef FB_UINT64 offset_t;
#endif
namespace Firebird {

View File

@ -177,7 +177,7 @@ SafeArg& SafeArg::operator<<(SINT64 c)
return *this;
}
SafeArg& SafeArg::operator<<(UINT64 c)
SafeArg& SafeArg::operator<<(FB_UINT64 c)
{
if (m_count < SAFEARG_MAX_ARG)
{

View File

@ -178,7 +178,7 @@ public:
SafeArg& operator<<(long int c);
SafeArg& operator<<(unsigned long int c);
SafeArg& operator<<(SINT64 c);
SafeArg& operator<<(UINT64 c);
SafeArg& operator<<(FB_UINT64 c);
//SafeArg& operator<<(long c);
SafeArg& operator<<(SINT128 c);
SafeArg& operator<<(double c);

View File

@ -43,7 +43,7 @@ struct BitmapTypes_32 {
};
struct BitmapTypes_64 {
typedef UINT64 BUNCH_T;
typedef FB_UINT64 BUNCH_T;
enum {
LOG2_BUNCH_BITS = 8,
BUNCH_BITS = 64

View File

@ -180,7 +180,7 @@ dsql_nod* MAKE_constant(dsql_str* constant, dsql_constant_type numeric_flag)
only if preceded by a '-', but that issue is handled in GEN_expr,
and need not be addressed here. */
UINT64 value = 0;
FB_UINT64 value = 0;
const char* p = constant->str_data;
while (isdigit(*p))
@ -192,7 +192,7 @@ dsql_nod* MAKE_constant(dsql_str* constant, dsql_constant_type numeric_flag)
}
}
*(UINT64 *) (node->nod_desc.dsc_address) = value;
*(FB_UINT64 *) (node->nod_desc.dsc_address) = value;
break;
}

View File

@ -5520,8 +5520,8 @@ int LexerState::yylex (
bool have_exp = false; /* digit ... [eE] */
bool have_exp_sign = false; /* digit ... [eE] {+-] */
bool have_exp_digit = false; /* digit ... [eE] ... digit */
UINT64 number = 0;
UINT64 limit_by_10 = MAX_SINT64 / 10;
FB_UINT64 number = 0;
FB_UINT64 limit_by_10 = MAX_SINT64 / 10;
for (--ptr ; ptr < end ; ptr++)
{

View File

@ -914,7 +914,7 @@ void CME_get_dtype(const gpre_nod* node, gpre_fld* f)
}
/** Get rid of the decimal point **/
UINT64 uint64_val = 0;
FB_UINT64 uint64_val = 0;
while (*s_ptr)
{
if (*s_ptr != '.')
@ -1520,7 +1520,7 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
scale = -scale;
}
UINT64 uint64_val = 0;
FB_UINT64 uint64_val = 0;
while (*s_ptr)
{
if (*s_ptr != '.')
@ -1530,7 +1530,7 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
/** see if we can fit the value in a long or INT64. **/
if ((uint64_val <= MAX_SLONG) ||
((uint64_val == (MAX_SLONG + (UINT64) 1))
((uint64_val == (MAX_SLONG + (FB_UINT64) 1))
&& (negate == true)))
{
long long_val;
@ -1544,7 +1544,7 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
request->add_word(long_val >> 16);
}
else if ((uint64_val <= MAX_SINT64) ||
((uint64_val == ((UINT64) MAX_SINT64 + 1))
((uint64_val == ((FB_UINT64) MAX_SINT64 + 1))
&& (negate == true)))
{
SINT64 sint64_val;

View File

@ -86,7 +86,7 @@ public:
}
inline SINT64 bid_decode() const {
return bid_number + (((UINT64) bid_number_up) << 32);
return bid_number + (((FB_UINT64) bid_number_up) << 32);
}
};

View File

@ -470,7 +470,7 @@ void BLB_garbage_collect(
// Get rid of blob
if (bmGoing.getFirst()) {
do {
const UINT64 id = bmGoing.current();
const FB_UINT64 id = bmGoing.current();
bid blob;
blob.set_permanent(relation->rel_id, RecordNumber(id));

View File

@ -602,21 +602,21 @@ UCHAR* readNode(IndexNode* indexNode, UCHAR* pagePointer, UCHAR flags, bool leaf
number |= (tmp & 0x7F) << 19;
if (tmp >= 128) {
tmp = *localPointer++;
number |= (UINT64) (tmp & 0x7F) << 26;
number |= (FB_UINT64) (tmp & 0x7F) << 26;
if (tmp >= 128) {
tmp = *localPointer++;
number |= (UINT64) (tmp & 0x7F) << 33;
number |= (FB_UINT64) (tmp & 0x7F) << 33;
/*
Uncomment this if you need more bits in record number
if (tmp >= 128) {
tmp = *localPointer++;
number |= (UINT64) (tmp & 0x7F) << 40;
number |= (FB_UINT64) (tmp & 0x7F) << 40;
if (tmp >= 128) {
tmp = *localPointer++;
number |= (UINT64) (tmp & 0x7F) << 47;
number |= (FB_UINT64) (tmp & 0x7F) << 47;
if (tmp >= 128) {
tmp = *localPointer++;
number |= (UINT64) (tmp & 0x7F) << 54; // We get 61 bits at this point!
number |= (FB_UINT64) (tmp & 0x7F) << 54; // We get 61 bits at this point!
}
}
}

View File

@ -127,7 +127,7 @@ static const double pow10_table[] =
#define powerof10(s) ((s) <= 0 ? pow10_table[-(s)] : 1. / pow10_table[-(s)])
static const struct { /* Used in make_int64_key() */
UINT64 limit;
FB_UINT64 limit;
SINT64 factor;
SSHORT scale_change;
} int64_scale_control[] =
@ -6117,7 +6117,7 @@ static INT64_KEY make_int64_key(SINT64 q, SSHORT scale)
// Following structure declared above in the modules global section
//
// static const struct {
// UINT64 limit; --- if abs(q) is >= this, ...
// FB_UINT64 limit; --- if abs(q) is >= this, ...
// SINT64 factor; --- then multiply by this, ...
// SSHORT scale_change; --- and add this to the scale.
// } int64_scale_control[];
@ -6131,7 +6131,7 @@ static INT64_KEY make_int64_key(SINT64 q, SSHORT scale)
// being mapped to the same key.
int n = 0;
UINT64 uq = (UINT64) ((q >= 0) ? q : -q); // absolute value
FB_UINT64 uq = (FB_UINT64) ((q >= 0) ? q : -q); // absolute value
while (uq < int64_scale_control[n].limit) {
n++;
}

View File

@ -430,7 +430,7 @@ static inline int sinixz_sigaction(int sig, const struct sinixz_sigaction *act,
/* The following define is the prefix to go in front of a "d" or "u"
format item in a printf() format string, to indicate that the argument
is an SINT64 or UINT64. */
is an SINT64 or FB_UINT64. */
#define QUADFORMAT "ll"
/* The following macro creates a quad-sized constant, possibly one
which is too large to fit in a long int. */
@ -495,7 +495,7 @@ static inline int sinixz_sigaction(int sig, const struct sinixz_sigaction *act,
/* The following define is the prefix to go in front of a "d" or "u"
format item in a printf() format string, to indicate that the argument
is an SINT64 or UINT64. */
is an SINT64 or FB_UINT64. */
#define QUADFORMAT "ll"
/* The following macro creates a quad-sized constant, possibly one
which is too large to fit in a long int. */
@ -605,12 +605,12 @@ typedef unsigned int64 UATOM;
#define LINEFORMAT "d"
typedef __int64 SINT64;
typedef unsigned __int64 UINT64;
typedef unsigned __int64 FB_UINT64;
#define INT64_DEFINED
/* The following define is the prefix to go in front of a "d" or "u"
format item in a printf() format string, to indicate that the argument
is an SINT64 or UINT64. */
is an SINT64 or FB_UINT64. */
#define QUADFORMAT "I64"
/* The following macro creates a quad-sized constant, possibly one
which is too large to fit in a long int. The Microsoft compiler does
@ -790,7 +790,7 @@ typedef unsigned __int64 UINT64;
#ifndef INT64_DEFINED /* 64 bit */
typedef long long int SINT64;
typedef unsigned long long int UINT64;
typedef unsigned long long int FB_UINT64;
#else
#undef INT64_DEFINED
#endif
@ -867,7 +867,7 @@ struct ISC_TIMESTAMP
#define MAX_SLONG 0x7FFFFFFF
#define MIN_SLONG (-MAX_SLONG - 1)
#define MAX_UINT64 ((UINT64) QUADCONST(0xFFFFFFFFFFFFFFFF))
#define MAX_UINT64 ((FB_UINT64) QUADCONST(0xFFFFFFFFFFFFFFFF))
#define MIN_UINT64 QUADCONST(0x0000000000000000)
#define MAX_SINT64 QUADCONST(0x7FFFFFFFFFFFFFFF)

View File

@ -2257,7 +2257,7 @@ static void integer_to_text(const dsc* from, dsc* to, FPTR_ERROR err)
/* Check for negation, then convert the number to a string of digits */
UINT64 u;
FB_UINT64 u;
if (n >= 0)
u = n;
else {

View File

@ -976,7 +976,7 @@ void dsc::address32bit() const
*
**************************************/
#if SIZEOF_VOID_P > 4
UINT64 addr = (UINT64)(IPTR)dsc_address;
FB_UINT64 addr = (FB_UINT64)(IPTR)dsc_address;
fb_assert(addr == (addr & 0xFFFFFFFF));
#endif
}

View File

@ -140,7 +140,7 @@ struct dsc
//bid asBlobId() const;
//bid asArrayId() const;
SINT64 asSBigInt() const;
UINT64 asUBigInt() const;
FB_UINT64 asUBigInt() const;
};
typedef dsc DSC;
@ -717,7 +717,7 @@ inline SINT64 dsc::asSBigInt() const
}
}
inline UINT64 dsc::asUBigInt() const
inline FB_UINT64 dsc::asUBigInt() const
{
switch (dsc_dtype) {
case dtype_byte:
@ -727,7 +727,7 @@ inline UINT64 dsc::asUBigInt() const
case dtype_long:
return asULong();
case dtype_int64:
return *reinterpret_cast<UINT64*>(dsc_address);
return *reinterpret_cast<FB_UINT64*>(dsc_address);
default:
return 0;
}

View File

@ -4149,7 +4149,7 @@ static dsc* multiply2(const dsc* desc, impure_value* value, const jrd_nod* node)
when one or both arguments are negative. (ldiv() is guaranteed to
round towards 0, but the standard does not yet require an lldiv()
or whatever for 64-bit operands. This makes the problem messy.
We use UINT64s for the checking, thus ensuring that our division rounds
We use FB_UINT64s for the checking, thus ensuring that our division rounds
down. This means that we have to check the sign of the product first
in order to know whether the maximum abs(i1*i2) is MAX_SINT64 or
(MAX_SINT64+1).
@ -4158,10 +4158,10 @@ static dsc* multiply2(const dsc* desc, impure_value* value, const jrd_nod* node)
need a trial-division to be sure the multiply won't overflow.
*/
const UINT64 u1 = (i1 >= 0) ? i1 : -i1; // abs(i1)
const UINT64 u2 = (i2 >= 0) ? i2 : -i2; // abs(i2)
const FB_UINT64 u1 = (i1 >= 0) ? i1 : -i1; // abs(i1)
const FB_UINT64 u2 = (i2 >= 0) ? i2 : -i2; // abs(i2)
// largest product
const UINT64 u_limit = ((i1 ^ i2) >= 0) ? MAX_SINT64 : (UINT64) MAX_SINT64 + 1;
const FB_UINT64 u_limit = ((i1 ^ i2) >= 0) ? MAX_SINT64 : (FB_UINT64) MAX_SINT64 + 1;
if ((u1 != 0) && ((u_limit / u1) < u2)) {
ERR_post(isc_exception_integer_overflow, 0);
@ -5017,7 +5017,7 @@ static dsc* string_length(thread_db* tdbb, jrd_nod* node, impure_value* impure)
{
case blr_strlen_bit:
{
UINT64 l = (UINT64) blob->blb_length * 8;
FB_UINT64 l = (FB_UINT64) blob->blb_length * 8;
if (l > MAX_SINT64)
ERR_post(isc_arith_except, 0);
@ -5068,7 +5068,7 @@ static dsc* string_length(thread_db* tdbb, jrd_nod* node, impure_value* impure)
{
case blr_strlen_bit:
{
UINT64 l = (UINT64) length * 8;
FB_UINT64 l = (FB_UINT64) length * 8;
if (l > MAX_SINT64)
ERR_post(isc_arith_except, 0);

View File

@ -93,7 +93,7 @@ using namespace Jrd;
#endif
static bool augment_stack(jrd_nod*, NodeStack&);
static UINT64 calculate_priority_level(const OptimizerBlk*, const index_desc*);
static FB_UINT64 calculate_priority_level(const OptimizerBlk*, const index_desc*);
static void check_indices(const CompilerScratch::csb_repeat*);
static bool check_relationship(const OptimizerBlk*, USHORT, USHORT);
static void check_sorts(RecordSelExpr*);
@ -174,7 +174,7 @@ static void set_made_river(OptimizerBlk*, const River*);
static void set_position(const jrd_nod*, jrd_nod*, const jrd_nod*);
static void set_rse_inactive(CompilerScratch*, const RecordSelExpr*);
static void sort_indices_by_selectivity(CompilerScratch::csb_repeat*);
static SSHORT sort_indices_by_priority(CompilerScratch::csb_repeat*, index_desc**, UINT64*);
static SSHORT sort_indices_by_priority(CompilerScratch::csb_repeat*, index_desc**, FB_UINT64*);
/* macro definitions */
@ -222,7 +222,7 @@ const double INDEX_COST = 30.0;
const int CACHE_PAGES_PER_STREAM = 15;
const int SELECTIVITY_THRESHOLD_FACTOR = 10;
const int OR_SELECTIVITY_THRESHOLD_FACTOR = 2000;
const UINT64 LOWEST_PRIORITY_LEVEL = 0;
const FB_UINT64 LOWEST_PRIORITY_LEVEL = 0;
/* enumeration of sort datatypes */
@ -1303,7 +1303,7 @@ static bool augment_stack(jrd_nod* node, NodeStack& stack)
}
static UINT64 calculate_priority_level(const OptimizerBlk* opt, const index_desc* idx)
static FB_UINT64 calculate_priority_level(const OptimizerBlk* opt, const index_desc* idx)
{
/**************************************
*
@ -1341,8 +1341,8 @@ static UINT64 calculate_priority_level(const OptimizerBlk* opt, const index_desc
// Note: dbb->dbb_max_idx = 1022 for the largest supported page of 16K and
// 62 for the smallest page of 1K
const UINT64 max_idx = JRD_get_thread_data()->tdbb_database->dbb_max_idx + 1;
UINT64 unique_prefix = 0;
const FB_UINT64 max_idx = JRD_get_thread_data()->tdbb_database->dbb_max_idx + 1;
FB_UINT64 unique_prefix = 0;
if ((idx->idx_flags & idx_unique) && (idx_eql_count == idx->idx_count)) {
unique_prefix = (max_idx - idx->idx_count) * max_idx * max_idx * max_idx;
}
@ -4831,9 +4831,9 @@ static RecordSource* gen_retrieval(thread_db* tdbb,
Firebird::HalfStaticArray<index_desc*, OPT_STATIC_ITEMS> idx_walk_vector(*tdbb->getDefaultPool());
idx_walk_vector.grow(csb_tail->csb_indices);
index_desc** idx_walk = idx_walk_vector.begin();
Firebird::HalfStaticArray<UINT64, OPT_STATIC_ITEMS> idx_priority_level_vector(*tdbb->getDefaultPool());
Firebird::HalfStaticArray<FB_UINT64, OPT_STATIC_ITEMS> idx_priority_level_vector(*tdbb->getDefaultPool());
idx_priority_level_vector.grow(csb_tail->csb_indices);
UINT64* idx_priority_level = idx_priority_level_vector.begin();
FB_UINT64* idx_priority_level = idx_priority_level_vector.begin();
SSHORT i = 0;
for (index_desc* idx = csb_tail->csb_idx->items; i < csb_tail->csb_indices;
@ -6448,10 +6448,10 @@ static jrd_nod* make_inversion(thread_db* tdbb, OptimizerBlk* opt,
idx_walk_vector(*tdbb->getDefaultPool());
idx_walk_vector.grow(csb_tail->csb_indices);
index_desc** idx_walk = idx_walk_vector.begin();
Firebird::HalfStaticArray<UINT64, OPT_STATIC_ITEMS>
Firebird::HalfStaticArray<FB_UINT64, OPT_STATIC_ITEMS>
idx_priority_level_vector(*tdbb->getDefaultPool());
idx_priority_level_vector.grow(csb_tail->csb_indices);
UINT64* idx_priority_level = idx_priority_level_vector.begin();
FB_UINT64* idx_priority_level = idx_priority_level_vector.begin();
index_desc* idx = csb_tail->csb_idx->items;
if (opt->opt_base_conjuncts) {
@ -7720,7 +7720,7 @@ static void sort_indices_by_selectivity(CompilerScratch::csb_repeat* csb_tail)
static SSHORT sort_indices_by_priority(CompilerScratch::csb_repeat* csb_tail,
index_desc** idx_walk,
UINT64* idx_priority_level)
FB_UINT64* idx_priority_level)
{
/***************************************************
*
@ -7742,7 +7742,7 @@ static SSHORT sort_indices_by_priority(CompilerScratch::csb_repeat* csb_tail,
for (SSHORT i = 0; i < csb_tail->csb_indices; i++)
{
SSHORT last_idx = -1;
UINT64 last_priority_level = 0;
FB_UINT64 last_priority_level = 0;
for (SSHORT j = csb_tail->csb_indices - 1; j >= 0; j--)
{

View File

@ -130,7 +130,7 @@ using namespace Jrd;
// please undefine FCNTL_BROKEN for operating systems,
// that can successfully change BOTH O_DIRECT and O_SYNC using fcntl()
static jrd_file* seek_file(jrd_file*, BufferDesc*, UINT64 *, ISC_STATUS *);
static jrd_file* seek_file(jrd_file*, BufferDesc*, FB_UINT64 *, ISC_STATUS *);
static jrd_file* setup_file(Database*, const Firebird::PathName&, int);
static bool unix_error(TEXT*, const jrd_file*, ISC_STATUS, ISC_STATUS*);
#if defined PREAD_PWRITE && !(defined HAVE_PREAD && defined HAVE_PWRITE)
@ -403,7 +403,7 @@ ULONG PIO_get_number_of_pages(const jrd_file* file, const USHORT pagesize)
unix_error("fstat", file, isc_io_access_err, 0);
}
const UINT64 length = statistics.st_size;
const FB_UINT64 length = statistics.st_size;
/****
#ifndef sun
@ -431,7 +431,7 @@ void PIO_header(Database* dbb, SCHAR * address, int length)
*
**************************************/
int i;
UINT64 bytes;
FB_UINT64 bytes;
PageSpace* pageSpace = dbb->dbb_page_manager.findPageSpace(DB_PAGE_SPACE);
jrd_file* file = pageSpace->file;
@ -456,10 +456,10 @@ void PIO_header(Database* dbb, SCHAR * address, int length)
#ifdef PREAD_PWRITE
if ((bytes = pread(file->fil_desc, spare_buffer, length, 0)) ==
(UINT64) -1) {
(FB_UINT64) -1) {
#else
if ((bytes = read(file->fil_desc, spare_buffer, length)) ==
(UINT64) -1) {
(FB_UINT64) -1) {
THD_IO_MUTEX_UNLOCK(file->fil_mutex);
#endif
if (SYSCALL_INTERRUPTED(errno))
@ -473,9 +473,9 @@ void PIO_header(Database* dbb, SCHAR * address, int length)
else
#endif /* ISC_DATABASE_ENCRYPTION */
#ifdef PREAD_PWRITE
if ((bytes = pread(file->fil_desc, address, length, 0)) == (UINT64) -1) {
if ((bytes = pread(file->fil_desc, address, length, 0)) == (FB_UINT64) -1) {
#else
if ((bytes = read(file->fil_desc, address, length)) == (UINT64) -1) {
if ((bytes = read(file->fil_desc, address, length)) == (FB_UINT64) -1) {
THD_IO_MUTEX_UNLOCK(file->fil_mutex);
#endif
if (SYSCALL_INTERRUPTED(errno))
@ -552,7 +552,7 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
bdb.bdb_dbb = dbb;
bdb.bdb_page = PageNumber(0, startPage);
UINT64 bytes, offset;
FB_UINT64 bytes, offset;
ThreadExit teHolder;
SignalInhibit siHolder;
@ -691,7 +691,7 @@ bool PIO_read(jrd_file* file, BufferDesc* bdb, Ods::pag* page, ISC_STATUS* statu
*
**************************************/
int i;
UINT64 bytes, offset;
FB_UINT64 bytes, offset;
if (file->fil_desc == -1) {
return unix_error("read", file, isc_io_read_err, status_vector);
@ -701,7 +701,7 @@ bool PIO_read(jrd_file* file, BufferDesc* bdb, Ods::pag* page, ISC_STATUS* statu
SignalInhibit siHolder;
Database* dbb = bdb->bdb_dbb;
const UINT64 size = dbb->dbb_page_size;
const FB_UINT64 size = dbb->dbb_page_size;
#ifdef ISC_DATABASE_ENCRYPTION
if (dbb->dbb_encrypt_key) {
@ -785,7 +785,7 @@ bool PIO_write(jrd_file* file, BufferDesc* bdb, Ods::pag* page, ISC_STATUS* stat
**************************************/
int i;
SLONG bytes;
UINT64 offset;
FB_UINT64 offset;
if (file->fil_desc == -1)
return unix_error("write", file, isc_io_write_err, status_vector);
@ -846,7 +846,7 @@ bool PIO_write(jrd_file* file, BufferDesc* bdb, Ods::pag* page, ISC_STATUS* stat
}
static jrd_file* seek_file(jrd_file* file, BufferDesc* bdb, UINT64* offset,
static jrd_file* seek_file(jrd_file* file, BufferDesc* bdb, FB_UINT64* offset,
ISC_STATUS* status_vector)
{
/**************************************
@ -880,10 +880,10 @@ static jrd_file* seek_file(jrd_file* file, BufferDesc* bdb, UINT64* offset,
page -= file->fil_min_page - file->fil_fudge;
UINT64 lseek_offset = page;
FB_UINT64 lseek_offset = page;
lseek_offset *= dbb->dbb_page_size;
if (lseek_offset != (UINT64) LSEEK_OFFSET_CAST lseek_offset)
if (lseek_offset != (FB_UINT64) LSEEK_OFFSET_CAST lseek_offset)
{
unix_error("lseek", file, isc_io_32bit_exceeded_err, status_vector);
return 0;

View File

@ -114,7 +114,7 @@ static void join_to_nulls(thread_db*, RecordSource*, StreamStack*);
static void map_sort_data(thread_db*, jrd_req*, SortMap*, UCHAR *);
static void open_merge(thread_db*, RecordSource*, irsb_mrg*);
static void open_procedure(thread_db*, RecordSource*, irsb_procedure*);
static void open_sort(thread_db*, RecordSource*, irsb_sort*, UINT64);
static void open_sort(thread_db*, RecordSource*, irsb_sort*, FB_UINT64);
static void proc_assignment(thread_db*, const dsc*, const dsc*, UCHAR*, dsc*, SSHORT, Record*);
static void pop_rpbs(jrd_req*, RecordSource*);
static void push_rpbs(thread_db*, jrd_req*, RecordSource*);
@ -436,7 +436,7 @@ void RSE_open(thread_db* tdbb, RecordSource* rsb)
// record set, if there's actually nothing to return
if (first_records) {
open_sort(tdbb, rsb, (irsb_sort*) impure,
(first_records < 0) ? 0 : (UINT64) first_records + skip_records);
(first_records < 0) ? 0 : (FB_UINT64) first_records + skip_records);
}
else {
((irsb_sort*) impure)->irsb_sort_handle = NULL;
@ -2887,7 +2887,7 @@ static void open_procedure(thread_db* tdbb, RecordSource* rsb, irsb_procedure* i
}
static void open_sort(thread_db* tdbb, RecordSource* rsb, irsb_sort* impure, UINT64 max_records)
static void open_sort(thread_db* tdbb, RecordSource* rsb, irsb_sort* impure, FB_UINT64 max_records)
{
/**************************************
*

View File

@ -34,7 +34,7 @@
namespace Jrd {
// Bitmap of record numbers
typedef Firebird::SparseBitmap<UINT64> RecordBitmap;
typedef Firebird::SparseBitmap<FB_UINT64> RecordBitmap;
// Bitmap of page numbers
typedef Firebird::SparseBitmap<ULONG> PageBitmap;

View File

@ -132,8 +132,8 @@ static sort_record* get_merge(merge_control*, sort_context*);
static ULONG allocate_memory(sort_context*, ULONG, ULONG, bool);
static void error_memory(sort_context*);
static inline UINT64 find_file_space(sort_context*, ULONG);
static inline void free_file_space(sort_context*, UINT64, ULONG);
static inline FB_UINT64 find_file_space(sort_context*, ULONG);
static inline void free_file_space(sort_context*, FB_UINT64, ULONG);
static void init(sort_context*);
static bool local_fini(sort_context*, Attachment*);
static void merge_runs(sort_context*, USHORT);
@ -661,7 +661,7 @@ sort_context* SORT_init(thread_db* tdbb,
const sort_key_def* key_description,
FPTR_REJECT_DUP_CALLBACK call_back,
void* user_arg,
UINT64 max_records)
FB_UINT64 max_records)
{
/**************************************
*
@ -873,11 +873,11 @@ void SORT_put(thread_db* tdbb, sort_context* scb, ULONG ** record_address)
#ifdef SCROLLABLE_CURSORS
void SORT_read_block(
#else
UINT64 SORT_read_block(
FB_UINT64 SORT_read_block(
#endif
ISC_STATUS* status_vector,
TempSpace* tmp_space,
UINT64 seek,
FB_UINT64 seek,
BLOB_PTR* address,
ULONG length)
{
@ -1181,9 +1181,9 @@ void SORT_sort(thread_db* tdbb, sort_context* scb)
}
UINT64 SORT_write_block(ISC_STATUS* status_vector,
FB_UINT64 SORT_write_block(ISC_STATUS* status_vector,
TempSpace* tmp_space,
UINT64 seek,
FB_UINT64 seek,
BLOB_PTR* address,
ULONG length)
{
@ -1583,7 +1583,7 @@ static void error_memory(sort_context* scb)
}
static inline UINT64 find_file_space(sort_context* scb, ULONG size)
static inline FB_UINT64 find_file_space(sort_context* scb, ULONG size)
{
/**************************************
*
@ -1602,7 +1602,7 @@ static inline UINT64 find_file_space(sort_context* scb, ULONG size)
}
static inline void free_file_space(sort_context* scb, UINT64 position, ULONG size)
static inline void free_file_space(sort_context* scb, FB_UINT64 position, ULONG size)
{
/**************************************
*
@ -2043,9 +2043,9 @@ static void check_file(const sort_context* scb, const run_control* temp_run)
* Validate memory and file space allocation
*
**************************************/
UINT64 runs = temp_run ? temp_run->run_size : 0;
FB_UINT64 runs = temp_run ? temp_run->run_size : 0;
offset_t free = 0;
UINT64 run_mem = 0;
FB_UINT64 run_mem = 0;
bool ok = scb->scb_space->validate(free);
fb_assert(ok);
@ -2266,7 +2266,7 @@ static void merge_runs(sort_context* scb, USHORT n)
CHECK_FILE(scb);
sort_record* q = reinterpret_cast<sort_record*>(temp_run.run_buffer);
UINT64 seek = temp_run.run_seek = find_file_space(scb, temp_run.run_size);
FB_UINT64 seek = temp_run.run_seek = find_file_space(scb, temp_run.run_size);
temp_run.run_records = 0;
CHECK_FILE2(scb, &temp_run);
@ -2647,7 +2647,7 @@ static void order_and_save(sort_context* scb)
const ULONG key_length =
(scb->scb_longs - SIZEOF_SR_BCKPTR_IN_LONGS) * sizeof(ULONG);
run->run_size = run->run_records * key_length;
UINT64 seek = run->run_seek = find_file_space(scb, run->run_size);
FB_UINT64 seek = run->run_seek = find_file_space(scb, run->run_size);
TempSpace* tmpSpace = scb->scb_space;
char* mem = tmpSpace->inMemory(run->run_seek, run->run_size);
@ -2880,7 +2880,7 @@ namespace
RunSort(run_control* irun) : run(irun) {}
RunSort() : run(NULL) {}
static const UINT64 generate(const void*, const RunSort& item)
static const FB_UINT64 generate(const void*, const RunSort& item)
{ return item.run->run_seek; }
run_control* run;
@ -2903,7 +2903,7 @@ static void sort_runs_by_seek(sort_context* scb, int n)
**************************************/
Firebird::SortedArray<
RunSort, Firebird::InlineStorage<RunSort, RUN_GROUP>, UINT64, RunSort
RunSort, Firebird::InlineStorage<RunSort, RUN_GROUP>, FB_UINT64, RunSort
>
runs(*scb->scb_pool, n);

View File

@ -110,7 +110,7 @@ typedef struct sr
sort_record** sr_bckptr; /* Pointer back to sort list entry */
union {
sort_record sr_sort_record;
UINT64 dummy_alignment_force;
FB_UINT64 dummy_alignment_force;
};
} SR;
@ -201,17 +201,17 @@ struct run_control
ULONG run_max_records; /* total number of records in run */
#endif
USHORT run_depth; /* Number of "elementary" runs */
UINT64 run_seek; /* Offset in file of run */
UINT64 run_size; /* Length of run in work file */
FB_UINT64 run_seek; /* Offset in file of run */
FB_UINT64 run_size; /* Length of run in work file */
#ifdef SCROLLABLE_CURSORS
UINT64 run_cached; /* amount of cached data from run file */
FB_UINT64 run_cached; /* amount of cached data from run file */
#endif
sort_record* run_record; /* Next record in run */
SORTP* run_buffer; /* Run buffer */
SORTP* run_end_buffer; /* End of buffer */
bool run_buff_alloc; /* Allocated buffer flag */
bool run_buff_cache; // run buffer is already in cache
UINT64 run_mem_seek; // position of run's buffer in in-memory part of sort file
FB_UINT64 run_mem_seek; // position of run's buffer in in-memory part of sort file
ULONG run_mem_size; // size of run's buffer in in-memory part of sort file
};
@ -252,7 +252,7 @@ struct sort_context
ULONG scb_key_length; /* Key length */
ULONG scb_unique_length; /* Unique key length, used when duplicates eliminated */
ULONG scb_records; /* Number of records */
//UINT64 scb_max_records; // Maximum number of records to store. Unused.
//FB_UINT64 scb_max_records; // Maximum number of records to store. Unused.
TempSpace* scb_space; // temporary space for scratch file
run_control* scb_runs; /* ALLOC: Run on scratch file, if any */
merge_control* scb_merge; /* Top level merge block */

View File

@ -34,18 +34,18 @@ namespace Jrd {
#ifdef SCROLLABLE_CURSORS
void SORT_diddle_key(UCHAR *, Jrd::sort_context*, bool);
void SORT_get(Jrd::thread_db*, Jrd::sort_context*, ULONG **, RSE_GET_MODE);
void SORT_read_block(ISC_STATUS*, TempSpace*, UINT64, BLOB_PTR *, ULONG);
void SORT_read_block(ISC_STATUS*, TempSpace*, FB_UINT64, BLOB_PTR *, ULONG);
#else
void SORT_get(Jrd::thread_db*, Jrd::sort_context*, ULONG **);
UINT64 SORT_read_block(ISC_STATUS*, TempSpace*, UINT64, BLOB_PTR *, ULONG);
UINT64 SORT_read_block(ISC_STATUS*, TempSpace*, FB_UINT64, BLOB_PTR *, ULONG);
#endif
void SORT_fini(Jrd::sort_context*, Jrd::Attachment*);
Jrd::sort_context* SORT_init(Jrd::thread_db*, USHORT, USHORT, USHORT, const Jrd::sort_key_def*,
Jrd::FPTR_REJECT_DUP_CALLBACK, void*, UINT64);
Jrd::FPTR_REJECT_DUP_CALLBACK, void*, FB_UINT64);
void SORT_put(Jrd::thread_db*, Jrd::sort_context*, ULONG **);
void SORT_shutdown(Jrd::Attachment*);
void SORT_sort(Jrd::thread_db*, Jrd::sort_context*);
UINT64 SORT_write_block(ISC_STATUS*, TempSpace*, UINT64, BLOB_PTR *, ULONG);
FB_UINT64 SORT_write_block(ISC_STATUS*, TempSpace*, FB_UINT64, BLOB_PTR *, ULONG);
#endif // JRD_SORT_PROTO_H

View File

@ -180,29 +180,29 @@ typedef struct lhb {
SRQ_PTR lhb_mask; /* Semaphore mask block */
ULONG lhb_scan_interval; /* Deadlock scan interval (secs) */
ULONG lhb_acquire_spins;
UINT64 lhb_acquires;
UINT64 lhb_acquire_blocks;
UINT64 lhb_acquire_retries;
UINT64 lhb_retry_success;
UINT64 lhb_enqs;
UINT64 lhb_converts;
UINT64 lhb_downgrades;
UINT64 lhb_deqs;
UINT64 lhb_read_data;
UINT64 lhb_write_data;
UINT64 lhb_query_data;
UINT64 lhb_operations[LCK_MAX_SERIES];
UINT64 lhb_waits;
UINT64 lhb_denies;
UINT64 lhb_timeouts;
UINT64 lhb_blocks;
UINT64 lhb_direct_sigs;
UINT64 lhb_indirect_sigs;
UINT64 lhb_wakeups;
UINT64 lhb_scans;
UINT64 lhb_deadlocks;
FB_UINT64 lhb_acquires;
FB_UINT64 lhb_acquire_blocks;
FB_UINT64 lhb_acquire_retries;
FB_UINT64 lhb_retry_success;
FB_UINT64 lhb_enqs;
FB_UINT64 lhb_converts;
FB_UINT64 lhb_downgrades;
FB_UINT64 lhb_deqs;
FB_UINT64 lhb_read_data;
FB_UINT64 lhb_write_data;
FB_UINT64 lhb_query_data;
FB_UINT64 lhb_operations[LCK_MAX_SERIES];
FB_UINT64 lhb_waits;
FB_UINT64 lhb_denies;
FB_UINT64 lhb_timeouts;
FB_UINT64 lhb_blocks;
FB_UINT64 lhb_direct_sigs;
FB_UINT64 lhb_indirect_sigs;
FB_UINT64 lhb_wakeups;
FB_UINT64 lhb_scans;
FB_UINT64 lhb_deadlocks;
ULONG lhb_wait_time;
UINT64 lhb_reserved[2]; /* For future use */
FB_UINT64 lhb_reserved[2]; /* For future use */
srq lhb_data[LCK_MAX_SERIES];
srq lhb_hash[1]; /* Hash table */
} *LHB;
@ -292,7 +292,7 @@ struct own
SRQ_PTR own_pending_request; /* Request we're waiting on */
int own_process_id; /* Owner's process ID */
int own_process_uid; /* Owner's process UID */
UINT64 own_acquire_time; /* lhb_acquires when owner last tried acquire() */
FB_UINT64 own_acquire_time; /* lhb_acquires when owner last tried acquire() */
ULONG own_acquire_realtime; /* GET_TIME when owner last tried acquire() */
#ifdef WIN_NT
void *own_wakeup_hndl; /* Handle of wakeup event */

View File

@ -455,7 +455,7 @@ int CLIB_ROUTINE main( int argc, char *argv[])
LOCK_header->lhb_acquire_spins);
if (LOCK_header->lhb_acquire_blocks) {
// CVC: MSVC up to v6 couldn't convert UINT64 to double.
// CVC: MSVC up to v6 couldn't convert FB_UINT64 to double.
const float bottleneck =
(float) ((100. * (SINT64) LOCK_header->lhb_acquire_blocks) /
(SINT64) LOCK_header->lhb_acquires);

View File

@ -353,7 +353,7 @@ static PAG db_read( SLONG page_number)
*
**************************************/
UINT64 offset = ((UINT64)page_number) * ((UINT64)page_size);
FB_UINT64 offset = ((FB_UINT64)page_number) * ((FB_UINT64)page_size);
if (!global_buffer)
global_buffer = (pag*) malloc(page_size);

View File

@ -95,7 +95,7 @@ struct dba_idx {
ULONG idx_total_duplicates;
ULONG idx_max_duplicates;
ULONG idx_nodes;
UINT64 idx_data_length;
FB_UINT64 idx_data_length;
SLONG idx_fill_distribution[BUCKETS];
SCHAR idx_name[MAX_SQL_IDENTIFIER_SIZE];
};
@ -108,12 +108,12 @@ struct dba_rel {
SLONG rel_slots;
ULONG rel_data_pages;
ULONG rel_records;
UINT64 rel_record_space;
FB_UINT64 rel_record_space;
ULONG rel_versions;
UINT64 rel_version_space;
FB_UINT64 rel_version_space;
ULONG rel_max_versions;
SLONG rel_fill_distribution[BUCKETS];
UINT64 rel_total_space;
FB_UINT64 rel_total_space;
SSHORT rel_id;
SCHAR rel_name[MAX_SQL_IDENTIFIER_SIZE];
};
@ -134,7 +134,7 @@ struct dba_fil {
SCHAR fil_string[1]; /* Expanded file name */
};
// CVC: I need to compile in MSVC6 that doesn't accept UINT64 to double conversion.
// CVC: I need to compile in MSVC6 that doesn't accept FB_UINT64 to double conversion.
#if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER == 1200
#define CAST64 (SINT64)
#else
@ -1732,7 +1732,7 @@ static const pag* db_read( SLONG page_number)
}
page_number -= fil->fil_min_page - fil->fil_fudge;
const UINT64 offset = ((UINT64)page_number) * ((UINT64)tddba->page_size);
const FB_UINT64 offset = ((FB_UINT64)page_number) * ((FB_UINT64)tddba->page_size);
if (lseek (fil->fil_desc, offset, 0) == -1) {
#ifdef SERVICE_THREAD
CMD_UTIL_put_svc_status(tddba->dba_service_blk->svc_status,

View File

@ -378,7 +378,7 @@ PAG RBDB_read(RBDB rbdb, SLONG page_number)
**************************************/
int file = rbdb->rbdb_file.fil_file;
const UINT64 offset = ((UINT64)page_number) * ((UINT64)rbdb->rbdb_page_size);
const FB_UINT64 offset = ((FB_UINT64)page_number) * ((FB_UINT64)rbdb->rbdb_page_size);
if (lseek (file, offset, 0) == -1)
db_error(errno);
@ -415,7 +415,7 @@ void RBDB_write( RBDB rbdb, PAG page, SLONG page_number)
const ULONG page_size = rbdb->rbdb_page_size;
int fd = rbdb->rbdb_file.fil_file;
const UINT64 offset = ((UINT64)page_number) * ((UINT64)page_size);
const FB_UINT64 offset = ((FB_UINT64)page_number) * ((FB_UINT64)page_size);
if (lseek (fd, offset, 0) == -1)
db_error(errno);
if (write(fd, page, page_size) == -1)