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

Use enumerations where possible (2).

This commit is contained in:
robocop 2014-04-04 18:39:55 +00:00
parent 4aeb269291
commit e070d5135e
4 changed files with 15 additions and 11 deletions

View File

@ -2417,7 +2417,7 @@ void MET_lookup_index(thread_db* tdbb,
SLONG MET_lookup_index_name(thread_db* tdbb,
const MetaName& index_name,
SLONG* relation_id, SSHORT* status)
SLONG* relation_id, IndexStatus* status)
{
/**************************************
*

View File

@ -70,12 +70,6 @@ public:
const int TFB_computed = 1;
const int TFB_array = 2;
// index status
const SSHORT MET_object_active = 0;
const SSHORT MET_object_inactive = 1;
const SSHORT MET_object_unknown = 2;
const int TRIGGER_PRE_STORE = 1;
const int TRIGGER_POST_STORE = 2;

View File

@ -28,7 +28,8 @@
struct dsc;
namespace Jrd {
namespace Jrd
{
class jrd_tra;
class jrd_req;
class JrdStatement;
@ -45,6 +46,15 @@ namespace Jrd {
class DeferredWork;
struct FieldInfo;
class ExceptionItem;
// index status
enum IndexStatus
{
MET_object_active,
MET_object_inactive,
MET_object_unknown
};
}
struct SubtypeInfo
@ -95,7 +105,7 @@ bool MET_load_generator(Jrd::thread_db*, Jrd::GeneratorItem&, bool* sysGen = 0)
SLONG MET_lookup_generator(Jrd::thread_db*, const Firebird::MetaName&, bool* sysGen = 0);
bool MET_lookup_generator_id(Jrd::thread_db*, SLONG, Firebird::MetaName&, bool* sysGen = 0);
void MET_lookup_index(Jrd::thread_db*, Firebird::MetaName&, const Firebird::MetaName&, USHORT);
SLONG MET_lookup_index_name(Jrd::thread_db*, const Firebird::MetaName&, SLONG*, SSHORT*);
SLONG MET_lookup_index_name(Jrd::thread_db*, const Firebird::MetaName&, SLONG*, Jrd::IndexStatus* status);
bool MET_lookup_partner(Jrd::thread_db*, Jrd::jrd_rel*, struct Jrd::index_desc*, const TEXT*);
Jrd::jrd_prc* MET_lookup_procedure(Jrd::thread_db*, const Firebird::QualifiedName&, bool);
Jrd::jrd_prc* MET_lookup_procedure_id(Jrd::thread_db*, USHORT, bool, bool, USHORT);

View File

@ -1085,7 +1085,7 @@ static PlanNode* par_plan(thread_db* tdbb, CompilerScratch* csb)
*p = UPPER (*p);
*/
SLONG relation_id;
SSHORT idx_status;
IndexStatus idx_status;
const SLONG index_id = MET_lookup_index_name(tdbb, name, &relation_id, &idx_status);
if (idx_status == MET_object_unknown || idx_status == MET_object_inactive)
@ -1145,7 +1145,7 @@ static PlanNode* par_plan(thread_db* tdbb, CompilerScratch* csb)
*p = UPPER(*p);
*/
SLONG relation_id;
SSHORT idx_status;
IndexStatus idx_status;
const SLONG index_id = MET_lookup_index_name(tdbb, name, &relation_id, &idx_status);
if (idx_status == MET_object_unknown || idx_status == MET_object_inactive)