// Int returns the flag's value as int by it's name, if can't parse int then returns -1
// panics on !int
425649
func (c Flags) Int(name string) int {
	f := c.Get(name)
	if f == nil {
		return -1
	}
	return *f.Value.(*int)
}
559878
func (b *buf) Int() int64 {
	ux, bits := b.Varint()
	x := int64(ux)
	if x&(1<<(bits-1)) != 0 {
		x |= -1 << bits
	}
	return x
}
469024
func (p Port) Int() int {
	portStr := p.Port()
	// We don't need to check for an error because we're going to
	// assume that any error would have been found, and reported, in NewPort()
	port, _ := ParsePort(portStr)
	return port
}
204706
func GetInt(key string) (int, error) {
	value, err := Get(key)
	if err != nil {
		return 0, err
	}
	if v, ok := value.(int); ok {
		return v, nil
	} else if v, ok := value.(string); ok {
		if i, err := strconv.ParseInt(v, 10, 64); err == nil {
			return int(i), nil
		}
	} else if v, err := GetFloat(key); err == nil {
		if float64(int(v)) == v {
			return int(v), nil
		}
	}
	return 0, &InvalidValue{key, "int"}
}
1207403
func (v Value) GetInt() (int, error) {
	var err error

	if v.t != reflect.Int {
		err = fmt.Errorf("not a int Value")
	}

	return v.i, err
}
833244
func Int(v interface{}, err error) (int64, error) {
	if err != nil {
		return 0, err
	}
	vi, ok := v.(int64)
	if ok {
		return vi, nil
	}

	vbi, ok := v.(*big.Int)
	if ok {
		if vbi.BitLen() <= 63 {
			return vbi.Int64(), nil
		}
	}

	return 0, newWrongTypeError(v, vi)

}
556015
func AsInt(d DataType) (int, bool) {
	value, ok := d.Value().(int)
	return value, ok
}
437669
func (g *Group) Int() *Statement {
	// notest
	s := Int()
	g.items = append(g.items, s)
	return s
}
868898
func (p *Lexer) Integer() (string, bool) {

	var buf []byte

	for {
		c, _ := p.Byte()
		if !IsDigit(rune(c)) {
			break
		}
		buf = append(buf, c)
	}

	p.UnreadByte()
	return string(buf), len(buf) > 0
}
831481
func Int(input interface{}) (output int64, err error) {

	switch castValue := input.(type) {
	case Inter:
		output = castValue.Int()
		return
	case string:
		output, err = strconv.ParseInt(castValue, 10, 64)
		return
	case []byte:
		output, err = strconv.ParseInt(string(castValue), 10, 64)
		return
	case int:
		output = int64(castValue)
		return
	case int8:
		output = int64(castValue)
		return
	case int16:
		output = int64(castValue)
		return
	case int32:
		output = int64(castValue)
		return
	case int64:
		output = int64(castValue)
		return
	case uint:
		output = int64(castValue)
		return
	case uint8:
		output = int64(castValue)
		return
	case uint16:
		output = int64(castValue)
		return
	case uint32:
		output = int64(castValue)
		return
	case uint64:
		output = int64(castValue)
		return
	case float32:
		output = int64(castValue)
		return
	case float64:
		output = int64(castValue)
		return
	case bool:
		output = int64(0)
		if castValue {
			output = int64(1)
		}
		return
	case nil:
		output = int64(0)
		return
	default:
		err = NewCastError("Could not convert to int")
	}
	return
}
522421
func (f Field) Int() (int, error) {
	x, err := strconv.ParseInt(f.value, 10, 32)
	return int(x), err
}
37547
func (r *MockResult) Int(i int) int {
	if r.Contains(i) {
		return r.Result[i].(int)
	} else {
		return 0
	}
}
1327687
func (c *IniConfigContainer) Int(key string) (int, error) {
	return strconv.Atoi(c.getdata(key))
}
951905
func (p *siprng) Int(from, to int) int {
	return p.Intn(to+1-from) + from
}
807568
func (dec *Decoder) Int(v *int) error {
	err := dec.decodeInt(v)
	if err != nil {
		return err
	}
	dec.called |= 1
	return nil
}
126913
func (j *JsonQuery) Int(s ...string) (int, error) {
	val, err := rquery(j.blob, s...)
	if err != nil {
		return 0, err
	}
	return intFromInterface(val)
}
452686
func (c *Configure) Int(name string, def int, description string) *int {
	i := new(int)
	c.IntVar(i, name, def, description)

	return i
}