改了一下文件结构,顺便开始规划数据格式

This commit is contained in:
沈瑗杰 2022-04-30 10:03:26 +08:00
parent 380a5bc7b7
commit 7097dd6dcf
23 changed files with 48 additions and 0 deletions

4
.gitignore vendored
View File

@ -6,6 +6,10 @@ DR.code-workspace
# PYCharm file # PYCharm file
.idea/ .idea/
# C .so .dll
*.so
*.dll
# log files # log files
logs/ logs/

14
test/data.jl Normal file
View File

@ -0,0 +1,14 @@
struct a_part
part_type :: String
part_id :: UInt64
enable :: Bool
x :: Float64
y :: Float64
x_v :: Float64
y_v :: Float64
angle :: Float16
angle_v :: Float64
end

30
try/c/data_types.c Normal file
View File

@ -0,0 +1,30 @@
#include<stdio.h>
#include<stdlib.h>
// DR data types
// 一些用于直观感受类型字节长度的数据类型
// 看着舒服而已(
#define int8 char
#define int16 short
#define int32 int
#define int64 long long
#define uint8 unsigned char
#define uint16 unsigned short
#define uint32 unsigned int
#define uint64 unsigned long long
#define float32 float
#define float64 double
struct part
{
/* 一个 part 的数据格式 */
long double a;
uint16 b;
};
int main(){
long double a = 1.0;
// 输出 a 的字节长度
printf("%o\n", sizeof(long double));
}