Skip to content

Commit

Permalink
ICU-13530 fix doxygen warnings: hide internals, hide struct/enum type…
Browse files Browse the repository at this point in the history
…defs, avoid fwd+real struct decl (unicode-org#84)
  • Loading branch information
markusicu authored and sffc committed Sep 27, 2018
1 parent cbfec97 commit 0c0ad0d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 64 deletions.
134 changes: 71 additions & 63 deletions icu4c/source/common/unicode/ucptrie.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ U_CDECL_BEGIN
* @see UMutableCPTrie
*/

#ifndef U_IN_DOXYGEN
/** @internal */
typedef union UCPTrieData {
/** @internal */
const void *ptr0;
/** @internal */
const uint16_t *ptr16;
/** @internal */
const uint32_t *ptr32;
/** @internal */
const uint8_t *ptr8;
} UCPTrieData;
#endif

/**
* Immutable Unicode code point trie structure.
* Fast, reasonably compact, map from Unicode code points (U+0000..U+10FFFF) to integer values.
Expand All @@ -41,8 +55,56 @@ U_CDECL_BEGIN
* @see UMutableCPTrie
* @draft ICU 63
*/
struct UCPTrie;
struct UCPTrie {
#ifndef U_IN_DOXYGEN
/** @internal */
const uint16_t *index;
/** @internal */
UCPTrieData data;

/** @internal */
int32_t indexLength;
/** @internal */
int32_t dataLength;
/** Start of the last range which ends at U+10FFFF. @internal */
UChar32 highStart;
/** highStart>>12 @internal */
uint16_t shifted12HighStart;

/** @internal */
int8_t type; // UCPTrieType
/** @internal */
int8_t valueWidth; // UCPTrieValueWidth

/** padding/reserved @internal */
uint32_t reserved32;
/** padding/reserved @internal */
uint16_t reserved16;

/**
* Internal index-3 null block offset.
* Set to an impossibly high value (e.g., 0xffff) if there is no dedicated index-3 null block.
* @internal
*/
uint16_t index3NullOffset;
/**
* Internal data null block offset, not shifted.
* Set to an impossibly high value (e.g., 0xfffff) if there is no dedicated data null block.
* @internal
*/
int32_t dataNullOffset;
/** @internal */
uint32_t nullValue;

#ifdef UCPTRIE_DEBUG
/** @internal */
const char *name;
#endif
#endif
};
#ifndef U_IN_DOXYGEN
typedef struct UCPTrie UCPTrie;
#endif

/**
* Selectors for the type of a UCPTrie.
Expand Down Expand Up @@ -71,7 +133,9 @@ enum UCPTrieType {
*/
UCPTRIE_TYPE_SMALL
};
#ifndef U_IN_DOXYGEN
typedef enum UCPTrieType UCPTrieType;
#endif

/**
* Selectors for the number of bits in a UCPTrie data value.
Expand Down Expand Up @@ -106,7 +170,9 @@ enum UCPTrieValueWidth {
*/
UCPTRIE_VALUE_BITS_8
};
#ifndef U_IN_DOXYGEN
typedef enum UCPTrieValueWidth UCPTrieValueWidth;
#endif

/**
* Selectors for how ucptrie_getRange() should report value ranges overlapping with surrogates.
Expand Down Expand Up @@ -152,7 +218,9 @@ enum UCPTrieRangeOption {
*/
UCPTRIE_RANGE_FIXED_ALL_SURROGATES
};
#ifndef U_IN_DOXYGEN
typedef enum UCPTrieRangeOption UCPTrieRangeOption;
#endif

/**
* Opens a trie from its binary form, stored in 32-bit-aligned memory.
Expand Down Expand Up @@ -558,68 +626,7 @@ ucptrie_toBinary(const UCPTrie *trie, void *data, int32_t capacity, UErrorCode *

/* Internal definitions ----------------------------------------------------- */

/** @internal */
typedef union UCPTrieData {
/** @internal */
const void *ptr0;
/** @internal */
const uint16_t *ptr16;
/** @internal */
const uint32_t *ptr32;
/** @internal */
const uint8_t *ptr8;
} UCPTrieData;

/**
* Internal trie structure definition.
* Visible only for use by API macros.
* @internal
*/
struct UCPTrie {
/** @internal */
const uint16_t *index;
/** @internal */
UCPTrieData data;

/** @internal */
int32_t indexLength;
/** @internal */
int32_t dataLength;
/** Start of the last range which ends at U+10FFFF. @internal */
UChar32 highStart;
/** highStart>>12 @internal */
uint16_t shifted12HighStart;

/** @internal */
int8_t type; // UCPTrieType
/** @internal */
int8_t valueWidth; // UCPTrieValueWidth

/** padding/reserved @internal */
uint32_t reserved32;
/** padding/reserved @internal */
uint16_t reserved16;

/**
* Internal index-3 null block offset.
* Set to an impossibly high value (e.g., 0xffff) if there is no dedicated index-3 null block.
* @internal
*/
uint16_t index3NullOffset;
/**
* Internal data null block offset, not shifted.
* Set to an impossibly high value (e.g., 0xfffff) if there is no dedicated data null block.
* @internal
*/
int32_t dataNullOffset;
/** @internal */
uint32_t nullValue;

#ifdef UCPTRIE_DEBUG
/** @internal */
const char *name;
#endif
};
#ifndef U_IN_DOXYGEN

/**
* Internal implementation constants.
Expand Down Expand Up @@ -696,4 +703,5 @@ ucptrie_internalU8PrevIndex(const UCPTrie *trie, UChar32 c,

U_CDECL_END

#endif // U_IN_DOXYGEN
#endif
1 change: 0 additions & 1 deletion icu4c/source/common/unicode/umutablecptrie.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ U_CDECL_BEGIN
* @see umutablecptrie_buildImmutable
* @draft ICU 63
*/
struct UMutableCPTrie;
typedef struct UMutableCPTrie UMutableCPTrie;

/**
Expand Down

0 comments on commit 0c0ad0d

Please sign in to comment.