Skip to content

Conversation

@jinzhongjia
Copy link
Member

…asting, unions, and vector operations

  • Implement basic and advanced switch statement examples in switch.zig
  • Introduce type casting examples in type-cast.zig
  • Create union type examples in union.zig
  • Add unit tests for basic functions in unit_test.zig
  • Implement unreachable code demonstration in unreachable.zig
  • Showcase vector operations including basic usage, splatting, reduction, shuffling, and selection in vector.zig

…asting, unions, and vector operations

- Implement basic and advanced switch statement examples in `switch.zig`
- Introduce type casting examples in `type-cast.zig`
- Create union type examples in `union.zig`
- Add unit tests for basic functions in `unit_test.zig`
- Implement unreachable code demonstration in `unreachable.zig`
- Showcase vector operations including basic usage, splatting, reduction, shuffling, and selection in `vector.zig`
@jinzhongjia jinzhongjia changed the title Add various Zig code examples demonstrating switch statements, type c… feat: 修复 master 分支编译错误 Jul 26, 2025
- 增加在线阅读入口及项目结构说明,便于新用户快速了解项目
- 补充本地开发环境要求、快速开始和常用命令,提升开发体验
- 详细完善贡献方式、流程、规范及内容编写指南,鼓励社区参与
- 明确版本兼容性、开发注意事项和许可证信息
- 新增致谢与联系方式,增强社区互动与归属感
- 更新所有 build.zig 文件,使用 .root_module 替代 .root_source_file,适配 Zig 0.15 新构建 API
- 替换 std.fs.File.stdout/stderr().writer 用法为 std.io.getStdOut/getStdErr().writer,修正输出流写法
- 暂时注释掉不兼容 Zig 0.15 的内联汇编代码,并添加 TODO 提示
- 修正 memory_manager.zig 中 c_allocator 拼写及 DebugAllocator 初始化方式
- 修正 echo_tcp_server.zig 中 listen 参数,移除已废弃的 reuse_port
- 修正 package_management_importer/build.zig.zon 文件名错误
- 其他细节调整以保证示例代码在 Zig 0.15 下可编译运行
README.md Outdated
- 使用中文标点符号
- 代码块指定语言类型
- **分支命名**:
- 功能: `feature/功能描述`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [AutoCorrect Lint] <AutoCorrect> reported by reviewdog 🐶

Suggested change
- 功能: `feature/功能描述`
- 功能 `feature/功能描述`

README.md Outdated
- 代码块指定语言类型
- **分支命名**:
- 功能: `feature/功能描述`
- 修复: `fix/问题描述`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [AutoCorrect Lint] <AutoCorrect> reported by reviewdog 🐶

Suggested change
- 修复: `fix/问题描述`
- 修复 `fix/问题描述`

README.md Outdated
- **分支命名**:
- 功能: `feature/功能描述`
- 修复: `fix/问题描述`
- 文档: `docs/文档更新`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [AutoCorrect Lint] <AutoCorrect> reported by reviewdog 🐶

Suggested change
- 文档: `docs/文档更新`
- 文档 `docs/文档更新`

- 全面替换 std.io.getStdOut/getStdErr.writer 为 std.fs.File.stdout/stderr().writer 并增加缓冲区
- 构建脚本统一使用 .root_module = b.createModule 语法,修正 addModule 用法
- 更新 hello_world、build_system、package_management_importer 等示例以适配新 IO API
- 修正 tinytetris、options 等 build.zig 文件的模块创建方式
- 升级 zig-msgpack 依赖至 0.0.8,更新 hash 与 url
- 增加 Windows 下 echo_tcp_server.zig 自动链接 ws2_32 库
- 移除冗余注释,优化代码风格与一致性
- 将 One.main() 调用修改为 try One.main() 以符合错误处理要求
- 调整 hello_world.zig 代码注释与分号后空格,提升可读性
- 统一 README.md 分支命名说明中的中文标点用法
- 修正 build.zig 缩进,使结构更规范
@jinzhongjia jinzhongjia merged commit 981f1a1 into main Jul 31, 2025
35 checks passed
@jinzhongjia jinzhongjia deleted the master_fix branch July 31, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants