Skip to content

Commit

Permalink
Run Nick G's spellchecker github.com/client9/misspell, carefuly fix w…
Browse files Browse the repository at this point in the history
…hat it found (#4235)
  • Loading branch information
dkegel-fastly committed Apr 19, 2024
1 parent 7122755 commit 39029cc
Show file tree
Hide file tree
Showing 39 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion compileopts/target.go
Expand Up @@ -26,7 +26,7 @@ type TargetSpec struct {
Inherits []string `json:"inherits,omitempty"`
Triple string `json:"llvm-target,omitempty"`
CPU string `json:"cpu,omitempty"`
ABI string `json:"target-abi,omitempty"` // rougly equivalent to -mabi= flag
ABI string `json:"target-abi,omitempty"` // roughly equivalent to -mabi= flag
Features string `json:"features,omitempty"`
GOOS string `json:"goos,omitempty"`
GOARCH string `json:"goarch,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions compiler/compiler.go
Expand Up @@ -2181,7 +2181,7 @@ func (b *builder) createExpr(expr ssa.Value) (llvm.Value, error) {
return llvm.Value{}, b.makeError(expr.Pos(), "todo: indexaddr: "+ptrTyp.String())
}

// Make sure index is at least the size of uintptr becuase getelementptr
// Make sure index is at least the size of uintptr because getelementptr
// assumes index is a signed integer.
index = b.extendInteger(index, expr.Index.Type(), b.uintptrType)

Expand Down Expand Up @@ -2557,7 +2557,7 @@ func (b *builder) createBinOp(op token.Token, typ, ytyp types.Type, x, y llvm.Va
sizeY := b.targetData.TypeAllocSize(y.Type())

// Check if the shift is bigger than the bit-width of the shifted value.
// This is UB in LLVM, so it needs to be handled seperately.
// This is UB in LLVM, so it needs to be handled separately.
// The Go spec indirectly defines the result as 0.
// Negative shifts are handled earlier, so we can treat y as unsigned.
overshifted := b.CreateICmp(llvm.IntUGE, y, llvm.ConstInt(y.Type(), 8*sizeX, false), "shift.overflow")
Expand Down
4 changes: 2 additions & 2 deletions compiler/llvmutil/llvm.go
@@ -1,5 +1,5 @@
// Package llvmutil contains utility functions used across multiple compiler
// packages. For example, they may be used by both the compiler pacakge and
// packages. For example, they may be used by both the compiler package and
// transformation packages.
//
// Normally, utility packages are avoided. However, in this case, the utility
Expand Down Expand Up @@ -28,7 +28,7 @@ func CreateEntryBlockAlloca(builder llvm.Builder, t llvm.Type, name string) llvm
}

// CreateTemporaryAlloca creates a new alloca in the entry block and adds
// lifetime start infromation in the IR signalling that the alloca won't be used
// lifetime start information in the IR signalling that the alloca won't be used
// before this point.
//
// This is useful for creating temporary allocas for intrinsics. Don't forget to
Expand Down
2 changes: 1 addition & 1 deletion loader/goroot.go
Expand Up @@ -214,7 +214,7 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool)
return merges, nil
}

// needsSyscallPackage returns whether the syscall package should be overriden
// needsSyscallPackage returns whether the syscall package should be overridden
// with the TinyGo version. This is the case on some targets.
func needsSyscallPackage(buildTags []string) bool {
for _, tag := range buildTags {
Expand Down
2 changes: 1 addition & 1 deletion loader/loader.go
Expand Up @@ -430,7 +430,7 @@ func (p *Package) parseFiles() ([]*ast.File, error) {
var files []*ast.File
var fileErrs []error

// Parse all files (incuding CgoFiles).
// Parse all files (including CgoFiles).
parseFile := func(file string) {
if !filepath.IsAbs(file) {
file = filepath.Join(p.Dir, file)
Expand Down
4 changes: 2 additions & 2 deletions src/internal/bytealg/bytealg.go
Expand Up @@ -57,7 +57,7 @@ func Count(b []byte, c byte) int {
// Count the number of instances of a byte in a string.
func CountString(s string, c byte) int {
// Use a simple implementation, as there is no intrinsic that does this like we want.
// Currently, the compiler does not generate zero-copy byte-string conversions, so this needs to be seperate from Count.
// Currently, the compiler does not generate zero-copy byte-string conversions, so this needs to be separate from Count.
n := 0
for i := 0; i < len(s); i++ {
if s[i] == c {
Expand Down Expand Up @@ -216,7 +216,7 @@ func HashStrRev[T string | []byte](sep T) (uint32, uint32) {
}

// IndexRabinKarpBytes uses the Rabin-Karp search algorithm to return the index of the
// first occurence of substr in s, or -1 if not present.
// first occurrence of substr in s, or -1 if not present.
//
// This function was removed in Go 1.22.
func IndexRabinKarpBytes(s, sep []byte) int {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/task/task_stack.go
Expand Up @@ -44,7 +44,7 @@ func Current() *Task {
// This function may only be called when running on a goroutine stack, not when running on the system stack or in an interrupt.
func Pause() {
// Check whether the canary (the lowest address of the stack) is still
// valid. If it is not, a stack overflow has occured.
// valid. If it is not, a stack overflow has occurred.
if *currentTask.state.canaryPtr != stackCanary {
runtimePanic("goroutine stack overflow")
}
Expand Down
2 changes: 1 addition & 1 deletion src/machine/board_nano-33-ble.go
Expand Up @@ -26,7 +26,7 @@
// SoftDevice (s140v7) must be flashed first to enable use of bluetooth on this board.
// See https://github.com/tinygo-org/bluetooth
//
// SoftDevice overwrites original bootloader and flashing method described above is not avalable anymore.
// SoftDevice overwrites original bootloader and flashing method described above is not available anymore.
// Instead, please use debug probe and flash your code with "nano-33-ble-s140v7" target.
package machine

Expand Down
8 changes: 4 additions & 4 deletions src/machine/machine_atsamd21.go
Expand Up @@ -1304,7 +1304,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.DATA.Get()), nil
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
Expand Down Expand Up @@ -1459,7 +1459,7 @@ func (tcc *TCC) Configure(config PWMConfig) error {
for tcc.timer().SYNCBUSY.Get() != 0 {
}

// Return any error that might have occured in the tcc.setPeriod call.
// Return any error that might have occurred in the tcc.setPeriod call.
return err
}

Expand Down Expand Up @@ -1606,7 +1606,7 @@ func (tcc *TCC) Counter() uint32 {
return tcc.timer().COUNT.Get()
}

// Some constans to make pinTimerMapping below easier to read.
// Some constants to make pinTimerMapping below easier to read.
const (
pinTCC0 = 1
pinTCC1 = 2
Expand Down Expand Up @@ -1759,7 +1759,7 @@ func (tcc *TCC) Set(channel uint8, value uint32) {
}
}

// EnterBootloader should perform a system reset in preperation
// EnterBootloader should perform a system reset in preparation
// to switch to the bootloader to flash new firmware.
func EnterBootloader() {
arm.DisableInterrupts()
Expand Down
4 changes: 2 additions & 2 deletions src/machine/machine_atsamd51.go
Expand Up @@ -1587,7 +1587,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.DATA.Get()), nil
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
Expand Down Expand Up @@ -1720,7 +1720,7 @@ func (tcc *TCC) Configure(config PWMConfig) error {
for tcc.timer().SYNCBUSY.Get() != 0 {
}

// Return any error that might have occured in the tcc.setPeriod call.
// Return any error that might have occurred in the tcc.setPeriod call.
return err
}

Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_atsame5x_can.go
Expand Up @@ -155,7 +155,7 @@ func (can *CAN) Configure(config CANConfig) error {
}

// Callbacks to be called for CAN.SetInterrupt(). Wre're using the magic
// constant 2 and 32 here beacuse th SAM E51/E54 has 2 CAN and 32 interrupt
// constant 2 and 32 here because the SAM E51/E54 has 2 CAN and 32 interrupt
// sources.
var (
canInstances [2]*CAN
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_esp32.go
Expand Up @@ -460,7 +460,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.W0.Get()), nil
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// This is accomplished by sending zero bits if r is bigger than w or discarding
// the incoming data if w is bigger than r.
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_esp32c3.go
Expand Up @@ -312,7 +312,7 @@ func (uart *UART) configure(config UARTConfig, regs registerSet) error {

initUARTClock(uart.Bus, regs)

// - disbale TX/RX clock to make sure the UART transmitter or receiver is not at work during configuration
// - disable TX/RX clock to make sure the UART transmitter or receiver is not at work during configuration
uart.Bus.SetCLK_CONF_TX_SCLK_EN(0)
uart.Bus.SetCLK_CONF_RX_SCLK_EN(0)

Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_esp32c3_spi.go
Expand Up @@ -234,7 +234,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(spi.Bus.GetW0()), nil
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// This is accomplished by sending zero bits if r is bigger than w or discarding
// the incoming data if w is bigger than r.
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_generic.go
Expand Up @@ -66,7 +66,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return spiTransfer(spi.Bus, w), nil
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_nrf.go
Expand Up @@ -108,7 +108,7 @@ func (p Pin) Get() bool {
func (p Pin) SetInterrupt(change PinChange, callback func(Pin)) error {
// Some variables to easily check whether a channel was already configured
// as an event channel for the given pin.
// This is not just an optimization, this is requred: the datasheet says
// This is not just an optimization, this is required: the datasheet says
// that configuring more than one channel for a given pin results in
// unpredictable behavior.
expectedConfigMask := uint32(nrf.GPIOTE_CONFIG_MODE_Msk | nrf.GPIOTE_CONFIG_PSEL_Msk)
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_nrf51.go
Expand Up @@ -133,7 +133,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return byte(r), nil
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_nrf52xxx.go
Expand Up @@ -277,7 +277,7 @@ func (spi SPI) Transfer(w byte) (byte, error) {
return buf[0], err
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous
// write/read interface, there must always be the same number of bytes written
// as bytes read. Therefore, if the number of bytes don't match it will be
// padded until they fit: if len(w) > len(r) the extra bytes received will be
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_rp2040_i2c.go
Expand Up @@ -348,7 +348,7 @@ func (i2c *I2C) tx(addr uint8, tx, rx []byte, timeout_us uint64) (err error) {
}
if abort || last {
// If the transaction was aborted or if it completed
// successfully wait until the STOP condition has occured.
// successfully wait until the STOP condition has occurred.

// TODO Could there be an abort while waiting for the STOP
// condition here? If so, additional code would be needed here
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_rp2040_spi.go
Expand Up @@ -48,7 +48,7 @@ type SPI struct {
Bus *rp.SPI0_Type
}

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_stm32l5x2.go
Expand Up @@ -23,7 +23,7 @@ const APB2_TIM_FREQ = 110e6 // 110MHz
// Configure the UART.
func (uart *UART) configurePins(config UARTConfig) {
if config.RX.getPort() == stm32.GPIOG || config.TX.getPort() == stm32.GPIOG {
// Enable VDDIO2 power supply, which is an independant power supply for the PGx pins
// Enable VDDIO2 power supply, which is an independent power supply for the PGx pins
stm32.PWR.CR2.SetBits(stm32.PWR_CR2_IOSV)
}

Expand Down
2 changes: 1 addition & 1 deletion src/machine/spi_tx.go
Expand Up @@ -5,7 +5,7 @@

package machine

// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read
// Tx handles read/write operation for SPI interface. Since SPI is a synchronous write/read
// interface, there must always be the same number of bytes written as bytes read.
// The Tx method knows about this, and offers a few different ways of calling it.
//
Expand Down
2 changes: 1 addition & 1 deletion src/os/filesystem.go
Expand Up @@ -30,7 +30,7 @@ type Filesystem interface {
// OpenFile opens the named file.
OpenFile(name string, flag int, perm FileMode) (uintptr, error)

// Mkdir creates a new directoy with the specified permission (before
// Mkdir creates a new directory with the specified permission (before
// umask). Some filesystems may not support directories or permissions.
Mkdir(name string, perm FileMode) error

Expand Down
2 changes: 1 addition & 1 deletion src/os/seek_unix_bad.go
Expand Up @@ -11,7 +11,7 @@ import (
// In particular, on i386 and arm, the function syscall.seek is missing, breaking syscall.Seek.
// This in turn causes os.(*File).Seek, time, io/fs, and path/filepath to fail to link.
//
// To temporarly let all the above at least link, provide a stub for syscall.seek.
// To temporarily let all the above at least link, provide a stub for syscall.seek.
// This belongs in syscall, but on linux, we use upstream's syscall.
// Remove once we support Go Assembly.
// TODO: make this a non-stub, and thus fix the whole problem?
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/chan.go
Expand Up @@ -76,7 +76,7 @@ func (b *channelBlockedList) remove(old *channelBlockedList) *channelBlockedList
return b
}

// detatch removes all other channel operations that are part of the same select statement.
// detach removes all other channel operations that are part of the same select statement.
// If the input is not part of a select statement, this is a no-op.
// This must be called before resuming any task blocked on a channel operation in order to ensure that it is not placed on the runqueue twice.
func (b *channelBlockedList) detach() {
Expand All @@ -88,7 +88,7 @@ func (b *channelBlockedList) detach() {
// cancel all other channel operations that are part of this select statement
switch {
case &b.allSelectOps[i] == b:
// This entry is the one that was already detatched.
// This entry is the one that was already detached.
continue
case v.t == nil:
// This entry is not used (nil channel).
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/gc_blocks.go
Expand Up @@ -410,7 +410,7 @@ func GC() {
runGC()
}

// runGC performs a garbage colleciton cycle. It is the internal implementation
// runGC performs a garbage collection cycle. It is the internal implementation
// of the runtime.GC() function. The difference is that it returns the number of
// free bytes in the heap after the GC is finished.
func runGC() (freeBytes uintptr) {
Expand All @@ -424,7 +424,7 @@ func runGC() (freeBytes uintptr) {

if baremetal && hasScheduler {
// Channel operations in interrupts may move task pointers around while we are marking.
// Therefore we need to scan the runqueue seperately.
// Therefore we need to scan the runqueue separately.
var markedTaskQueue task.Queue
runqueueScan:
for !runqueue.Empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/gc_precise.go
Expand Up @@ -7,7 +7,7 @@
// however use a bit more RAM to store the layout of each object.
//
// The pointer/non-pointer information for objects is stored in the first word
// of the object. It is described below but in essense it contains a bitstring
// of the object. It is described below but in essence it contains a bitstring
// of a particular size. This size does not indicate the size of the object:
// instead the allocated object is a multiple of the bitstring size. This is so
// that arrays and slices can store the size of the object efficiently. The
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt.go
Expand Up @@ -26,7 +26,7 @@ func New(id int, handler func(Interrupt)) Interrupt
// and use that in an Interrupt object. That way the compiler will be able to
// optimize away all interrupt handles that are never used in a program.
// This system only works when interrupts need to be enabled before use and this
// is done only through calling Enable() on this object. If interrups cannot
// is done only through calling Enable() on this object. If interrupts cannot
// individually be enabled/disabled, the compiler should create a pseudo-call
// (like runtime/interrupt.use()) that keeps the interrupt alive.
type handle struct {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_esp32c3.go
Expand Up @@ -169,7 +169,7 @@ func handleInterrupt() {
// save MSTATUS & MEPC, which could be overwritten by another CPU interrupt
mstatus := riscv.MSTATUS.Get()
mepc := riscv.MEPC.Get()
// Useing threshold to temporary disable this interrupts.
// Using threshold to temporary disable this interrupts.
// FYI: using CPU interrupt enable bit make runtime to loose interrupts.
reg := (*volatile.Register32)(unsafe.Add(unsafe.Pointer(&esp.INTERRUPT_CORE0.CPU_INT_PRI_0), interruptNumber*4))
thresholdSave := reg.Get()
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/os_darwin.go
Expand Up @@ -107,7 +107,7 @@ func findGlobals(found func(start, end uintptr)) {
}
}

// Move on to the next load command (wich may or may not be a
// Move on to the next load command (which may or may not be a
// LC_SEGMENT_64).
cmd = (*segmentLoadCommand)(unsafe.Add(unsafe.Pointer(cmd), cmd.cmdsize))
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_atsamd21.go
Expand Up @@ -318,7 +318,7 @@ func readRTC() uint32 {

// ticks are in microseconds
// Returns true if the timer completed.
// Returns false if another interrupt occured which requires an early return to scheduler.
// Returns false if another interrupt occurred which requires an early return to scheduler.
func timerSleep(ticks uint32) bool {
timerWakeup.Set(0)
if ticks < 7 {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_atsamd51.go
Expand Up @@ -307,7 +307,7 @@ func readRTC() uint32 {

// ticks are in microseconds
// Returns true if the timer completed.
// Returns false if another interrupt occured which requires an early return to scheduler.
// Returns false if another interrupt occurred which requires an early return to scheduler.
func timerSleep(ticks uint32) bool {
timerWakeup.Set(0)
if ticks < 8 {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_avrtiny.go
Expand Up @@ -115,7 +115,7 @@ func sleepTicks(d timeUnit) {
// Sleep until the next interrupt happens.
avr.Asm("sei\nsleep\ncli")
if cmpMatch.Get() != 0 {
// The CMP interrupt occured, so we have slept long enough.
// The CMP interrupt occurred, so we have slept long enough.
cmpMatch.Set(0)
break
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_cortexm_hardfault.go
Expand Up @@ -8,7 +8,7 @@ import (

// This function is called at HardFault.
// Before this function is called, the stack pointer is reset to the initial
// stack pointer (loaded from addres 0x0) and the previous stack pointer is
// stack pointer (loaded from address 0x0) and the previous stack pointer is
// passed as an argument to this function. This allows for easy inspection of
// the stack the moment a HardFault occurs, but it means that the stack will be
// corrupted by this function and thus this handler must not attempt to recover.
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_fe310.go
Expand Up @@ -85,7 +85,7 @@ func handleInterrupt() {
riscv.MCAUSE.Set(0)
}

// initPeripherals configures periperhals the way the runtime expects them.
// initPeripherals configures peripherals the way the runtime expects them.
func initPeripherals() {
// Configure PLL to output 320MHz.
// R=2: divide 16MHz to 8MHz
Expand Down

0 comments on commit 39029cc

Please sign in to comment.