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

Fixed problems with windows build and database restore - thanks to Dmitry and Vlad

This commit is contained in:
alexpeshkoff 2007-03-27 11:46:47 +00:00
parent 1a2d2081c4
commit af5cbf523e
2 changed files with 8 additions and 12 deletions

View File

@ -96,7 +96,7 @@ const ULONG MAX_TEMPFILE_SIZE = 1073741824; // 1GB
// the size of sr_bckptr in # of 32 bit longwords
#define SIZEOF_SR_BCKPTR_IN_LONGS (SIZEOF_SR_BCKPTR / sizeof(SLONG))
// offset in array of pointers to back record pointer (sr_bckptr)
#define BACK_OFFSET (-(ALIGNMENT / sizeof(SLONG*)))
#define BACK_OFFSET (-(SIZEOF_SR_BCKPTR / sizeof(SLONG*)))
#define DIFF_LONGS(a, b) ((a) - (b))
#define SWAP_LONGS(a, b, t) {t = a; a = b; b = t;}
@ -692,7 +692,7 @@ sort_context* SORT_init(thread_db* tdbb,
scb->scb_status_vector = status_vector;
//scb->scb_length = record_length;
scb->scb_longs =
ROUNDUP(record_length + ALIGNMENT, ALIGNMENT) >> SHIFTLONG;
ROUNDUP(record_length + SIZEOF_SR_BCKPTR, ALIGNMENT) >> SHIFTLONG;
scb->scb_dup_callback = call_back;
scb->scb_dup_callback_arg = user_arg;
scb->scb_keys = keys;
@ -2598,11 +2598,7 @@ static void sort(sort_context* scb)
tl--;
}
if (tl && *p > *q) {
((SORTP ***) (*i))[-1] = j;
((SORTP ***) (*j))[-1] = i;
temp = *i;
*i = *j;
*j = temp;
swap(i, j);
}
}
}

View File

@ -73,10 +73,7 @@ typedef IPTR sort_ptr_t;
struct sort_record
{
union {
ULONG sort_record_key[1];
UINT64 dummy_alignment_force;
};
ULONG sort_record_key[1];
/* Sorting key. Mangled by diddle_key to
compare using ULONG word compares (size
is rounded upwards if necessary).
@ -111,7 +108,10 @@ const ULONG MAX_SORT_RECORD = 65535; /* bytes */
typedef struct sr
{
sort_record** sr_bckptr; /* Pointer back to sort list entry */
sort_record sr_sort_record;
union {
sort_record sr_sort_record;
UINT64 dummy_alignment_force;
};
} SR;
/* scb_longs includes the size of sr_bckptr. */