Mercurial > projects > ddmd
comparison dmd/FuncDeclaration.d @ 175:94b6033c07f3
get rid of globals
malloc -> GC.malloc
author | korDen |
---|---|
date | Sun, 10 Oct 2010 03:48:06 +0400 |
parents | af724d3510d7 |
children | fa9a71a9f5a8 |
comparison
equal
deleted
inserted
replaced
174:af724d3510d7 | 175:94b6033c07f3 |
---|---|
123 | 123 |
124 import dmd.interpret.Util; | 124 import dmd.interpret.Util; |
125 | 125 |
126 import std.string; | 126 import std.string; |
127 | 127 |
128 __gshared static int hiddenparami; // how many we've generated so far | |
129 | |
128 class FuncDeclaration : Declaration | 130 class FuncDeclaration : Declaration |
129 { | 131 { |
130 Array fthrows; // Array of Type's of exceptions (not used) | 132 Array fthrows; // Array of Type's of exceptions (not used) |
131 Statement frequire; | 133 Statement frequire; |
132 Statement fensure; | 134 Statement fensure; |
3407 { | 3409 { |
3408 // If function returns a struct, put a pointer to that | 3410 // If function returns a struct, put a pointer to that |
3409 // as the first argument | 3411 // as the first argument |
3410 .type* thidden = tf.next.pointerTo().toCtype(); | 3412 .type* thidden = tf.next.pointerTo().toCtype(); |
3411 char hiddenparam[5+4+1]; | 3413 char hiddenparam[5+4+1]; |
3412 static int hiddenparami; // how many we've generated so far | |
3413 | |
3414 sprintf(hiddenparam.ptr, "__HID%d".ptr, ++hiddenparami); | 3414 sprintf(hiddenparam.ptr, "__HID%d".ptr, ++hiddenparami); |
3415 shidden = symbol_name(hiddenparam.ptr, SC.SCparameter, thidden); | 3415 shidden = symbol_name(hiddenparam.ptr, SC.SCparameter, thidden); |
3416 shidden.Sflags |= SFL.SFLtrue | SFL.SFLfree; | 3416 shidden.Sflags |= SFL.SFLtrue | SFL.SFLfree; |
3417 | 3417 |
3418 version (DMDV1) { | 3418 version (DMDV1) { |