aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrew <reserveblue@protonmail.com>2021-11-14 22:06:12 -0800
committerAndrew Kelley <andrew@ziglang.org>2021-11-16 16:51:31 -0700
commit3896de307888d598cca1baba8e559debc81d2080 (patch)
treed76a4e20a16d765e4f9d3ed4a920fd89418c1b5a /src
parent0300ec4ef70f524718d01f0f351d41349465387c (diff)
downloadzig-3896de307888d598cca1baba8e559debc81d2080.tar.gz
zig-3896de307888d598cca1baba8e559debc81d2080.zip
simplify things
Diffstat (limited to 'src')
-rw-r--r--src/codegen/c.zig8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index a82fb42625..49cf48cfb0 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -342,12 +342,6 @@ pub const DeclGen = struct {
// to the assigned pointer type. Note this is just a hack to fix warnings from ordered comparisons (<, >, etc)
// between pointers and 0, which is an extension to begin with.
.zero => try writer.writeByte('0'),
- .one => {
- // int constants like 1 will not cast to the pointer however.
- try writer.writeAll("((");
- try dg.renderType(writer, ty);
- return writer.writeAll(")1)");
- },
.decl_ref => {
const decl = val.castTag(.decl_ref).?.data;
return dg.renderDeclValue(writer, ty, val, decl);
@@ -376,7 +370,7 @@ pub const DeclGen = struct {
const decl = val.castTag(.extern_fn).?.data;
try dg.renderDeclName(decl, writer);
},
- .int_u64 => {
+ .int_u64, .one => {
try writer.writeAll("((");
try dg.renderType(writer, ty);
try writer.print(")0x{x}u)", .{val.toUnsignedInt()});