//
// IDs 0..31 are reserved for official use by PKWARE.
// IDs above that range are defined by third-party vendors.
- // Since ZIP lacked high precision timestamps (nor a official specification
+ // Since ZIP lacked high precision timestamps (nor an official specification
// of the timezone used for the date fields), many competing extra fields
// have been invented. Pervasive use effectively makes them "official".
//
b.lastRead = opInvalid
}
-// tryGrowByReslice is a inlineable version of grow for the fast-case where the
+// tryGrowByReslice is an inlineable version of grow for the fast-case where the
// internal buffer only needs to be resliced.
// It returns the index where bytes should be written and whether it succeeded.
func (b *Buffer) tryGrowByReslice(n int) (int, bool) {
// t is too small, lub is to right.
t = t.right
} else {
- // t is a upper bound, record it and seek a better one.
+ // t is an upper bound, record it and seek a better one.
best = t
t = t.left
}
return n.ReturnVars[0]
}
-// A LogicalExpr is a expression X Op Y where Op is && or ||.
+// A LogicalExpr is an expression X Op Y where Op is && or ||.
// It is separate from BinaryExpr to make room for statements
// that must be executed before Y but after X.
type LogicalExpr struct {
return x
}
-// Uint64Val returns n as an uint64.
+// Uint64Val returns n as a uint64.
// n must be an integer or rune constant.
func Uint64Val(n Node) uint64 {
if !IsConst(n, constant.Int) {
var init *Value // starting value
var limit *Value // ending value
- // Check thet the control if it either ind </<= limit or limit </<= ind.
+ // Check that the control if it either ind </<= limit or limit </<= ind.
// TODO: Handle unsigned comparisons?
c := b.Controls[0]
inclusive := false
// for i := len(n)-1; i >= 0; i--
init, inc, nxt = parseIndVar(limit)
if init == nil {
- // No recognied induction variable on either operand
+ // No recognized induction variable on either operand
continue
}
// Ok, the arguments were reversed. Swap them, and remember that we're
- // looking at a ind >/>= loop (so the induction must be decrementing).
+ // looking at an ind >/>= loop (so the induction must be decrementing).
ind, limit = limit, ind
less = false
}
auxARM64BitField // aux is an arm64 bitfield lsb and width packed into auxInt
auxS390XRotateParams // aux is a s390x rotate parameters object encoding start bit, end bit and rotate amount
auxS390XCCMask // aux is a s390x 4-bit condition code mask
- auxS390XCCMaskInt8 // aux is a s390x 4-bit condition code mask, auxInt is a int8 immediate
+ auxS390XCCMaskInt8 // aux is a s390x 4-bit condition code mask, auxInt is an int8 immediate
auxS390XCCMaskUint8 // aux is a s390x 4-bit condition code mask, auxInt is a uint8 immediate
)
)
// posetUndo represents an undo pass to be performed.
-// It's an union of fields that can be used to store information,
+// It's a union of fields that can be used to store information,
// and typ is the discriminant, that specifies which kind
// of operation must be performed. Not all fields are always used.
type posetUndo struct {
return t.kind == TUNSAFEPTR
}
-// IsUintptr reports whether t is an uintptr.
+// IsUintptr reports whether t is a uintptr.
func (t *Type) IsUintptr() bool {
return t.kind == TUINTPTR
}
}
// y must be either an integer constant or the largest possible positive value
- // of variable y needs to fit into an uint.
+ // of variable y needs to fit into a uint.
// typecheck made sure that constant arguments to make are not negative and fit into an int.
// growslice will have done the clearing for us.
func extendSlice(n *ir.CallExpr, init *ir.Nodes) ir.Node {
- // isAppendOfMake made sure all possible positive values of l2 fit into an uint.
+ // isAppendOfMake made sure all possible positive values of l2 fit into a uint.
// The case of l2 overflow when converting from e.g. uint to int is handled by an explicit
// check of l2 < 0 at runtime which is generated below.
l2 := typecheck.Conv(n.Args[1].(*ir.MakeExpr).Len, types.Types[types.TINT])
return 0
}
-// Get the implied register of a operand which doesn't specify one. These show up
+// Get the implied register of an operand which doesn't specify one. These show up
// in handwritten asm like "MOVD R5, foosymbol" where a base register is not supplied,
// or "MOVD R5, foo+10(SP) or pseudo-register is used. The other common case is when
// generating constants in register like "MOVD $constant, Rx".
return ins
}
-// instructionsForOpImmediate returns the machine instructions for a immedate
+// instructionsForOpImmediate returns the machine instructions for an immediate
// operand. The instruction is specified by as and the source register is
// specified by rs, instead of the obj.Prog.
func instructionsForOpImmediate(p *obj.Prog, as obj.As, rs int16) []*instruction {
// Offset is the location of the param on the Go stack (ie relative to sp).
// Because of our call convention, the parameters are located an additional 8 bytes
- // from sp because we store the return address as a int64 at the bottom of the stack.
+ // from sp because we store the return address as an int64 at the bottom of the stack.
// Ie the stack looks like [return_addr, param3, param2, param1, etc]
// Ergo, we add 8 to the true byte offset of the param to skip the return address.
}
}
-// allocateDataSectionForSym creates a new sym.Section into which a a
+// allocateDataSectionForSym creates a new sym.Section into which a
// single symbol will be placed. Here "seg" is the segment into which
// the section will go, "s" is the symbol to be placed into the new
// section, and "rwx" contains permissions for the section.
// XCOFF binaries should normally have all its sections position-independent.
// However, this is not yet possible for .text because of some R_ADDR relocations
// inside RODATA symbols.
- // .data and .bss are position-independent so their address start inside a unreachable
+ // .data and .bss are position-independent so their address start inside an unreachable
// segment during execution to force segfault if something is wrong.
XCOFFTEXTBASE = 0x100000000 // Start of text address
XCOFFDATABASE = 0x200000000 // Start of data address
// put function used by genasmsym to write symbol table.
func putaixsym(ctxt *Link, x loader.Sym, t SymbolType) {
// All XCOFF symbols generated by this GO symbols
- // Can be a symbol entry or a auxiliary entry
+ // Can be a symbol entry or an auxiliary entry
syms := []xcoffSym{}
ldr := ctxt.loader
}
if ldr.SymType(s) == sym.STEXT {
- // On AIX, a exported function must have two symbols:
+ // On AIX, an exported function must have two symbols:
// - a .text symbol which must start with a ".".
// - a .data symbol which is a function descriptor.
name := ldr.SymExtname(s)
// a jump to the loaded value.
CreateImportStubPltToken = -2
- // When stored into the GOT value for a import symbol __imp_X this
+ // When stored into the GOT value for an import symbol __imp_X this
// token tells windynrelocsym to redirect references to the
// underlying DYNIMPORT symbol X.
RedirectToDynImportGotToken = -2
}
func elfreloc1(ctxt *ld.Link, out *ld.OutBuf, ldr *loader.Loader, s loader.Sym, r loader.ExtReloc, ri int, sectoff int64) bool {
- // Beware that bit0~bit15 start from the third byte of a instruction in Big-Endian machines.
+ // Beware that bit0~bit15 start from the third byte of an instruction in Big-Endian machines.
rt := r.Type
if rt == objabi.R_ADDR || rt == objabi.R_POWER_TLS || rt == objabi.R_CALLPOWER {
} else {
// If x is not of the right length, SetUniformBytes returns nil and an error,
// and the receiver is unchanged.
//
-// SetUniformBytes can be used to set s to an uniformly distributed value given
+// SetUniformBytes can be used to set s to a uniformly distributed value given
// 64 uniformly distributed random bytes.
func (s *Scalar) SetUniformBytes(x []byte) (*Scalar, error) {
if len(x) != 64 {
// multiple Conns. Returned references should not be mutated by callers. Certificates
// are still safe to use after they are removed from the cache.
//
-// Certificates are returned wrapped in a activeCert struct that should be held by
+// Certificates are returned wrapped in an activeCert struct that should be held by
// the caller. When references to the activeCert are freed, the number of references
// to the certificate in the cache is decremented. Once the number of references
// reaches zero, the entry is evicted from the cache.
}
// active increments the number of references to the entry, wraps the
-// certificate in the entry in a activeCert, and sets the finalizer.
+// certificate in the entry in an activeCert, and sets the finalizer.
//
// Note that there is a race between active and the finalizer set on the
// returned activeCert, triggered if active is called after the ref count is
// ParsePKCS8PrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form.
//
-// It returns a *rsa.PrivateKey, a *ecdsa.PrivateKey, a ed25519.PrivateKey (not
-// a pointer), or a *ecdh.PrivateKey (for X25519). More types might be supported
+// It returns a *rsa.PrivateKey, an *ecdsa.PrivateKey, an ed25519.PrivateKey (not
+// a pointer), or an *ecdh.PrivateKey (for X25519). More types might be supported
// in the future.
//
// This kind of key is commonly encoded in PEM blocks of type "PRIVATE KEY".
return "unknown error"
}
-// readOptionalHeader accepts a io.ReadSeeker pointing to optional header in the PE file
+// readOptionalHeader accepts an io.ReadSeeker pointing to optional header in the PE file
// and its size as seen in the file header.
// It parses the given size of bytes and returns optional header. It infers whether the
// bytes being parsed refer to 32 bit or 64 bit version of optional header.
}
}
-// readDataDirectories accepts a io.ReadSeeker pointing to data directories in the PE file,
+// readDataDirectories accepts an io.ReadSeeker pointing to data directories in the PE file,
// its size and number of data directories as seen in optional header.
// It parses the given size of bytes and returns given number of data directories.
func readDataDirectories(r io.ReadSeeker, sz uint16, n uint32) ([]DataDirectory, error) {
}
}
-// writeMessage sends the data item preceded by a unsigned count of its length.
+// writeMessage sends the data item preceded by an unsigned count of its length.
func (enc *Encoder) writeMessage(w io.Writer, b *encBuffer) {
// Space has been reserved for the length at the head of the message.
// This is a little dirty: we grab the slice from the bytes.Buffer and massage
}
// TODO(rfindley): the error produced here could be improved, since we could
- // accept a identifier, 'type', or a '}' at this point.
+ // accept an identifier, 'type', or a '}' at this point.
rbrace := p.expect(token.RBRACE)
return &ast.InterfaceType{
// Second, to avoid text comparison entirely, if an LMS-substring is very short,
// sa[j/2] records its actual text instead of its length, so that if two such
// substrings have matching “length,” the text need not be read at all.
-// The definition of “very short” is that the text bytes must pack into an uint32,
+// The definition of “very short” is that the text bytes must pack into a uint32,
// and the unsigned encoding e must be ≥ len(text), so that it can be
// distinguished from a valid length.
func length_8_32(text []byte, sa []int32, numLMS int) {
// GetFile returns the XCOFF file defined by member name.
// FIXME: This doesn't work if an archive has two members with the same
-// name which can occur if a archive has both 32-bits and 64-bits files.
+// name which can occur if an archive has both 32-bits and 64-bits files.
func (arch *Archive) GetFile(name string) (*File, error) {
for _, mem := range arch.Members {
if mem.Name == name {
return int64(rng.Uint64() & rngMask)
}
-// Uint64 returns a non-negative pseudo-random 64-bit integer as an uint64.
+// Uint64 returns a non-negative pseudo-random 64-bit integer as a uint64.
func (rng *rngSource) Uint64() uint64 {
rng.tap--
if rng.tap < 0 {
)
// wrapSyscallError takes an error and a syscall name. If the error is
-// a syscall.Errno, it wraps it in a os.SyscallError using the syscall name.
+// a syscall.Errno, it wraps it in an os.SyscallError using the syscall name.
func wrapSyscallError(name string, err error) error {
if _, ok := err.(syscall.Errno); ok {
err = os.NewSyscallError(name, err)
return net.ParseIP(host) != nil
}
-// defaultPath returns the directory part of an URL's path according to
+// defaultPath returns the directory part of a URL's path according to
// RFC 6265 section 5.1.4.
func defaultPath(path string) string {
if len(path) == 0 || path[0] != '/' {
return path[:i] // Path is either of form "/abc/xyz" or "/abc/xyz/".
}
-// newEntry creates an entry from a http.Cookie c. now is the current time and
+// newEntry creates an entry from an http.Cookie c. now is the current time and
// is compared to c.Expires to determine deletion of c. defPath and host are the
// default-path and the canonical host name of the URL c was received from.
//
if dst.Kind() == Pointer && dst.Elem().Kind() == Array && src.Elem() == dst.Elem().Elem() {
return cvtSliceArrayPtr
}
- // "x is a slice, T is a array type,
+ // "x is a slice, T is an array type,
// and the slice and array types have identical element types."
if dst.Kind() == Array && src.Elem() == dst.Elem() {
return cvtSliceArray
panicdottypeE(t, want, iface)
}
-// panicnildottype is called when doing a i.(T) conversion and the interface i is nil.
+// panicnildottype is called when doing an i.(T) conversion and the interface i is nil.
// want = the static type we're trying to convert to.
func panicnildottype(want *_type) {
panic(&TypeAssertionError{nil, nil, want, ""})
}
// CopyBytesToGo copies bytes from src to dst.
-// It panics if src is not an Uint8Array or Uint8ClampedArray.
+// It panics if src is not a Uint8Array or Uint8ClampedArray.
// It returns the number of bytes copied, which will be the minimum of the lengths of src and dst.
func CopyBytesToGo(dst []byte, src Value) int {
n, ok := copyBytesToGo(dst, src.ref)
func copyBytesToGo(dst []byte, src ref) (int, bool)
// CopyBytesToJS copies bytes from src to dst.
-// It panics if dst is not an Uint8Array or Uint8ClampedArray.
+// It panics if dst is not a Uint8Array or Uint8ClampedArray.
// It returns the number of bytes copied, which will be the minimum of the lengths of src and dst.
func CopyBytesToJS(dst Value, src []byte) int {
n, ok := copyBytesToJS(dst.ref, src)