authorgravatar for reserveblue@protonmail.comdrew <reserveblue@protonmail.com> 2021-11-14 22:06:12-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-16 16:51:31-07:00
log3896de307888d598cca1baba8e559debc81d2080
treed76a4e20a16d765e4f9d3ed4a920fd89418c1b5a
parent0300ec4ef70f524718d01f0f351d41349465387c

simplify things


1 files changed, 1 insertions(+), 7 deletions(-)

src/codegen/c.zig+1-7
......@@ -342,12 +342,6 @@ pub const DeclGen = struct {
342342 // to the assigned pointer type. Note this is just a hack to fix warnings from ordered comparisons (<, >, etc)
343343 // between pointers and 0, which is an extension to begin with.
344344 .zero => try writer.writeByte('0'),
345 .one => {
346 // int constants like 1 will not cast to the pointer however.
347 try writer.writeAll("((");
348 try dg.renderType(writer, ty);
349 return writer.writeAll(")1)");
350 },
351345 .decl_ref => {
352346 const decl = val.castTag(.decl_ref).?.data;
353347 return dg.renderDeclValue(writer, ty, val, decl);
......@@ -376,7 +370,7 @@ pub const DeclGen = struct {
376370 const decl = val.castTag(.extern_fn).?.data;
377371 try dg.renderDeclName(decl, writer);
378372 },
379 .int_u64 => {
373 .int_u64, .one => {
380374 try writer.writeAll("((");
381375 try dg.renderType(writer, ty);
382376 try writer.print(")0x{x}u)", .{val.toUnsignedInt()});