Permalink
Browse files

Runs go fmt over the source tree.

  • Loading branch information...
1 parent 298880c commit a34c3dcfb5a3ffdf32cc040cb7315f1f50edeead @jteeuwen committed May 10, 2013
Showing with 28 additions and 28 deletions.
  1. +1 −1 archive/read.go
  2. +1 −1 archive/write.go
  3. +1 −1 asm/archive.go
  4. +1 −1 asm/doc.go
  5. +3 −3 asm/func.go
  6. +1 −1 asm/refs.go
  7. +2 −2 cpu/cpu.go
  8. +5 −5 cpu/opcode.go
  9. +1 −1 dcpu-emu/build.go
  10. +2 −2 dcpu-emu/lem1802.go
  11. +2 −2 dcpu-emu/lem1802/font.go
  12. +5 −5 dcpu-emu/sped3/vertex.go
  13. +1 −1 dcpu-link/archive.go
  14. +1 −1 dcpu-list/doc.go
  15. +1 −1 parser/ast.go
View
@@ -11,7 +11,7 @@ import (
// These are simple wrappers for binary.Read calls targeting
// specific data types. They panic on error. The error is caught at the
// top level Read method. We do this to get rid of a lot of
-// obtuse error handling boilerplate, while still allowing us to
+// obtuse error handling boilerplate, while still allowing us to
// accurately report errors when they occur.
func read(r io.Reader, p []byte) {
View
@@ -11,7 +11,7 @@ import (
// These are simple wrappers for binary.Write calls targeting
// specific data types. They panic on error. The error is caught at the
// top level Write method. We do this to get rid of a lot of
-// obtuse error handling boilerplate, while still allowing us to
+// obtuse error handling boilerplate, while still allowing us to
// accurately report errors when they occur.
func write(w io.Writer, p []byte) {
View
@@ -23,7 +23,7 @@ func (a *assembler) getArchive(importpath string) *archive.Archive {
return ar
}
-// readArchive reads the given archive file if possible.
+// readArchive reads the given archive file if possible.
func readArchive(path string) (ar *archive.Archive, err error) {
fd, err := os.Open(path)
if err != nil {
View
@@ -2,7 +2,7 @@
// Its contents can be found in the enclosed LICENSE file.
// This package compiles an AST into a package archive.
-//
+//
// It resolves package dependencies and ensures they are all built in
// the correct order if necessary
package asm
View
@@ -17,7 +17,7 @@ import (
// be preserved across function calls, then we explicitly inject stack
// push/pop instructions to save/restore their state.
//
-// If there are any `return` instructions, we replace them with `set pc, $$`.
+// If there are any `return` instructions, we replace them with `set pc, $$`.
// Where `$$` is a label we generate which points to the function epilog.
func (a *assembler) parseFunctions() bool {
for _, f := range a.ast.Functions {
@@ -100,7 +100,7 @@ func isConstantRef(consts []*parser.Constant, name string) bool {
// set pc, $main_loop
// }
//
-// The '$' character is used here to create a unique label. The language
+// The '$' character is used here to create a unique label. The language
// grammar does not allow for '$' to be part of an identifier. This means a
// user can never create a label with this exact name, leaving us free to use
// it here, as we are long past the lexing stage.
@@ -242,7 +242,7 @@ func (a *assembler) injectFunctionCode(f *parser.Function) {
// findProtectedRegisters recursively finds references to protected registers.
// But only those which are at the target side of the operation. The other
// ones are read-only and will thus not require their states to be saved on
-// the stack.
+// the stack.
func findProtectedRegisters(node []parser.Node, regs *[]string) {
for _, node := range node {
switch node := node.(type) {
View
@@ -14,7 +14,7 @@ import (
// Checks if the are known by now and replaces their placeholder address
// with the real deal. If the label still does not exist, it yields the
// appropriate errors.
-//
+//
// A successful find also emits a Reference entry to the archive. The linker
// will need it to create correct address offsets once multiple packages are
// merged.
View
@@ -199,7 +199,7 @@ func (c *CPU) Step() error {
// Handle any queued interrupts.
// The way this is handled, is not entirely as defined in
// the spec. We can only handle one interrupt per clock cycle.
- //
+ //
// However, this implementation allows one queued interrupt,
// as well as at least one non-queued interrupt to be triggered
// in a single cycle. Notably when we are about to execute
@@ -424,7 +424,7 @@ func (c *CPU) Step() error {
}
// decodeOperand interprets the given instruction operand and returns a pointer
-// to the appropriate storage bit along with its address.
+// to the appropriate storage bit along with its address.
//
// isTarget deterines if this operand is the write target.
// This is necessary to properly decode the PUSH/POP operands (0x18).
View
@@ -23,11 +23,11 @@ const (
SHL = 0x0f // SHL b, a | sets b to b<<a, sets EX to ((b<<a)>>16)&0xffff
IFB = 0x10 // IFB b, a | performs next instruction only if (b&a)!=0
IFC = 0x11 // IFC b, a | performs next instruction only if (b&a)==0
- IFE = 0x12 // IFE b, a | performs next instruction only if b==a
- IFN = 0x13 // IFN b, a | performs next instruction only if b!=a
- IFG = 0x14 // IFG b, a | performs next instruction only if b>a
+ IFE = 0x12 // IFE b, a | performs next instruction only if b==a
+ IFN = 0x13 // IFN b, a | performs next instruction only if b!=a
+ IFG = 0x14 // IFG b, a | performs next instruction only if b>a
IFA = 0x15 // IFA b, a | performs next instruction only if b>a (signed)
- IFL = 0x16 // IFL b, a | performs next instruction only if b<a
+ IFL = 0x16 // IFL b, a | performs next instruction only if b<a
IFU = 0x17 // IFU b, a | performs next instruction only if b<a (signed)
ADX = 0x1a // ADX b, a | sets b to b+a+EX, sets EX to 0x0001 if there is an overflow, 0x0 otherwise
SBX = 0x1b // SBX b, a | sets b to b-a+EX, sets EX to 0xFFFF if there is an underflow, 0x0 otherwise
@@ -39,7 +39,7 @@ const (
const (
JSR = 0x01 // JSR a - pushes the address of the next instruction to the stack, then sets PC to a.
INT = 0x08 // INT a | triggers a software interrupt with message a
- IAG = 0x09 // IAG a | sets a to IA
+ IAG = 0x09 // IAG a | sets a to IA
IAS = 0x0a // IAS a | sets IA to a
RFI = 0x0b // RFI a | disables interrupt queueing, pops A from the stack, then pops PC from the stack
IAQ = 0x0c /*
View
@@ -49,7 +49,7 @@ func ejectFdd(c *cpu.CPU, file string) error {
}
// Build assembles the given package and links it into an executable.
-// It then loads the program into CPU memory.
+// It then loads the program into CPU memory.
func Build(importpath string, c *cpu.CPU) error {
if len(importpath) > 0 {
buildTarget = importpath
View
@@ -162,14 +162,14 @@ func (d *LEM1802Display) Init() (err error) {
// Untextured quads
d.quads_ut = glh.NewMeshBuffer(
- glh.RenderArrays,
+ glh.RenderBuffered,
glh.NewPositionAttr(2, gl.SHORT, gl.STATIC_DRAW),
glh.NewColorAttr(3, gl.UNSIGNED_BYTE, gl.DYNAMIC_DRAW),
)
// Textured quads
d.quads_t = glh.NewMeshBuffer(
- glh.RenderArrays,
+ glh.RenderBuffered,
glh.NewPositionAttr(2, gl.SHORT, gl.STATIC_DRAW),
glh.NewColorAttr(3, gl.UNSIGNED_BYTE, gl.DYNAMIC_DRAW),
glh.NewTexCoordAttr(2, gl.FLOAT, gl.DYNAMIC_DRAW),
View
@@ -13,7 +13,7 @@ import (
)
// DefaultFont defines the default character set for the LEM1802 monitor.
-// 128 characters at 2 words per character.
+// 128 characters at 2 words per character.
func DefaultFont() []cpu.Word {
b := bytes.NewBuffer(lem1802font_png)
font, _ := LoadFont(b)
@@ -24,7 +24,7 @@ func DefaultFont() []cpu.Word {
//
// The supplied image should be 128x32 pixels where each
// glyph occupies 4x8 pixels. This gives 128 glyphs.
-//
+//
// The loader expects a black background with glyphs drawn in white.
// To be more precise, the glyphs need a red channel with a value > 0.
//
View
@@ -19,21 +19,21 @@ const (
//
// Each vertex occupies two words of information in the main DCPU RAM.
// The data is encoded as (in LSB-0 format):
-//
+//
// First word: YYYYYYYYXXXXXXXX
// Second word: 00000ICCZZZZZZZZ
-//
+//
// Where XXXXXXXX is the X-coordinate of the vertex, YYYYYYYY is the
// Y-coordinate, ZZZZZZZZ is the Z-coordinate, CC is color, and I is intensity.
-//
+//
// Z is deeper into the screen, if the device is placed face up on the ground,
// this translates to "up" relative to the user.
-//
+//
// Possible color values are 0: black, 1: red, 2: green, 3: blue.
//
// If the intensity bit is set, the color is drawn as more intense.
// The black color is meant to barely be visible at all, except for in very dim
-// environments, or if the intensity bit is set.
+// environments, or if the intensity bit is set.
type Vertex struct {
X uint8
Y uint8
View
@@ -140,7 +140,7 @@ func readArchives(importpath string, list *[]*Archive) error {
return nil
}
-// readArchive reads the given archive file if possible.
+// readArchive reads the given archive file if possible.
func readArchive(path string) (ar *archive.Archive, err error) {
fd, err := os.Open(path)
if err != nil {
View
@@ -2,6 +2,6 @@
// Its contents can be found in the enclosed LICENSE file.
// This command displays all packages for the given import paths. If the `...`
-// wildcard is present, it displays all sub-packages as well. The special case
+// wildcard is present, it displays all sub-packages as well. The special case
// `dcpu list all` displays any and all packages on the local system.
package main
View
@@ -244,7 +244,7 @@ func (a *AST) readImport(imp *Import, tok *Token) (err error) {
if imp.Name == nil {
// If no explicit alias was provided, use the last part
// of the import path. E.g.: path:'unicode/utf8' => name:'utf8'.
- // The meaning of these is the same as in Go import statements.q
+ // The meaning of these is the same as in Go import statements.q
_, part := filepath.Split(imp.Path.Value)
imp.Name = NewName(a.fileIndex(), tok.Line, tok.Col, part)
}

0 comments on commit a34c3dc

Please sign in to comment.