Branch: Tag:

2014-09-30

2014-09-30 19:14:45 by Per Hedbor <ph@opera.com>

Stricter types in buffer.cmod

26:   #define DEFAULT_CMOD_STORAGE static   DECLARATIONS    -  +    struct sysmem {    unsigned char *p;    size_t size;
1214:    *! @endmixed    */    -  PIKEFUN IOBuffer add_hstring( string|object|array str, int size_size ) +  /* we can not use the actual type here. +  +  the reason is that this class is loaded before the master is, so +  we cannot possibly use things that require the master (such as +  resolving things.) +  */ +  PIKEFUN IOBuffer add_hstring( string|object|array(string|IOBuffer|array) str, int size_size )    {    IOBuffer *io = THIS;    size_t len = io_svalue_len(io, str);
2281:    *! inside itself, this means that it can only grow. So do not keep    *! the rewind key when it is not needed.    */ -  PIKEFUN object rewind_on_error() +  PIKEFUN IOBuffer.RewindKey rewind_on_error()    {    push_object( io_create_rewind_key( THIS, 1 ) );    }    -  PIKEFUN object rewind_key() +  PIKEFUN IOBuffer.RewindKey rewind_key()    {    push_object( io_create_rewind_key( THIS, 0 ) );    }