make resource ids their own individual types. last commit before overhaul to sub-packages

This commit is contained in:
Andrew Gallant (Ocelot)
2012-05-10 12:47:19 -04:00
parent 00c6217ca9
commit e239bb3c68
35 changed files with 1906 additions and 1685 deletions

View File

@@ -68,9 +68,9 @@ func (e *Error) ImplementsError(c *Context) {
c.Putln("return err.Sequence")
c.Putln("}")
c.Putln("")
c.Putln("func (err %s) BadId() Id {", e.ErrType())
c.Putln("func (err %s) BadId() uint32 {", e.ErrType())
if !c.protocol.isExt() {
c.Putln("return Id(err.BadValue)")
c.Putln("return err.BadValue")
} else {
c.Putln("return 0")
}
@@ -128,8 +128,12 @@ func (e *ErrorCopy) ImplementsError(c *Context) {
c.Putln("return err.Sequence")
c.Putln("}")
c.Putln("")
c.Putln("func (err %s) BadId() Id {", e.ErrType())
c.Putln("return Id(err.BadValue)")
c.Putln("func (err %s) BadId() uint32 {", e.ErrType())
if !c.protocol.isExt() {
c.Putln("return err.BadValue")
} else {
c.Putln("return 0")
}
c.Putln("}")
c.Putln("")
c.Putln("func (err %s) Error() string {", e.ErrType())