Quake 源代码中我无法理解的符号(C)
我在查看 Quake 1 GPL 代码时遇到了各种类似的头文件,但我似乎不明白它们的目的或用途。它们看起来像某种表格,并且结构如下
{1, 0},
{1, -1},
{1, -2},
{1, -3},
{1, -4},
{1, -5},[...]
,前后没有任何内容。我理解它们定义了一些东西,但我从未在 C 中遇到过这种符号。 您可以在此处阅读我引用的头文件之一。
我的问题是:那些……东西是什么? ASM 实际上给我带来的问题比那些东西要少。
I was taking a look at the Quake 1 GPL Code and I came across various similar header files, the purpose or use of which I don't seem to understand. They look like tables of some sorts and are structured like this
{1, 0},
{1, -1},
{1, -2},
{1, -3},
{1, -4},
{1, -5},[...]
Without anything before or after them. I understand they define something but I've never come across this kind of notation in C.
You can read one of the header files I'm referring to here.
My question is: what are those...things? The ASM is actually giving me less problems than that stuff.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这些可能是多用途的。它们可以像这样使用:
These are probably multi-use includes. They can be used like so:
标头的内容不必必须是有效的 C; C 预处理器将在找到
#include
指令的任何位置插入它们,例如在另一个源文件中的结构初始化中间。只要它在实际到达编译器时是有效的 C,那就很重要了。The contents of a header do not have to be valid C; the C preprocessor will insert them wherever the
#include
directive is found, such as in the middle of a struct initialization in another source file. As long as it's valid C by the time it actually gets to the compiler, that's all that matters.它们可用于初始化数组。
你可以像这样使用它们:
They can be used to initialize arrays.
You could use them like this: