enhanced the compiler to handle default initial values for instance variables and class variables

This commit is contained in:
hyunghwan.chung
2017-04-24 04:26:03 +00:00
parent 4656bf128e
commit 5bf8d20a93
5 changed files with 109 additions and 69 deletions

View File

@ -99,7 +99,15 @@ class(#pointer) Process(Object)
class Semaphore(Object)
{
var count, waiting_head, waiting_tail, heapIndex, fireTimeSec, fireTimeNsec, ioIndex, ioData, ioMask.
var count := 0,
waiting_head := nil,
waiting_tail := nil,
heapIndex := -1,
fireTimeSec := 0,
fireTimeNsec := 0,
ioIndex := -1,
ioData := nil,
ioMask := 0.
method(#class) forMutualExclusion
{
@ -109,19 +117,6 @@ class Semaphore(Object)
^sem
}
method initialize
{
self.count := 0.
self.heapIndex := -1.
self.fireTimeSec := 0.
self.fireTimeNsec := 0.
self.ioIndex := -1.
self.ioData := nil.
self.ioMask := 0.
}
## ==================================================================
method(#primitive) signal.

View File

@ -35,16 +35,8 @@ class X11.Exception(System.Exception)
class X11.Rectangle(Object)
{
var x, y, width, height.
var x := 0, y := 0, width := 0, height := 0.
method initialize
{
self.x := 0.
self.y := 0.
self.width := 0.
self.height := 0.
}
method x { ^self.x }
method y { ^self.y }
method width { ^self.width }
@ -178,7 +170,7 @@ class X11.ExposeEvent(X11.Event)
pooldic X11.GCAttr
{
(* see xcb/xproto.h *)
GC_FOREGROUND := 4.
GC_FOREGROUND := 4.
GC_BACKGROUND := 8.
GC_LINE_WIDTH := 16.
GC_LINE_STYLE := 32.