pike.git / lib / modules / Standards.pmod / BSON.pmod / Binary.pike

version» Context lines:

pike.git/lib/modules/Standards.pmod/BSON.pmod/Binary.pike:7:       // NB: Code duplication from module.pmod to avoid circular dependencies.    private constant BINARY_OLD = 0x02;       //!    protected void create(string _data, int|void _subtype)    {    subtype = _subtype;    if(subtype == BINARY_OLD)    { -  if( !sscanf(data, "%-4H", data) ) +  if( !sscanf(_data, "%-4H", data) )    throw(Error.Generic("old binary data length does not match actual data length.\n"));    }    else    data = _data;    }       int get_subtype()    {    return subtype;    }
pike.git/lib/modules/Standards.pmod/BSON.pmod/Binary.pike:35:    {    if(subtype == BINARY_OLD)    return sizeof(data) + 4;    else    return sizeof(data);    }       protected mixed cast(string type)    {    if(type == "string") -  { -  // the docs are a little sketchy about this, do we need to NULL -  // terminate? -  if(subtype == BINARY_OLD) -  return sprintf("%-4H", data); -  else return data; -  } +  return data;    return UNDEFINED;    }