Branch: Tag:

2014-04-04

2014-04-04 23:02:44 by Martin Nilsson <nilsson@opera.com>

Revert the BitString cast support. Make set_length return the object.

435:    }       //! Sets the length of the bit string to @[len] number of bits. -  int set_length(int len) { +  this_program set_length(int len) {    if (len)    {    value = value[..(len + 7)/8];
447:    unused = 0;    value = "";    } +  return this;    }       this_program decode_primitive(string(0..255) contents,
465:    return this;    }    -  protected mixed cast(string to) -  { -  switch(to) -  { -  case "int": -  return Gmp.bignum(value,256)>>unused; -  } -  return UNDEFINED; -  } -  +     protected string _sprintf(int t) {    int size = sizeof(value)*8-unused;    return t=='O' && sprintf("%O(%d %0"+size+"s)", this_program, size,