mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
c: fix nonscalar type cast warning
This commit is contained in:
parent
72e2fc4c73
commit
497329622a
@ -473,9 +473,14 @@ pub const DeclGen = struct {
|
||||
//
|
||||
// Used for .elem_ptr, .field_ptr, .opt_payload_ptr, .eu_payload_ptr
|
||||
fn renderParentPtr(dg: *DeclGen, writer: anytype, ptr_val: Value, ptr_ty: Type) error{ OutOfMemory, AnalysisFail }!void {
|
||||
try writer.writeByte('(');
|
||||
try dg.renderTypecast(writer, ptr_ty);
|
||||
try writer.writeByte(')');
|
||||
switch (ptr_ty.ptrSize()) {
|
||||
.Slice => {},
|
||||
.Many, .C, .One => {
|
||||
try writer.writeByte('(');
|
||||
try dg.renderTypecast(writer, ptr_ty);
|
||||
try writer.writeByte(')');
|
||||
},
|
||||
}
|
||||
switch (ptr_val.tag()) {
|
||||
.decl_ref_mut, .decl_ref, .variable => {
|
||||
const decl_index = switch (ptr_val.tag()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user