Files
zdwm/src/core/command_buffer.c
Zedhugh Chen 2fc4b33359 style: 更新 .clang-format 规则并重新格式化所有源文件
- 重构模块使用新的代码风格
- 老代码 (src 目录下的代码) 继续使用之前的代码风格

通过在需要不同代码风格的目录下放对应 .clang-format 配置文件实现
2026-04-14 01:52:53 +08:00

24 lines
608 B
C

#include "core/command_buffer.h"
#include "base/array.h"
#include "base/memory.h"
#include "core/command.h"
void command_buffer_reset(command_buffer_t *buffer) {
if (!buffer->items || !buffer->capacity) return;
p_clear(buffer->items, buffer->capacity);
buffer->count = 0;
}
void command_buffer_cleanup(command_buffer_t *buffer) {
p_delete(&buffer->items);
buffer->count = 0;
buffer->capacity = 0;
}
void command_buffer_push(command_buffer_t *buffer, const command_t *command) {
command_t *cmd = array_push(buffer->items, buffer->count, buffer->capacity);
*cmd = *command;
}