1
0
Fork 0

moved magic number to function

This commit is contained in:
Jan Steemann 2014-05-16 19:05:54 +02:00
parent 81c68927aa
commit d5200f26d7
4 changed files with 18 additions and 29 deletions

View File

@ -47,11 +47,6 @@ struct TRI_document_collection_s;
// --SECTION-- public types
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup VocBase
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief datafile attribute marker
////////////////////////////////////////////////////////////////////////////////
@ -75,19 +70,10 @@ typedef struct TRI_df_shape_marker_s {
}
TRI_df_shape_marker_t;
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup VocBase
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a shaper
////////////////////////////////////////////////////////////////////////////////
@ -107,19 +93,10 @@ void TRI_DestroyVocShaper (TRI_shaper_t*);
void TRI_FreeVocShaper (TRI_shaper_t*);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup VocBase
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief destroys a shaper, but does not free the pointer
////////////////////////////////////////////////////////////////////////////////
@ -182,10 +159,6 @@ int TRI_CompareShapeTypes (TRI_doc_mptr_t* leftDocument,
TRI_shaper_t* leftShaper,
TRI_shaper_t* rightShaper);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif

View File

@ -505,6 +505,14 @@ TRI_shape_t* TRI_LookupBasicShapeShaper (TRI_shape_t const* shape) {
return NULL;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the first id for user-defined shapes
////////////////////////////////////////////////////////////////////////////////
TRI_shape_sid_t TRI_FirstCustomShapeIdShaper () {
return 7;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief initialises global basic shape types
////////////////////////////////////////////////////////////////////////////////
@ -555,6 +563,8 @@ void TRI_InitialiseShaper () {
shape->_type = TRI_SHAPE_LIST;
shape->_dataSize = TRI_SHAPE_SIZE_VARIABLE;
shape->_sid = BasicShapes._sidList = 6;
assert(shape->_sid + 1 == TRI_FirstCustomShapeIdShaper());
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -165,6 +165,12 @@ TRI_shape_t* TRI_LookupSidBasicShapeShaper (TRI_shape_sid_t);
TRI_shape_t* TRI_LookupBasicShapeShaper (TRI_shape_t const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the first id for user-defined shapes
////////////////////////////////////////////////////////////////////////////////
TRI_shape_sid_t TRI_FirstCustomShapeIdShaper (void);
////////////////////////////////////////////////////////////////////////////////
/// @brief initialises global basic shape types
////////////////////////////////////////////////////////////////////////////////