// LowerBlit performs low-level surface blitting only.
// (https://wiki.libsdl.org/SDL_LowerBlit)
174167
func (surface *Surface) LowerBlit(srcRect *Rect, dst *Surface, dstRect *Rect) error {
	if C.SDL_LowerBlit(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {
		return GetError()
	}
	return nil
}
1153877
func (c *Client) BlobRoot() (string, error) {
	prefix, err := c.prefix()
	if err != nil {
		return "", err
	}
	return prefix + "/", nil
}
949265
func (l byContributions) Less(a, b int) bool {
	if l[a].log10commits != l[b].log10commits {
		return l[a].log10commits > l[b].log10commits
	}
	return l[a].name < l[b].name
}
775611
func compactLowerdirOption(opts []string) (string, []string) {
	idx, dirs := findOverlayLowerdirs(opts)
	if idx == -1 || len(dirs) == 1 {
		// no need to compact if there is only one lowerdir
		return "", opts
	}

	// find out common dir
	commondir := longestCommonPrefix(dirs)
	if commondir == "" {
		return "", opts
	}

	// NOTE: the snapshot id is based on digits.
	// in order to avoid to get snapshots/x, should be back to parent dir.
	// however, there is assumption that the common dir is ${root}/io.containerd.v1.overlayfs/snapshots.
	commondir = path.Dir(commondir)
	if commondir == "/" {
		return "", opts
	}
	commondir = commondir + "/"

	newdirs := make([]string, 0, len(dirs))
	for _, dir := range dirs {
		newdirs = append(newdirs, dir[len(commondir):])
	}

	newopts := copyOptions(opts)
	newopts = append(newopts[:idx], newopts[idx+1:]...)
	newopts = append(newopts, fmt.Sprintf("lowerdir=%s", strings.Join(newdirs, ":")))
	return commondir, newopts
}
1152287
func (a *aclIterator) Less(i, j int) bool {
	return a.acls[i].ID < a.acls[j].ID
}
868136
func (l *lexer) blob() string {
	return l.input[l.start:l.pos]
}
769459
func (w *MultiLevelSkipListWriter) BufferSkip(df int) error {
	assert(df%w.skipInterval == 0)
	numLevels := 1
	df /= w.skipInterval

	// determine max level
	for (df%w.skipMultiplier) == 0 && numLevels < w.numberOfSkipLevels {
		numLevels++
		df /= w.skipMultiplier
	}

	childPointer := int64(0)

	var err error
	for level := 0; level < numLevels; level++ {
		if err = w.spi.WriteSkipData(level, w.skipBuffer[level]); err != nil {
			return err
		}

		newChildPointer := w.skipBuffer[level].FilePointer()

		if level != 0 {
			// store child pointers for all levels except the lowest
			if err = w.skipBuffer[level].WriteVLong(childPointer); err != nil {
				return err
			}
		}

		// remember the childPointer for the next level
		childPointer = newChildPointer
	}
	return nil
}
124919
func bytePtrFromSlice(data []byte) (ptr *byte, size int) {
	size = len(data)
	if size > 0 {
		ptr = &data[0]
	}
	return
}
1057464
func (s Uint32Slice) Less(i, j int) bool {
	return s[i] < s[j]
}
407753
func (surface *Surface) SoftStretch(srcRect *Rect, dst *Surface, dstRect *Rect) error {
	if C.SDL_SoftStretch(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {
		return GetError()
	}
	return nil
}
998815
func (c cols2HandleSlice) Less(i, j int) bool {
	return c[i].start < c[j].start
}
1121651
func Crit(msg string, ctx ...interface{}) {
	root.write(msg, LvlCrit, ctx, skipLevel)
	os.Exit(1)
}
1326788
func Debugln(v ...interface{}) {
	if Severity >= LevelDebug {
		std.Output(5, fmt.Sprintln(v...), LevelDebug)
	}
}
625060
func (s Uint16Slice) Less(i, j int) bool {
	return s[i] < s[j]
}
1087304
func (s Uint8Slice) Less(i, j int) bool {
	return s[i] < s[j]
}
534833
func ThickLineRGBA(renderer *sdl.Renderer, x1, y1, x2, y2, width int32, r, g, b, a uint8) bool {
	_x1 := C.Sint16(x1)
	_y1 := C.Sint16(y1)
	_x2 := C.Sint16(x2)
	_y2 := C.Sint16(y2)
	_width := C.Uint8(width)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.thickLineRGBA((*C.SDL_Renderer)(unsafe.Pointer(renderer)), _x1, _y1, _x2, _y2, _width, _r, _g, _b, _a) == 0
}
1203418
func (b *Box) MinSizeHint() image.Point {
	var minSize image.Point

	for _, child := range b.children {
		size := child.MinSizeHint()
		if b.Alignment() == Horizontal {
			minSize.X += size.X
			if size.Y > minSize.Y {
				minSize.Y = size.Y
			}
		} else {
			minSize.Y += size.Y
			if size.X > minSize.X {
				minSize.X = size.X
			}
		}
	}

	if b.border {
		minSize = minSize.Add(image.Point{2, 2})
	}

	return minSize
}