cython: Leave out values of constants and enumerators

Keep them as documentation only
This commit is contained in:
Vadim Petrochenkov 2020-11-27 00:09:14 +03:00 committed by Emilio Cobos Álvarez
parent 1b7976c88e
commit 98b7a3f9b9
57 changed files with 242 additions and 232 deletions

View File

@ -563,11 +563,8 @@ impl Constant {
false
};
if config.language == Language::Cython
|| (config.language == Language::Cxx
&& (config.constant.allow_static_const || allow_constexpr))
{
if config.language == Language::Cxx {
match config.language {
Language::Cxx if config.constant.allow_static_const || allow_constexpr => {
if allow_constexpr {
out.write("constexpr ")
}
@ -581,18 +578,26 @@ impl Constant {
} else {
out.write("const ");
}
} else {
out.write("const ");
}
self.ty.write(config, out);
write!(out, " {} = ", name);
value.write(config, out);
write!(out, ";");
} else {
}
Language::Cxx | Language::C => {
write!(out, "#define {} ", name);
value.write(config, out);
}
Language::Cython => {
out.write("const ");
self.ty.write(config, out);
// For extern Cython declarations the initializer is ignored,
// but still useful as documentation, so we write it as a comment.
write!(out, " {} # = ", name);
value.write(config, out);
}
}
condition.write_after(config, out);
}
}

View File

@ -251,6 +251,11 @@ impl Source for EnumVariant {
self.documentation.write(config, out);
write!(out, "{}", self.export_name);
if let Some(discriminant) = &self.discriminant {
if config.language == Language::Cython {
// For extern Cython declarations the enumerator value is ignored,
// but still useful as documentation, so we write it as a comment.
out.write(" #")
}
out.write(" = ");
discriminant.write(config, out);
}

View File

@ -7,7 +7,7 @@ cdef extern from *:
cdef extern from *:
cdef enum:
X = 2,
X # = 2,
Y,
ctypedef uint32_t C;

View File

@ -7,7 +7,7 @@ cdef extern from *:
cdef extern from *:
cdef enum:
X = 2,
X # = 2,
Y,
ctypedef uint32_t C;

View File

@ -6,4 +6,4 @@ cdef extern from *:
cdef extern from *:
const uint32_t Foo_FOO = 42;
const uint32_t Foo_FOO # = 42

View File

@ -8,7 +8,7 @@ cdef extern from *:
ctypedef struct Foo:
pass
const int32_t Foo_GA = 10;
const float Foo_ZO = 3.14;
const int32_t Foo_GA # = 10
const float Foo_ZO # = 3.14
void root(Foo x);

View File

@ -8,7 +8,7 @@ cdef extern from *:
cdef struct Foo:
pass
const int32_t Foo_GA = 10;
const float Foo_ZO = 3.14;
const int32_t Foo_GA # = 10
const float Foo_ZO # = 3.14
void root(Foo x);

View File

@ -12,14 +12,14 @@ cdef extern from *:
ctypedef struct StyleAlignFlags:
uint8_t bits;
# 'auto'
const StyleAlignFlags StyleAlignFlags_AUTO = <StyleAlignFlags>{ <uint8_t>0 };
const StyleAlignFlags StyleAlignFlags_AUTO # = <StyleAlignFlags>{ <uint8_t>0 }
# 'normal'
const StyleAlignFlags StyleAlignFlags_NORMAL = <StyleAlignFlags>{ <uint8_t>1 };
const StyleAlignFlags StyleAlignFlags_NORMAL # = <StyleAlignFlags>{ <uint8_t>1 }
# 'start'
const StyleAlignFlags StyleAlignFlags_START = <StyleAlignFlags>{ <uint8_t>(1 << 1) };
const StyleAlignFlags StyleAlignFlags_START # = <StyleAlignFlags>{ <uint8_t>(1 << 1) }
# 'end'
const StyleAlignFlags StyleAlignFlags_END = <StyleAlignFlags>{ <uint8_t>(1 << 2) };
const StyleAlignFlags StyleAlignFlags_END # = <StyleAlignFlags>{ <uint8_t>(1 << 2) }
# 'flex-start'
const StyleAlignFlags StyleAlignFlags_FLEX_START = <StyleAlignFlags>{ <uint8_t>(1 << 3) };
const StyleAlignFlags StyleAlignFlags_FLEX_START # = <StyleAlignFlags>{ <uint8_t>(1 << 3) }
void root(StyleAlignFlags flags);

View File

@ -12,14 +12,14 @@ cdef extern from *:
cdef struct StyleAlignFlags:
uint8_t bits;
# 'auto'
const StyleAlignFlags StyleAlignFlags_AUTO = <StyleAlignFlags>{ <uint8_t>0 };
const StyleAlignFlags StyleAlignFlags_AUTO # = <StyleAlignFlags>{ <uint8_t>0 }
# 'normal'
const StyleAlignFlags StyleAlignFlags_NORMAL = <StyleAlignFlags>{ <uint8_t>1 };
const StyleAlignFlags StyleAlignFlags_NORMAL # = <StyleAlignFlags>{ <uint8_t>1 }
# 'start'
const StyleAlignFlags StyleAlignFlags_START = <StyleAlignFlags>{ <uint8_t>(1 << 1) };
const StyleAlignFlags StyleAlignFlags_START # = <StyleAlignFlags>{ <uint8_t>(1 << 1) }
# 'end'
const StyleAlignFlags StyleAlignFlags_END = <StyleAlignFlags>{ <uint8_t>(1 << 2) };
const StyleAlignFlags StyleAlignFlags_END # = <StyleAlignFlags>{ <uint8_t>(1 << 2) }
# 'flex-start'
const StyleAlignFlags StyleAlignFlags_FLEX_START = <StyleAlignFlags>{ <uint8_t>(1 << 3) };
const StyleAlignFlags StyleAlignFlags_FLEX_START # = <StyleAlignFlags>{ <uint8_t>(1 << 3) }
void root(StyleAlignFlags flags);

View File

@ -12,19 +12,19 @@ cdef extern from *:
ctypedef struct AlignFlags:
uint8_t bits;
# 'auto'
const AlignFlags AlignFlags_AUTO = <AlignFlags>{ <uint8_t>0 };
const AlignFlags AlignFlags_AUTO # = <AlignFlags>{ <uint8_t>0 }
# 'normal'
const AlignFlags AlignFlags_NORMAL = <AlignFlags>{ <uint8_t>1 };
const AlignFlags AlignFlags_NORMAL # = <AlignFlags>{ <uint8_t>1 }
# 'start'
const AlignFlags AlignFlags_START = <AlignFlags>{ <uint8_t>(1 << 1) };
const AlignFlags AlignFlags_START # = <AlignFlags>{ <uint8_t>(1 << 1) }
# 'end'
const AlignFlags AlignFlags_END = <AlignFlags>{ <uint8_t>(1 << 2) };
const AlignFlags AlignFlags_END # = <AlignFlags>{ <uint8_t>(1 << 2) }
# 'flex-start'
const AlignFlags AlignFlags_FLEX_START = <AlignFlags>{ <uint8_t>(1 << 3) };
const AlignFlags AlignFlags_FLEX_START # = <AlignFlags>{ <uint8_t>(1 << 3) }
ctypedef struct DebugFlags:
uint32_t bits;
# Flag with the topmost bit set of the u32
const DebugFlags DebugFlags_BIGGEST_ALLOWED = <DebugFlags>{ <uint32_t>(1 << 31) };
const DebugFlags DebugFlags_BIGGEST_ALLOWED # = <DebugFlags>{ <uint32_t>(1 << 31) }
void root(AlignFlags flags, DebugFlags bigger_flags);

View File

@ -12,19 +12,19 @@ cdef extern from *:
cdef struct AlignFlags:
uint8_t bits;
# 'auto'
const AlignFlags AlignFlags_AUTO = <AlignFlags>{ <uint8_t>0 };
const AlignFlags AlignFlags_AUTO # = <AlignFlags>{ <uint8_t>0 }
# 'normal'
const AlignFlags AlignFlags_NORMAL = <AlignFlags>{ <uint8_t>1 };
const AlignFlags AlignFlags_NORMAL # = <AlignFlags>{ <uint8_t>1 }
# 'start'
const AlignFlags AlignFlags_START = <AlignFlags>{ <uint8_t>(1 << 1) };
const AlignFlags AlignFlags_START # = <AlignFlags>{ <uint8_t>(1 << 1) }
# 'end'
const AlignFlags AlignFlags_END = <AlignFlags>{ <uint8_t>(1 << 2) };
const AlignFlags AlignFlags_END # = <AlignFlags>{ <uint8_t>(1 << 2) }
# 'flex-start'
const AlignFlags AlignFlags_FLEX_START = <AlignFlags>{ <uint8_t>(1 << 3) };
const AlignFlags AlignFlags_FLEX_START # = <AlignFlags>{ <uint8_t>(1 << 3) }
cdef struct DebugFlags:
uint32_t bits;
# Flag with the topmost bit set of the u32
const DebugFlags DebugFlags_BIGGEST_ALLOWED = <DebugFlags>{ <uint32_t>(1 << 31) };
const DebugFlags DebugFlags_BIGGEST_ALLOWED # = <DebugFlags>{ <uint32_t>(1 << 31) }
void root(AlignFlags flags, DebugFlags bigger_flags);

View File

@ -13,10 +13,10 @@ cdef extern from *:
cdef extern from *:
IF NOT_DEFINED:
const int32_t DEFAULT_X = 8;
const int32_t DEFAULT_X # = 8
IF DEFINED:
const int32_t DEFAULT_X = 42;
const int32_t DEFAULT_X # = 42
IF (NOT_DEFINED or DEFINED):
ctypedef struct Foo:

View File

@ -13,10 +13,10 @@ cdef extern from *:
cdef extern from *:
IF NOT_DEFINED:
const int32_t DEFAULT_X = 8;
const int32_t DEFAULT_X # = 8
IF DEFINED:
const int32_t DEFAULT_X = 42;
const int32_t DEFAULT_X # = 42
IF (NOT_DEFINED or DEFINED):
cdef struct Foo:

View File

@ -6,4 +6,4 @@ cdef extern from *:
cdef extern from *:
const uint32_t Foo_FOO = 42;
const uint32_t Foo_FOO # = 42

View File

@ -8,4 +8,4 @@ cdef extern from *:
ctypedef uint8_t Transparent;
const Transparent FOO = 0;
const Transparent FOO # = 0

View File

@ -6,46 +6,46 @@ cdef extern from *:
cdef extern from *:
const int32_t FOO = 10;
const int32_t FOO # = 10
const uint32_t DELIMITER = ':';
const uint32_t DELIMITER # = ':'
const uint32_t LEFTCURLY = '{';
const uint32_t LEFTCURLY # = '{'
const uint32_t QUOTE = '\'';
const uint32_t QUOTE # = '\''
const uint32_t TAB = '\t';
const uint32_t TAB # = '\t'
const uint32_t NEWLINE = '\n';
const uint32_t NEWLINE # = '\n'
const uint32_t HEART = U'\U00002764';
const uint32_t HEART # = U'\U00002764'
const uint32_t EQUID = U'\U00010083';
const uint32_t EQUID # = U'\U00010083'
const float ZOM = 3.14;
const float ZOM # = 3.14
# A single-line doc comment.
const int8_t POS_ONE = 1;
const int8_t POS_ONE # = 1
# A
# multi-line
# doc
# comment.
const int8_t NEG_ONE = -1;
const int8_t NEG_ONE # = -1
const int64_t SHIFT = 3;
const int64_t SHIFT # = 3
const int64_t XBOOL = 1;
const int64_t XBOOL # = 1
const int64_t XFALSE1 = ((0 << 3) | 1);
const int64_t XFALSE1 # = ((0 << 3) | 1)
const int64_t XTRUE1 = (1 << (3 | 1));
const int64_t XTRUE1 # = (1 << (3 | 1))
const int64_t XFALSE2 = (0 << SHIFT);
const int64_t XFALSE2 # = (0 << SHIFT)
const uint8_t CAST = <uint8_t>'A';
const uint8_t CAST # = <uint8_t>'A'
const uint32_t DOUBLE_CAST = <uint32_t><float>1;
const uint32_t DOUBLE_CAST # = <uint32_t><float>1
ctypedef struct Foo:
int32_t x[FOO];

View File

@ -6,46 +6,46 @@ cdef extern from *:
cdef extern from *:
const int32_t FOO = 10;
const int32_t FOO # = 10
const uint32_t DELIMITER = ':';
const uint32_t DELIMITER # = ':'
const uint32_t LEFTCURLY = '{';
const uint32_t LEFTCURLY # = '{'
const uint32_t QUOTE = '\'';
const uint32_t QUOTE # = '\''
const uint32_t TAB = '\t';
const uint32_t TAB # = '\t'
const uint32_t NEWLINE = '\n';
const uint32_t NEWLINE # = '\n'
const uint32_t HEART = U'\U00002764';
const uint32_t HEART # = U'\U00002764'
const uint32_t EQUID = U'\U00010083';
const uint32_t EQUID # = U'\U00010083'
const float ZOM = 3.14;
const float ZOM # = 3.14
# A single-line doc comment.
const int8_t POS_ONE = 1;
const int8_t POS_ONE # = 1
# A
# multi-line
# doc
# comment.
const int8_t NEG_ONE = -1;
const int8_t NEG_ONE # = -1
const int64_t SHIFT = 3;
const int64_t SHIFT # = 3
const int64_t XBOOL = 1;
const int64_t XBOOL # = 1
const int64_t XFALSE1 = ((0 << 3) | 1);
const int64_t XFALSE1 # = ((0 << 3) | 1)
const int64_t XTRUE1 = (1 << (3 | 1));
const int64_t XTRUE1 # = (1 << (3 | 1))
const int64_t XFALSE2 = (0 << SHIFT);
const int64_t XFALSE2 # = (0 << SHIFT)
const uint8_t CAST = <uint8_t>'A';
const uint8_t CAST # = <uint8_t>'A'
const uint32_t DOUBLE_CAST = <uint32_t><float>1;
const uint32_t DOUBLE_CAST # = <uint32_t><float>1
cdef struct Foo:
int32_t x[FOO];

View File

@ -6,10 +6,10 @@ cdef extern from *:
cdef extern from *:
const uint64_t UNSIGNED_NEEDS_ULL_SUFFIX = 9223372036854775808ULL;
const uint64_t UNSIGNED_NEEDS_ULL_SUFFIX # = 9223372036854775808ULL
const uint64_t UNSIGNED_DOESNT_NEED_ULL_SUFFIX = 8070450532247928832;
const uint64_t UNSIGNED_DOESNT_NEED_ULL_SUFFIX # = 8070450532247928832
const int64_t SIGNED_NEEDS_ULL_SUFFIX = -9223372036854775808ULL;
const int64_t SIGNED_NEEDS_ULL_SUFFIX # = -9223372036854775808ULL
const int64_t SIGNED_DOESNT_NEED_ULL_SUFFIX = -9223372036854775807;
const int64_t SIGNED_DOESNT_NEED_ULL_SUFFIX # = -9223372036854775807

View File

@ -6,16 +6,16 @@ cdef extern from *:
cdef extern from *:
const int64_t CONSTANT_I64 = 216;
const int64_t CONSTANT_I64 # = 216
const float CONSTANT_FLOAT32 = 312.292;
const float CONSTANT_FLOAT32 # = 312.292
const uint32_t DELIMITER = ':';
const uint32_t DELIMITER # = ':'
const uint32_t LEFTCURLY = '{';
const uint32_t LEFTCURLY # = '{'
ctypedef struct Foo:
int32_t x;
const int64_t Foo_CONSTANT_I64_BODY = 216;
const int64_t Foo_CONSTANT_I64_BODY # = 216
const Foo SomeFoo = <Foo>{ 99 };
const Foo SomeFoo # = <Foo>{ 99 }

View File

@ -6,16 +6,16 @@ cdef extern from *:
cdef extern from *:
const int64_t CONSTANT_I64 = 216;
const int64_t CONSTANT_I64 # = 216
const float CONSTANT_FLOAT32 = 312.292;
const float CONSTANT_FLOAT32 # = 312.292
const uint32_t DELIMITER = ':';
const uint32_t DELIMITER # = ':'
const uint32_t LEFTCURLY = '{';
const uint32_t LEFTCURLY # = '{'
cdef struct Foo:
int32_t x;
const int64_t Foo_CONSTANT_I64_BODY = 216;
const int64_t Foo_CONSTANT_I64_BODY # = 216
const Foo SomeFoo = <Foo>{ 99 };
const Foo SomeFoo # = <Foo>{ 99 }

View File

@ -6,9 +6,9 @@ cdef extern from *:
cdef extern from *:
const uint8_t A = 0;
const uint8_t A # = 0
const uint8_t B = 0;
const uint8_t B # = 0
extern const uint8_t C;

View File

@ -6,9 +6,9 @@ cdef extern from *:
cdef extern from *:
const uint8_t B = 0;
const uint8_t B # = 0
const uint8_t A = 0;
const uint8_t A # = 0
extern const uint8_t D;

View File

@ -14,8 +14,8 @@ cdef extern from *:
ctypedef uint8_t A;
const S C1 = <S>{ 0 };
const S C1 # = <S>{ 0 }
const E C2 = V;
const E C2 # = V
const A C3 = 0;
const A C3 # = 0

View File

@ -14,8 +14,8 @@ cdef extern from *:
ctypedef uint8_t A;
const S C1 = <S>{ 0 };
const S C1 # = <S>{ 0 }
const E C2 = V;
const E C2 # = V
const A C3 = 0;
const A C3 # = 0

View File

@ -7,7 +7,7 @@ cdef extern from *:
cdef extern from *:
cdef enum:
X = 2,
X # = 2,
Y,
ctypedef uint32_t C;

View File

@ -7,7 +7,7 @@ cdef extern from *:
cdef extern from *:
cdef enum:
X = 2,
X # = 2,
Y,
ctypedef uint32_t C;

View File

@ -7,45 +7,45 @@ cdef extern from *:
cdef extern from *:
cdef enum:
a1 = 0,
a2 = 2,
a1 # = 0,
a2 # = 2,
a3,
a4 = 5,
a4 # = 5,
ctypedef uint64_t A;
cdef enum:
b1 = 0,
b2 = 2,
b1 # = 0,
b2 # = 2,
b3,
b4 = 5,
b4 # = 5,
ctypedef uint32_t B;
cdef enum:
c1 = 0,
c2 = 2,
c1 # = 0,
c2 # = 2,
c3,
c4 = 5,
c4 # = 5,
ctypedef uint16_t C;
cdef enum:
d1 = 0,
d2 = 2,
d1 # = 0,
d2 # = 2,
d3,
d4 = 5,
d4 # = 5,
ctypedef uint8_t D;
cdef enum:
e1 = 0,
e2 = 2,
e1 # = 0,
e2 # = 2,
e3,
e4 = 5,
e4 # = 5,
ctypedef uintptr_t E;
cdef enum:
f1 = 0,
f2 = 2,
f1 # = 0,
f2 # = 2,
f3,
f4 = 5,
f4 # = 5,
ctypedef intptr_t F;
ctypedef enum L:
@ -55,9 +55,9 @@ cdef extern from *:
l4,
cdef enum:
m1 = -1,
m2 = 0,
m3 = 1,
m1 # = -1,
m2 # = 0,
m3 # = 1,
ctypedef int8_t M;
ctypedef enum N:

View File

@ -7,45 +7,45 @@ cdef extern from *:
cdef extern from *:
cdef enum:
a1 = 0,
a2 = 2,
a1 # = 0,
a2 # = 2,
a3,
a4 = 5,
a4 # = 5,
ctypedef uint64_t A;
cdef enum:
b1 = 0,
b2 = 2,
b1 # = 0,
b2 # = 2,
b3,
b4 = 5,
b4 # = 5,
ctypedef uint32_t B;
cdef enum:
c1 = 0,
c2 = 2,
c1 # = 0,
c2 # = 2,
c3,
c4 = 5,
c4 # = 5,
ctypedef uint16_t C;
cdef enum:
d1 = 0,
d2 = 2,
d1 # = 0,
d2 # = 2,
d3,
d4 = 5,
d4 # = 5,
ctypedef uint8_t D;
cdef enum:
e1 = 0,
e2 = 2,
e1 # = 0,
e2 # = 2,
e3,
e4 = 5,
e4 # = 5,
ctypedef uintptr_t E;
cdef enum:
f1 = 0,
f2 = 2,
f1 # = 0,
f2 # = 2,
f3,
f4 = 5,
f4 # = 5,
ctypedef intptr_t F;
cdef enum L:
@ -55,9 +55,9 @@ cdef extern from *:
l4,
cdef enum:
m1 = -1,
m2 = 0,
m3 = 1,
m1 # = -1,
m2 # = 0,
m3 # = 1,
ctypedef int8_t M;
cdef enum N:

View File

@ -6,16 +6,16 @@ cdef extern from *:
cdef extern from *:
const int8_t FOUR = 4;
const int8_t FOUR # = 4
cdef enum:
A = 1,
B = -1,
C = (1 + 2),
D = FOUR,
F = 5,
G = <int8_t>54,
H = <int8_t>False,
A # = 1,
B # = -1,
C # = (1 + 2),
D # = FOUR,
F # = 5,
G # = <int8_t>54,
H # = <int8_t>False,
ctypedef int8_t E;
void root(const E*);

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const uint8_t EXPORT_ME_TOO = 42;
const uint8_t EXPORT_ME_TOO # = 42
ctypedef struct ExportMe:
uint64_t val;

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const uint8_t EXPORT_ME_TOO = 42;
const uint8_t EXPORT_ME_TOO # = 42
cdef struct ExportMe:
uint64_t val;

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const uint8_t EXPORT_ME_TOO = 42;
const uint8_t EXPORT_ME_TOO # = 42
ctypedef struct ExportMe:
uint64_t val;

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const uint8_t EXPORT_ME_TOO = 42;
const uint8_t EXPORT_ME_TOO # = 42
cdef struct ExportMe:
uint64_t val;

View File

@ -13,10 +13,10 @@ cdef extern from *:
cdef extern from *:
IF FOO:
const int32_t FOO = 1;
const int32_t FOO # = 1
IF BAR:
const int32_t BAR = 2;
const int32_t BAR # = 2
IF FOO:
ctypedef struct Foo:

View File

@ -13,10 +13,10 @@ cdef extern from *:
cdef extern from *:
IF FOO:
const int32_t FOO = 1;
const int32_t FOO # = 1
IF BAR:
const int32_t BAR = 2;
const int32_t BAR # = 2
IF FOO:
cdef struct Foo:

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const uint8_t EXPORT_ME_TOO = 42;
const uint8_t EXPORT_ME_TOO # = 42
ctypedef struct ExportMe:
uint64_t val;

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const uint8_t EXPORT_ME_TOO = 42;
const uint8_t EXPORT_ME_TOO # = 42
cdef struct ExportMe:
uint64_t val;

View File

@ -6,9 +6,9 @@ cdef extern from *:
cdef extern from *:
const int32_t FOO = 10;
const int32_t FOO # = 10
const float ZOM = 3.14;
const float ZOM # = 3.14
ctypedef struct Foo:
int32_t x[FOO];

View File

@ -6,9 +6,9 @@ cdef extern from *:
cdef extern from *:
const int32_t FOO = 10;
const int32_t FOO # = 10
const float ZOM = 3.14;
const float ZOM # = 3.14
cdef struct Foo:
int32_t x[FOO];

View File

@ -6,9 +6,9 @@ cdef extern from *:
cdef extern from *:
const int32_t FOO = 10;
const int32_t FOO # = 10
const float ZOM = 3.14;
const float ZOM # = 3.14
ctypedef struct Foo:
int32_t x[FOO];

View File

@ -6,9 +6,9 @@ cdef extern from *:
cdef extern from *:
const int32_t FOO = 10;
const int32_t FOO # = 10
const float ZOM = 3.14;
const float ZOM # = 3.14
cdef struct Foo:
int32_t x[FOO];

View File

@ -6,13 +6,13 @@ cdef extern from *:
cdef extern from *:
const int32_t PREFIX_LEN = 22;
const int32_t PREFIX_LEN # = 22
const int64_t PREFIX_X = (22 << 22);
const int64_t PREFIX_X # = (22 << 22)
const int64_t PREFIX_Y1 = ((22 << 22) + (22 << 22));
const int64_t PREFIX_Y1 # = ((22 << 22) + (22 << 22))
const int64_t PREFIX_Y2 = PREFIX_X;
const int64_t PREFIX_Y2 # = PREFIX_X
ctypedef int32_t PREFIX_NamedLenArray[PREFIX_LEN];

View File

@ -6,13 +6,13 @@ cdef extern from *:
cdef extern from *:
const int32_t PREFIX_LEN = 22;
const int32_t PREFIX_LEN # = 22
const int64_t PREFIX_X = (22 << 22);
const int64_t PREFIX_X # = (22 << 22)
const int64_t PREFIX_Y1 = ((22 << 22) + (22 << 22));
const int64_t PREFIX_Y1 # = ((22 << 22) + (22 << 22))
const int64_t PREFIX_Y2 = PREFIX_X;
const int64_t PREFIX_Y2 # = PREFIX_X
ctypedef int32_t PREFIX_NamedLenArray[PREFIX_LEN];

View File

@ -9,8 +9,8 @@ cdef extern from *:
ctypedef struct PREFIXFoo:
int32_t a;
uint32_t b;
const PREFIXFoo PREFIXFoo_FOO = <PREFIXFoo>{ 42, 47 };
const PREFIXFoo PREFIXFoo_FOO # = <PREFIXFoo>{ 42, 47 }
const PREFIXFoo PREFIXBAR = <PREFIXFoo>{ 42, 1337 };
const PREFIXFoo PREFIXBAR # = <PREFIXFoo>{ 42, 1337 }
void root(PREFIXFoo x);

View File

@ -9,8 +9,8 @@ cdef extern from *:
cdef struct PREFIXFoo:
int32_t a;
uint32_t b;
const PREFIXFoo PREFIXFoo_FOO = <PREFIXFoo>{ 42, 47 };
const PREFIXFoo PREFIXFoo_FOO # = <PREFIXFoo>{ 42, 47 }
const PREFIXFoo PREFIXBAR = <PREFIXFoo>{ 42, 1337 };
const PREFIXFoo PREFIXBAR # = <PREFIXFoo>{ 42, 1337 }
void root(PREFIXFoo x);

View File

@ -14,6 +14,6 @@ cdef extern from *:
uint32_t b;
PREFIXBar bar;
const PREFIXFoo PREFIXVAL = <PREFIXFoo>{ 42, 1337, <PREFIXBar>{ 323 } };
const PREFIXFoo PREFIXVAL # = <PREFIXFoo>{ 42, 1337, <PREFIXBar>{ 323 } }
void root(PREFIXFoo x);

View File

@ -14,6 +14,6 @@ cdef extern from *:
uint32_t b;
PREFIXBar bar;
const PREFIXFoo PREFIXVAL = <PREFIXFoo>{ 42, 1337, <PREFIXBar>{ 323 } };
const PREFIXFoo PREFIXVAL # = <PREFIXFoo>{ 42, 1337, <PREFIXBar>{ 323 } }
void root(PREFIXFoo x);

View File

@ -6,11 +6,11 @@ cdef extern from *:
cdef extern from *:
const int32_t C_H = 10;
const int32_t C_H # = 10
cdef enum:
x = 0,
y = 1,
x # = 0,
y # = 1,
ctypedef uint8_t C_E;
ctypedef struct C_A:
@ -29,7 +29,7 @@ cdef extern from *:
ctypedef C_A C_F;
const intptr_t C_I = <intptr_t><C_F*>10;
const intptr_t C_I # = <intptr_t><C_F*>10
extern const int32_t G;

View File

@ -6,11 +6,11 @@ cdef extern from *:
cdef extern from *:
const int32_t C_H = 10;
const int32_t C_H # = 10
cdef enum:
x = 0,
y = 1,
x # = 0,
y # = 1,
ctypedef uint8_t C_E;
cdef struct C_A:
@ -29,7 +29,7 @@ cdef extern from *:
ctypedef C_A C_F;
const intptr_t C_I = <intptr_t><C_F*>10;
const intptr_t C_I # = <intptr_t><C_F*>10
extern const int32_t G;

View File

@ -12,12 +12,12 @@ cdef extern from *:
ctypedef struct Foo:
int32_t a;
uint32_t b;
const Foo Foo_FOO = <Foo>{ 42, 47 };
const Foo Foo_FOO2 = <Foo>{ 42, 47 };
const Foo Foo_FOO3 = <Foo>{ 42, 47 };
const Foo Foo_FOO # = <Foo>{ 42, 47 }
const Foo Foo_FOO2 # = <Foo>{ 42, 47 }
const Foo Foo_FOO3 # = <Foo>{ 42, 47 }
const Foo BAR = <Foo>{ 42, 1337 };
const Foo BAR # = <Foo>{ 42, 1337 }

View File

@ -12,12 +12,12 @@ cdef extern from *:
cdef struct Foo:
int32_t a;
uint32_t b;
const Foo Foo_FOO = <Foo>{ 42, 47 };
const Foo Foo_FOO2 = <Foo>{ 42, 47 };
const Foo Foo_FOO3 = <Foo>{ 42, 47 };
const Foo Foo_FOO # = <Foo>{ 42, 47 }
const Foo Foo_FOO2 # = <Foo>{ 42, 47 }
const Foo Foo_FOO3 # = <Foo>{ 42, 47 }
const Foo BAR = <Foo>{ 42, 1337 };
const Foo BAR # = <Foo>{ 42, 1337 }

View File

@ -10,16 +10,16 @@ cdef extern from *:
float a;
uint32_t b;
uint32_t c;
const ABC ABC_abc = <ABC>{ 1.0, 2, 3 };
const ABC ABC_bac = <ABC>{ 1.0, 2, 3 };
const ABC ABC_cba = <ABC>{ 1.0, 2, 3 };
const ABC ABC_abc # = <ABC>{ 1.0, 2, 3 }
const ABC ABC_bac # = <ABC>{ 1.0, 2, 3 }
const ABC ABC_cba # = <ABC>{ 1.0, 2, 3 }
ctypedef struct BAC:
uint32_t b;
float a;
int32_t c;
const BAC BAC_abc = <BAC>{ 1, 2.0, 3 };
const BAC BAC_bac = <BAC>{ 1, 2.0, 3 };
const BAC BAC_cba = <BAC>{ 1, 2.0, 3 };
const BAC BAC_abc # = <BAC>{ 1, 2.0, 3 }
const BAC BAC_bac # = <BAC>{ 1, 2.0, 3 }
const BAC BAC_cba # = <BAC>{ 1, 2.0, 3 }
void root(ABC a1, BAC a2);

View File

@ -10,16 +10,16 @@ cdef extern from *:
float a;
uint32_t b;
uint32_t c;
const ABC ABC_abc = <ABC>{ 1.0, 2, 3 };
const ABC ABC_bac = <ABC>{ 1.0, 2, 3 };
const ABC ABC_cba = <ABC>{ 1.0, 2, 3 };
const ABC ABC_abc # = <ABC>{ 1.0, 2, 3 }
const ABC ABC_bac # = <ABC>{ 1.0, 2, 3 }
const ABC ABC_cba # = <ABC>{ 1.0, 2, 3 }
cdef struct BAC:
uint32_t b;
float a;
int32_t c;
const BAC BAC_abc = <BAC>{ 1, 2.0, 3 };
const BAC BAC_bac = <BAC>{ 1, 2.0, 3 };
const BAC BAC_cba = <BAC>{ 1, 2.0, 3 };
const BAC BAC_abc # = <BAC>{ 1, 2.0, 3 }
const BAC BAC_bac # = <BAC>{ 1, 2.0, 3 }
const BAC BAC_cba # = <BAC>{ 1, 2.0, 3 }
void root(ABC a1, BAC a2);

View File

@ -25,10 +25,10 @@ cdef extern from *:
ctypedef uint32_t TransparentPrimitiveWrapper_i32;
ctypedef uint32_t TransparentPrimitiveWithAssociatedConstants;
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ZERO = 0;
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ONE = 1;
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ZERO # = 0
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ONE # = 1
const TransparentPrimitiveWrappingStructure EnumWithAssociatedConstantInImpl_TEN = 10;
const TransparentPrimitiveWrappingStructure EnumWithAssociatedConstantInImpl_TEN # = 10
void root(TransparentComplexWrappingStructTuple a,
TransparentPrimitiveWrappingStructTuple b,

View File

@ -25,10 +25,10 @@ cdef extern from *:
ctypedef uint32_t TransparentPrimitiveWrapper_i32;
ctypedef uint32_t TransparentPrimitiveWithAssociatedConstants;
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ZERO = 0;
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ONE = 1;
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ZERO # = 0
const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ONE # = 1
const TransparentPrimitiveWrappingStructure EnumWithAssociatedConstantInImpl_TEN = 10;
const TransparentPrimitiveWrappingStructure EnumWithAssociatedConstantInImpl_TEN # = 10
void root(TransparentComplexWrappingStructTuple a,
TransparentPrimitiveWrappingStructTuple b,

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const int32_t EXT_CONST = 0;
const int32_t EXT_CONST # = 0
ctypedef struct ExtType:
uint32_t data;

View File

@ -6,7 +6,7 @@ cdef extern from *:
cdef extern from *:
const int32_t EXT_CONST = 0;
const int32_t EXT_CONST # = 0
cdef struct ExtType:
uint32_t data;