projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update cvsignore due to new type of files generated by libtool.
[idzebra-moved-to-github.git]
/
index
/
recindex.c
diff --git
a/index/recindex.c
b/index/recindex.c
index
0f19b21
..
f72a0d0
100644
(file)
--- a/
index/recindex.c
+++ b/
index/recindex.c
@@
-1,4
+1,4
@@
-/* $Id: recindex.c,v 1.35 2004-08-04 08:35:23 adam Exp $
+/* $Id: recindex.c,v 1.37 2004-08-18 17:02:05 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
@@
-23,13
+23,13
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/*
* Format of first block
/*
* Format of first block
- * next (4 bytes)
- * ref_count (4 bytes)
- * block (504 bytes)
+ * next (8 bytes)
+ * ref_count (2 bytes)
+ * block (500 bytes)
*
* Format of subsequent blocks
*
* Format of subsequent blocks
- * next (4 bytes)
- * block (508 bytes)
+ * next (8 bytes)
+ * block (502 bytes)
*
* Format of each record
* sysno
*
* Format of each record
* sysno
@@
-77,7
+77,7
@@
static int read_indx (Records p, SYSNO sysno, void *buf, int itemsize,
int r;
zint pos = (sysno-1)*itemsize;
int r;
zint pos = (sysno-1)*itemsize;
- r = bf_read (p->index_BFile, 1+pos/128, pos%128, itemsize, buf);
+ r = bf_read (p->index_BFile, 1+pos/128, (int) (pos%128), itemsize, buf);
if (r != 1 && !ignoreError)
{
logf (LOG_FATAL|LOG_ERRNO, "read in %s at pos %ld",
if (r != 1 && !ignoreError)
{
logf (LOG_FATAL|LOG_ERRNO, "read in %s at pos %ld",
@@
-91,14
+91,14
@@
static void write_indx (Records p, SYSNO sysno, void *buf, int itemsize)
{
zint pos = (sysno-1)*itemsize;
{
zint pos = (sysno-1)*itemsize;
- bf_write (p->index_BFile, 1+pos/128, pos%128, itemsize, buf);
+ bf_write (p->index_BFile, 1+pos/128, (int) (pos%128), itemsize, buf);
}
static void rec_release_blocks (Records p, SYSNO sysno)
{
struct record_index_entry entry;
zint freeblock;
}
static void rec_release_blocks (Records p, SYSNO sysno)
{
struct record_index_entry entry;
zint freeblock;
- char block_and_ref[sizeof(short) + sizeof(zint)];
+ char block_and_ref[sizeof(zint) + sizeof(short)];
int dst_type;
int first = 1;
int dst_type;
int first = 1;
@@
-107,13
+107,14
@@
static void rec_release_blocks (Records p, SYSNO sysno)
freeblock = entry.next;
assert (freeblock > 0);
freeblock = entry.next;
assert (freeblock > 0);
- dst_type = freeblock & 7;
+ dst_type = (int) (freeblock & 7);
assert (dst_type < REC_BLOCK_TYPES);
freeblock = freeblock / 8;
while (freeblock)
{
if (bf_read (p->data_BFile[dst_type], freeblock, 0,
assert (dst_type < REC_BLOCK_TYPES);
freeblock = freeblock / 8;
while (freeblock)
{
if (bf_read (p->data_BFile[dst_type], freeblock, 0,
- sizeof(block_and_ref), block_and_ref) != 1)
+ first ? sizeof(block_and_ref) : sizeof(zint),
+ block_and_ref) != 1)
{
logf (LOG_FATAL|LOG_ERRNO, "read in rec_del_single");
exit (1);
{
logf (LOG_FATAL|LOG_ERRNO, "read in rec_del_single");
exit (1);
@@
-340,11
+341,11
@@
static void rec_encode_zint (zint n, unsigned char *buf, int *len)
(*len) = 0;
while (n > 127)
{
(*len) = 0;
while (n > 127)
{
- buf[*len] = 128 + (n & 127);
+ buf[*len] = (unsigned) (128 + (n & 127));
n = n >> 7;
(*len)++;
}
n = n >> 7;
(*len)++;
}
- buf[*len] = n;
+ buf[*len] = (unsigned) n;
(*len)++;
}
(*len)++;
}
@@
-624,7
+625,7
@@
static Record rec_get_int (Records p, SYSNO sysno)
if (!entry.size)
return NULL; /* record is deleted */
if (!entry.size)
return NULL; /* record is deleted */
- dst_type = entry.next & 7;
+ dst_type = (int) (entry.next & 7);
assert (dst_type < REC_BLOCK_TYPES);
freeblock = entry.next / 8;
assert (dst_type < REC_BLOCK_TYPES);
freeblock = entry.next / 8;