src/lib/gscplftaaux/rts_udaf.c
gs_int64_t to_llong(struct gs_string *v){
	gs_int64_t ret=0;
	gs_uint8_t d;
	int c;
	int neg=1;

	if(v->length < 1)
		return 0;
	d = v->data[0];
	if(d=='-'){
		neg=-1;
	}else{
		ret = (d>='0' && d<='9')*(d-'0');
	}

	for(c=1;c<v->length;++c){
		d = v->data[c];
		ret = 10*ret+(d>='0' && d<='9')*(d-'0');
	}

	return neg*ret;
}
//	Convert an string to an integer
Convert an string to an integer
Convert an string to an integer
gs_int64_t to_llong(struct gs_string *v){
	gs_int64_t ret=0;
	gs_uint8_t d;
	int c;
	int neg=1;
	if(v->length < 1)
		return 0;
	d = v->data[0];
	if(d=='-'){
		neg=-1;
	}else{
		ret = (d>='0' && d<='9')*(d-'0');
	}
	for(c=1;c<v->length;++c){
		d = v->data[c];
		ret = 10*ret+(d>='0' && d<='9')*(d-'0');
	}
	return neg*ret;
}
gs_int64_t to_llong ( struct gs_string * v ) { gs_int64_t ret = 0 ; gs_uint8_t d ; int c ; int neg = 1 ; if ( v -> length < 1 ) return 0 ; d = v -> data [ 0 ] ; if ( d == ' ' ) { neg = -1 ; } else { ret = ( d >= ' ' && d <= ' ' ) * ( d - ' ' ) ; } for ( c = 1 ; c < v -> length ; ++ c ) { d = v -> data [ c ] ; ret = 10 * ret + ( d >= ' ' && d <= ' ' ) * ( d - ' ' ) ; } return neg * ret ; }
Convert an string to an integer
Convert an string to an integer