Changeset 31391 in project


Ignore:
Timestamp:
09/11/14 21:50:48 (5 years ago)
Author:
sjamaan
Message:

numbers: Remove now-unused functions for copying and allocation of zeroed bignums

Location:
release/4/numbers/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/numbers/trunk/numbers-c.c

    r31390 r31391  
    186186
    187187static bignum_type
    188 bignum_allocate_zeroed(bignum_length_type length, int negative_p)
    189 {
    190   assert((length >= 0) || (length < BIGNUM_RADIX));
    191   {
    192     bignum_type result;
    193     bignum_digit_type *digits;
    194     bignum_digit_type *scan;
    195     bignum_digit_type *end;
    196     digits=(bignum_digit_type *)C_malloc(sizeof(bignum_digit_type)*(length+1));
    197  
    198     if(digits == NULL) {
    199       fprintf(stderr, "out of memory - can not allocate number");
    200       exit(EXIT_FAILURE);
    201     }
    202 
    203     result = (bignum_type)digits;
    204     BIGNUM_SET_HEADER(result, length, negative_p);
    205     scan = BIGNUM_START_PTR(result);
    206     end = scan + length;
    207     while (scan < end)
    208       (*scan++) = 0;
    209     return (result);
    210   }
    211 }
    212 
    213 static bignum_type
    214188bignum_allocate_from_fixnum(C_word fix)
    215189{
     
    272246    }
    273247  return (bignum);
    274 }
    275 
    276 /* Copying */
    277 
    278 static bignum_type
    279 bignum_copy(bignum_type source)
    280 {
    281   bignum_type target =
    282     (bignum_allocate ((BIGNUM_LENGTH (source)), (BIGNUM_NEGATIVE_P (source))));
    283   bignum_destructive_copy (source, target);
    284   return (target);
    285248}
    286249
  • release/4/numbers/trunk/numbers-c.h

    r31390 r31391  
    2828/* Internal bignum interface */
    2929static bignum_type bignum_allocate(bignum_length_type, int);
    30 static bignum_type bignum_allocate_zeroed(bignum_length_type, int);
    3130static bignum_type shorten_bignum(bignum_type, bignum_length_type);
    3231static bignum_type bignum_trim(bignum_type);
    33 static bignum_type bignum_copy(bignum_type);
    3432static void bignum_destructive_copy(bignum_type, bignum_type);
    3533static bignum_type bignum_new_sign(bignum_type, int);
Note: See TracChangeset for help on using the changeset viewer.