Correzioni a commit di alex
git-svn-id: svn://10.65.10.50/trunk@3368 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
bf10a72502
commit
2262feb31e
2781
include/cfiles.c
2781
include/cfiles.c
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,8 @@
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
extern "C" char *CAddPref(char* name);
|
||||
|
||||
#include <extcdecl.h>
|
||||
|
||||
#define BLOCKLEN 512
|
||||
@ -305,16 +307,15 @@ int TDir::items (
|
||||
}
|
||||
|
||||
TTrec::TTrec ()
|
||||
|
||||
: _des(NULL), _tab("")
|
||||
{
|
||||
_des = NULL;
|
||||
_tab = "";
|
||||
_rec = new RecDes;
|
||||
zero ();
|
||||
_num = -1;
|
||||
}
|
||||
|
||||
TTrec::TTrec(const TTrec & r)
|
||||
: _des(NULL), _tab("")
|
||||
{
|
||||
_rec = new RecDes;
|
||||
*_rec = *r._rec;
|
||||
@ -336,43 +337,7 @@ int TTrec::compare(const TSortable & a) const
|
||||
|
||||
void TTrec::rehash()
|
||||
{
|
||||
int pos, tmppos, nf, i;
|
||||
|
||||
for (i = 0; i < MaxFields; i++) _rec->SortFd[i] = INVFLD;
|
||||
if (_rec->NFields)
|
||||
{
|
||||
for (i = 0; i < _rec->NFields; i++)
|
||||
{
|
||||
nf = i;
|
||||
pos = hashfun(_rec->Fd[nf].Name);
|
||||
while (TRUE)
|
||||
{
|
||||
if (_rec->SortFd[pos] == INVFLD)
|
||||
{
|
||||
_rec->SortFd[pos] = (byte) nf;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strcmp(_rec->Fd[_rec->SortFd[pos]].Name, _rec->Fd[nf].Name) <= 0)
|
||||
{
|
||||
pos++;
|
||||
if (pos >= MaxFields)
|
||||
pos = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmppos = _rec->SortFd[pos];
|
||||
_rec->SortFd[pos] = (byte) nf;
|
||||
nf = tmppos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_rec->Fd[0].RecOff = 1;
|
||||
for (i = 1; i < _rec->NFields; i++)
|
||||
_rec->Fd[i].RecOff = _rec->Fd[i - 1].RecOff + _rec->Fd[i - 1].Len;
|
||||
}
|
||||
setrdes(_rec);
|
||||
}
|
||||
|
||||
TTrec & TTrec::operator = (const TTrec & b)
|
||||
|
Loading…
x
Reference in New Issue
Block a user