Patch level :10.0
Files correlati : Ricompilazione Demo : [ ] Commento : sistemata variabile globale non dichiarata come tale e un po' incasinata nel suo uso git-svn-id: svn://10.65.10.50/trunk@20173 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8e77cebeaf
commit
0f6d11df4d
@ -7,7 +7,7 @@ TSort::TSort(int len)
|
|||||||
{
|
{
|
||||||
_sortvar = new s_prm;
|
_sortvar = new s_prm;
|
||||||
_sortvar->rc_len = len;
|
_sortvar->rc_len = len;
|
||||||
nsortkey = 0;
|
_nsortkey = 0;
|
||||||
for (int i = 0; i < NOFLDS; i++)
|
for (int i = 0; i < NOFLDS; i++)
|
||||||
{
|
{
|
||||||
_sortvar->s_fld[i].f_pos = 0;
|
_sortvar->s_fld[i].f_pos = 0;
|
||||||
@ -27,7 +27,7 @@ TSort::~TSort()
|
|||||||
void TSort::init()
|
void TSort::init()
|
||||||
|
|
||||||
{
|
{
|
||||||
CHECK(_sortvar->rc_len && nsortkey, "Attempt to initialize undefined sort");
|
CHECK(_sortvar->rc_len && _nsortkey, "Attempt to initialize undefined sort");
|
||||||
while (retrieve() != NULL);
|
while (retrieve() != NULL);
|
||||||
init_sort(_sortvar);
|
init_sort(_sortvar);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ void TSort::reset(int len)
|
|||||||
|
|
||||||
{
|
{
|
||||||
_sortvar->rc_len = len ;
|
_sortvar->rc_len = len ;
|
||||||
nsortkey = 0;
|
_nsortkey = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -93,16 +93,18 @@ void TSort::addsortkey(
|
|||||||
|
|
||||||
{
|
{
|
||||||
CHECK(pos >= 0 && pos+len <= _sortvar->rc_len, "Invalid sort key");
|
CHECK(pos >= 0 && pos+len <= _sortvar->rc_len, "Invalid sort key");
|
||||||
_sortvar->s_fld[nsortkey].f_pos = pos + 1;
|
_sortvar->s_fld[_nsortkey].f_pos = pos + 1;
|
||||||
_sortvar->s_fld[nsortkey].f_len = len;
|
_sortvar->s_fld[_nsortkey].f_len = len;
|
||||||
_sortvar->s_fld[nsortkey++].ad = direction;
|
_sortvar->s_fld[_nsortkey].ad = direction;
|
||||||
|
_nsortkey++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TSort::addsortkey(TRecfield& f, char direction)
|
void TSort::addsortkey(TRecfield& f, char direction)
|
||||||
{
|
{
|
||||||
CHECK(f.pos() != NULL, "Invalid sort key");
|
CHECK(f.pos() != NULL, "Invalid sort key");
|
||||||
_sortvar->s_fld[nsortkey].f_pos = (f.pos() - f.record().string()) + 1;
|
_sortvar->s_fld[_nsortkey].f_pos = (f.pos() - f.record().string()) + 1;
|
||||||
_sortvar->s_fld[nsortkey].f_len = f.len();
|
_sortvar->s_fld[_nsortkey].f_len = f.len();
|
||||||
_sortvar->s_fld[nsortkey++].ad = direction;
|
_sortvar->s_fld[_nsortkey].ad = direction;
|
||||||
|
_nsortkey++;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ class TSort : public TObject
|
|||||||
// @cmember:(INTERNAL) Puntatore alla struttura di un sort
|
// @cmember:(INTERNAL) Puntatore alla struttura di un sort
|
||||||
struct s_prm* _sortvar;
|
struct s_prm* _sortvar;
|
||||||
// @cmember:(INTERNAL) Indice nella tabella dei campi della chiave
|
// @cmember:(INTERNAL) Indice nella tabella dei campi della chiave
|
||||||
int nsortkey;
|
int _nsortkey;
|
||||||
|
|
||||||
// @access Public Member
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user