Commit 84f1fbb9 authored by Raphael Riebl's avatar Raphael Riebl

per_support: rename per_long_range* to per_imax_range*

parent 98b176f1
......@@ -657,7 +657,7 @@ INTEGER_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
ASN__DECODE_STARVED;
ASN_DEBUG("Got value %lu + low %ld",
uvalue, ct->lower_bound);
if(per_long_range_unrebase(uvalue, ct->lower_bound,
if(per_imax_range_unrebase(uvalue, ct->lower_bound,
ct->upper_bound, &svalue)
|| asn_long2INTEGER(st, svalue)) {
ASN__DECODE_FAILED;
......@@ -788,7 +788,7 @@ INTEGER_encode_uper(const asn_TYPE_descriptor_t *td,
}
v = (unsigned long)value - (unsigned long)ct->lower_bound;
} else {
if(per_long_range_rebase(value, ct->lower_bound, ct->upper_bound, &v)) {
if(per_imax_range_rebase(value, ct->lower_bound, ct->upper_bound, &v)) {
ASN__ENCODE_FAILED;
}
}
......
......@@ -216,7 +216,7 @@ uper_put_nslength(asn_per_outp_t *po, size_t length) {
}
static int
per__long_range(intmax_t lb, intmax_t ub, uintmax_t *range_r) {
per__imax_range(intmax_t lb, intmax_t ub, uintmax_t *range_r) {
uintmax_t bounds_range;
if((ub < 0) == (lb < 0)) {
bounds_range = ub - lb;
......@@ -232,12 +232,12 @@ per__long_range(intmax_t lb, intmax_t ub, uintmax_t *range_r) {
}
int
per_long_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output) {
per_imax_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output) {
uintmax_t range;
assert(lb <= ub);
if(v < lb || v > ub || per__long_range(lb, ub, &range) < 0) {
if(v < lb || v > ub || per__imax_range(lb, ub, &range) < 0) {
/* Range error. */
return -1;
}
......@@ -269,10 +269,10 @@ per_long_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output) {
}
int
per_long_range_unrebase(uintmax_t inp, intmax_t lb, intmax_t ub, intmax_t *outp) {
per_imax_range_unrebase(uintmax_t inp, intmax_t lb, intmax_t ub, intmax_t *outp) {
uintmax_t range;
if(per__long_range(lb, ub, &range) != 0) {
if(per__imax_range(lb, ub, &range) != 0) {
return -1;
}
......
......@@ -81,9 +81,9 @@ typedef struct asn_bit_outp_s asn_per_outp_t;
* -1: Conversion failed due to range problems.
* 0: Conversion was successful.
*/
int per_long_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output);
int per_imax_range_rebase(intmax_t v, intmax_t lb, intmax_t ub, uintmax_t *output);
/* The inverse operation: restores the value by the offset and its bounds. */
int per_long_range_unrebase(uintmax_t inp, intmax_t lb, intmax_t ub, intmax_t *outp);
int per_imax_range_unrebase(uintmax_t inp, intmax_t lb, intmax_t ub, intmax_t *outp);
/* X.691-2008/11, #11.5 */
int uper_put_constrained_whole_number_u(asn_per_outp_t *po, unsigned long v, int nbits);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment