- 重构模块使用新的代码风格 - 老代码 (src 目录下的代码) 继续使用之前的代码风格 通过在需要不同代码风格的目录下放对应 .clang-format 配置文件实现
23 lines
494 B
C
23 lines
494 B
C
#include "core/plan.h"
|
|
|
|
#include "base/array.h"
|
|
#include "base/memory.h"
|
|
|
|
void plan_reset(plan_t *plan) {
|
|
if (!plan->effects || !plan->capacity) return;
|
|
|
|
p_clear(plan->effects, plan->capacity);
|
|
plan->count = 0;
|
|
}
|
|
|
|
void plan_cleanup(plan_t *plan) {
|
|
p_delete(&plan->effects);
|
|
plan->count = 0;
|
|
plan->capacity = 0;
|
|
}
|
|
|
|
void plan_push_effect(plan_t *plan, const effect_t *effect) {
|
|
effect_t *eft = array_push(plan->effects, plan->count, plan->capacity);
|
|
*eft = *effect;
|
|
}
|