pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*-   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin.cmod,v 1.94 2002/10/11 01:39:29 nilsson Exp $ + || $Id: builtin.cmod,v 1.95 2002/10/15 09:12:49 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "opcodes.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"
pike.git/src/builtin.cmod:1407:       PIKEFUN mixed cast( string type )    {    struct pike_string *string_t;    struct pike_string *int_t;    MAKE_CONSTANT_SHARED_STRING( string_t, "string" );    MAKE_CONSTANT_SHARED_STRING( int_t, "int" );       if( type == string_t )    { +  free_string(string_t); +  free_string(int_t);    pop_n_elems( args );    if( Pike_fp->current_object->refs != 1 )    f_Buffer_get_copy( 0 );    else    f_Buffer_get( 0 );    return;    }    -  +  free_string(string_t); +     if( type == int_t )    {    struct Buffer_struct *str = THIS; -  +  free_string(int_t);    pop_stack();    if( Pike_fp->current_object->refs != 1 )    f_Buffer_get_copy( 0 );    else    f_Buffer_get( 0 );    o_cast_to_int( );    return;    } -  +  free_string(int_t);    Pike_error("Cannot cast to %s\n", type->str );    }       PIKEFUN object `+( string what )    {    struct Buffer_struct *str = THIS, *str2;    struct object *res = clone_object( Buffer_program, 0 );       if( str->str.s )    {
pike.git/src/builtin.cmod:1504:    struct pike_string *str = THIS->str.s;    if( str )    {    ptrdiff_t len = str->len;    if( len > 0 )    {    char *d = (char *)str->str;    switch( str->size_shift )    {    case 0: -  RETURN make_shared_binary_string(d,len); +  RETURN make_shared_binary_string0((p_wchar0 *)d,len);    break;    case 1: -  RETURN make_shared_binary_string1((short*)d,len>>1); +  RETURN make_shared_binary_string1((p_wchar1 *)d,len>>1);    break;    case 2: -  RETURN make_shared_binary_string2((int*)d,len>>2); +  RETURN make_shared_binary_string2((p_wchar2 *)d,len>>2);    break;    }    }    }    push_text("");    return;    }       /*! @decl string get()    *!