Clang-Tidy: Enable redundant static qualifier warning

This change enables readability-static-definition-in-anonymous-namespace
warning in .clang-tidy configuration.
This commit is contained in:
Sergey Sharybin 2020-07-03 12:57:16 +02:00
parent aab41401f9
commit 6fea8ec183
8 changed files with 24 additions and 26 deletions

View File

@ -21,7 +21,6 @@ Checks: >
-readability-named-parameter,
-readability-function-size,
-readability-function-size,
-readability-static-definition-in-anonymous-namespace,
-readability-delete-null-pointer,
-readability-redundant-string-init,
-readability-redundant-member-init,

View File

@ -77,22 +77,22 @@ struct CyclesSolverState {
int num_cycles;
};
BLI_INLINE void set_node_visited_state(Node *node, eCyclicCheckVisitedState state)
inline void set_node_visited_state(Node *node, eCyclicCheckVisitedState state)
{
node->custom_flags = (node->custom_flags & ~0x3) | (int)state;
}
BLI_INLINE eCyclicCheckVisitedState get_node_visited_state(Node *node)
inline eCyclicCheckVisitedState get_node_visited_state(Node *node)
{
return (eCyclicCheckVisitedState)(node->custom_flags & 0x3);
}
BLI_INLINE void set_node_num_visited_children(Node *node, int num_children)
inline void set_node_num_visited_children(Node *node, int num_children)
{
node->custom_flags = (node->custom_flags & 0x3) | (num_children << 2);
}
BLI_INLINE int get_node_num_visited_children(Node *node)
inline int get_node_num_visited_children(Node *node)
{
return node->custom_flags >> 2;
}

View File

@ -55,9 +55,8 @@ struct StatsEntry {
};
/* TODO(sergey): De-duplicate with graphviz relation debugger. */
static void deg_debug_fprintf(const DebugContext &ctx, const char *fmt, ...)
ATTR_PRINTF_FORMAT(2, 3);
static void deg_debug_fprintf(const DebugContext &ctx, const char *fmt, ...)
void deg_debug_fprintf(const DebugContext &ctx, const char *fmt, ...) ATTR_PRINTF_FORMAT(2, 3);
void deg_debug_fprintf(const DebugContext &ctx, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
@ -65,7 +64,7 @@ static void deg_debug_fprintf(const DebugContext &ctx, const char *fmt, ...)
va_end(args);
}
BLI_INLINE double get_node_time(const DebugContext & /*ctx*/, const Node *node)
inline double get_node_time(const DebugContext & /*ctx*/, const Node *node)
{
// TODO(sergey): Figure out a nice way to define which exact time
// we want to show.

View File

@ -98,7 +98,7 @@ void verify_id_properties_freed(DEGObjectIterData *data)
temp_dupli_object->id.properties = nullptr;
}
static bool deg_object_hide_original(eEvaluationMode eval_mode, Object *ob, DupliObject *dob)
bool deg_object_hide_original(eEvaluationMode eval_mode, Object *ob, DupliObject *dob)
{
/* Automatic hiding if this object is being instanced on verts/faces/frames
* by its parent. Ideally this should not be needed, but due to the wrong

View File

@ -362,12 +362,12 @@ void deg_graph_id_tag_legacy_compat(
}
}
static void graph_id_tag_update_single_flag(Main *bmain,
Depsgraph *graph,
ID *id,
IDNode *id_node,
IDRecalcFlag tag,
eUpdateSource update_source)
void graph_id_tag_update_single_flag(Main *bmain,
Depsgraph *graph,
ID *id,
IDNode *id_node,
IDRecalcFlag tag,
eUpdateSource update_source)
{
if (tag == ID_RECALC_EDITORS) {
if (graph != nullptr && graph->is_active) {

View File

@ -496,7 +496,7 @@ void update_scene_orig_pointers(const Scene *scene_orig, Scene *scene_cow)
}
/* Check whether given ID is expanded or still a shallow copy. */
BLI_INLINE bool check_datablock_expanded(const ID *id_cow)
inline bool check_datablock_expanded(const ID *id_cow)
{
return (id_cow->name[0] != '\0');
}

View File

@ -99,7 +99,7 @@ void flush_init_id_node_func(void *__restrict data_v,
}
}
BLI_INLINE void flush_prepare(Depsgraph *graph)
inline void flush_prepare(Depsgraph *graph)
{
for (OperationNode *node : graph->operations) {
node->scheduled = false;
@ -114,7 +114,7 @@ BLI_INLINE void flush_prepare(Depsgraph *graph)
}
}
BLI_INLINE void flush_schedule_entrypoints(Depsgraph *graph, FlushQueue *queue)
inline void flush_schedule_entrypoints(Depsgraph *graph, FlushQueue *queue)
{
for (OperationNode *op_node : graph->entry_tags) {
queue->push_back(op_node);
@ -126,15 +126,15 @@ BLI_INLINE void flush_schedule_entrypoints(Depsgraph *graph, FlushQueue *queue)
}
}
BLI_INLINE void flush_handle_id_node(IDNode *id_node)
inline void flush_handle_id_node(IDNode *id_node)
{
id_node->custom_flags = ID_STATE_MODIFIED;
}
/* TODO(sergey): We can reduce number of arguments here. */
BLI_INLINE void flush_handle_component_node(IDNode *id_node,
ComponentNode *comp_node,
FlushQueue *queue)
inline void flush_handle_component_node(IDNode *id_node,
ComponentNode *comp_node,
FlushQueue *queue)
{
/* We only handle component once. */
if (comp_node->custom_flags == COMPONENT_STATE_DONE) {
@ -169,7 +169,7 @@ BLI_INLINE void flush_handle_component_node(IDNode *id_node,
* return value, so it can start being handled right away, without building too
* much of a queue.
*/
BLI_INLINE OperationNode *flush_schedule_children(OperationNode *op_node, FlushQueue *queue)
inline OperationNode *flush_schedule_children(OperationNode *op_node, FlushQueue *queue)
{
if (op_node->flag & DEPSOP_FLAG_USER_MODIFIED) {
IDNode *id_node = op_node->owner->owner;

View File

@ -501,7 +501,7 @@ struct FormatDescriptor {
uint amask;
};
static const FormatDescriptor s_d3dFormats[] = {
const FormatDescriptor s_d3dFormats[] = {
{D3DFMT_R8G8B8, 24, 0xFF0000, 0xFF00, 0xFF, 0},
{D3DFMT_A8R8G8B8, 32, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}, /* DXGI_FORMAT_B8G8R8A8_UNORM */
{D3DFMT_X8R8G8B8, 32, 0xFF0000, 0xFF00, 0xFF, 0}, /* DXGI_FORMAT_B8G8R8X8_UNORM */
@ -524,7 +524,7 @@ static const FormatDescriptor s_d3dFormats[] = {
{D3DFMT_L16, 16, 16, 0, 0, 0}, /* DXGI_FORMAT_R16_UNORM */
};
static const uint s_d3dFormatCount = sizeof(s_d3dFormats) / sizeof(s_d3dFormats[0]);
const uint s_d3dFormatCount = sizeof(s_d3dFormats) / sizeof(s_d3dFormats[0]);
} // namespace