| ... | ... | @@ -403,22 +403,26 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E |
| 403 | 403 | |
| 404 | 404 | switch (fn_type.getTypeClass()) { |
| 405 | 405 | .Attributed => { |
| 406 | | const attr_type = @as(*const clang.AttributedType, @ptrCast(fn_type)); |
| 406 | const attr_type: *const clang.AttributedType = @ptrCast(fn_type); |
| 407 | 407 | fn_qt = attr_type.getEquivalentType(); |
| 408 | 408 | }, |
| 409 | 409 | .Paren => { |
| 410 | | const paren_type = @as(*const clang.ParenType, @ptrCast(fn_type)); |
| 410 | const paren_type: *const clang.ParenType = @ptrCast(fn_type); |
| 411 | 411 | fn_qt = paren_type.getInnerType(); |
| 412 | 412 | }, |
| 413 | .MacroQualified => { |
| 414 | const macroqualified_ty: *const clang.MacroQualifiedType = @ptrCast(fn_type); |
| 415 | fn_qt = macroqualified_ty.getModifiedType(); |
| 416 | }, |
| 413 | 417 | else => break fn_type, |
| 414 | 418 | } |
| 415 | 419 | }; |
| 416 | | const fn_ty = @as(*const clang.FunctionType, @ptrCast(fn_type)); |
| 420 | const fn_ty: *const clang.FunctionType = @ptrCast(fn_type); |
| 417 | 421 | const return_qt = fn_ty.getReturnType(); |
| 418 | 422 | |
| 419 | 423 | const proto_node = switch (fn_type.getTypeClass()) { |
| 420 | 424 | .FunctionProto => blk: { |
| 421 | | const fn_proto_type = @as(*const clang.FunctionProtoType, @ptrCast(fn_type)); |
| 425 | const fn_proto_type: *const clang.FunctionProtoType = @ptrCast(fn_type); |
| 422 | 426 | if (has_body and fn_proto_type.isVariadic()) { |
| 423 | 427 | decl_ctx.has_body = false; |
| 424 | 428 | decl_ctx.storage_class = .Extern; |
| ... | ... | @@ -434,7 +438,7 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E |
| 434 | 438 | }; |
| 435 | 439 | }, |
| 436 | 440 | .FunctionNoProto => blk: { |
| 437 | | const fn_no_proto_type = @as(*const clang.FunctionType, @ptrCast(fn_type)); |
| 441 | const fn_no_proto_type: *const clang.FunctionType = @ptrCast(fn_type); |
| 438 | 442 | break :blk transFnNoProto(c, fn_no_proto_type, fn_decl_loc, decl_ctx, true) catch |err| switch (err) { |
| 439 | 443 | error.UnsupportedType => { |
| 440 | 444 | return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); |
| ... | ... | @@ -490,7 +494,7 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E |
| 490 | 494 | param_id += 1; |
| 491 | 495 | } |
| 492 | 496 | |
| 493 | | const casted_body = @as(*const clang.CompoundStmt, @ptrCast(body_stmt)); |
| 497 | const casted_body: *const clang.CompoundStmt = @ptrCast(body_stmt); |
| 494 | 498 | transCompoundStmtInline(c, casted_body, &block_scope) catch |err| switch (err) { |
| 495 | 499 | error.OutOfMemory => |e| return e, |
| 496 | 500 | error.UnsupportedTranslation, |