Branch: Tag:

2014-08-26

2014-08-26 12:10:32 by Per Hedbor <ph@opera.com>

Stricter return types for cast.

This, if nothing else, makes the documentation cleaner.

789:   static void stat_indices(INT32 args);   static void stat_values(INT32 args);    + /*! @decl mapping(string:int)|array cast (string to); +  *! +  *! Convert the stat object to a mapping or array. +  */   static void stat_cast(INT32 args)   {    struct pike_string *type;
1036:    tOr(tFunc(tInt06 tSetvar(0,tInt),tVar(0)),    tFunc(tString tSetvar(1,tOr(tInt,tString)),tVar(1))), 0);    -  ADD_FUNCTION("cast",stat_cast,tFunc(tStr,tArray),ID_PROTECTED); +  ADD_FUNCTION("cast",stat_cast,tFunc(tStr,tOr(tMapping,tArray)),ID_PROTECTED);    ADD_FUNCTION("_sprintf",stat__sprintf,    tFunc(tInt tOr(tVoid,tMapping),tString),0);    ADD_FUNCTION("_indices",stat_indices,