Branch: Tag:

2009-10-31

2009-10-31 13:37:34 by Martin Stjernholm <mast@lysator.liu.se>

Improved OBJ_COUNT_DEBUG to cover more common objects.

Also fixed some _sprintf's that didn't adhere to the convention.

Rev: server/base_server/module.pike:1.239
Rev: server/base_server/prototypes.pike:1.260
Rev: server/etc/include/roxen.h:1.34

5:   #include <config.h>   #include <module.h>   #include <module_constants.h> - constant cvs_version="$Id: prototypes.pike,v 1.259 2009/10/13 09:11:45 mast Exp $"; + constant cvs_version="$Id: prototypes.pike,v 1.260 2009/10/31 13:37:34 mast Exp $";      #ifdef DAV_DEBUG   #define DAV_WERROR(X...) werror(X)
170:    {    return values(copies);    } -  string _sprintf( ) { return "ModuleCopies("+sizeof(copies)+")"; } +  string _sprintf (int flag) +  { +  return flag == 'O' && ("ModuleCopies("+sizeof(copies)+")");    } -  + }      // Simulate an import of useful stuff from Parser.XML.Tree.   protected constant SimpleNode = Parser.XML.Tree.SimpleNode;
296:    return res;    }    +  DECLARE_OBJ_COUNT; +     protected string _sprintf (int flag)    {    return flag == 'O' && -  sprintf ("DAVLock(%O on %O, %s, %s%s)", locktoken, path, +  sprintf ("DAVLock(%O on %O, %s, %s%s)" + OBJ_COUNT, locktoken, path,    recursive ? "rec" : "norec",    lockscope == "DAV:exclusive" ? "excl" :    lockscope == "DAV:shared" ? "shared" :
325:       class Priority    { -  string _sprintf() +  string _sprintf (int flag)    { -  return "Priority()"; +  return flag == 'O' && "Priority()";    }       array (RoxenModule) url_modules = ({ });
469:    AuthModule find_auth_module( string name );    UserDB find_user_database( string name );    -  protected string _sprintf( ) +  DECLARE_OBJ_COUNT; +  +  protected string _sprintf (int flag)    { -  return "Configuration("+name+")"; +  return flag == 'O' && ("Configuration("+name+")" + OBJ_COUNT);    }   }   
567:    return 1;    }    +  DECLARE_OBJ_COUNT; +     protected string _sprintf( int f )    {    switch( f )    {    case 'O': -  return sprintf( "FakedVariables(%O)", real_variables ); +  return sprintf( "FakedVariables(%O)" + OBJ_COUNT, real_variables );    default:    return sprintf( sprintf("%%%c", f ), real_variables );    }
631:       protected string _sprintf(int c, mapping|void attrs)    { -  return sprintf("PrefLanguages(%O)", get_languages()); +  return c == 'O' && sprintf("PrefLanguages(%O)", get_languages());    }       void register_known_language_forks(multiset(string) langs, void|RequestID id)
821: Inside #if defined(ID_CACHEKEY_DEBUG)
  {   #ifdef ID_CACHEKEY_DEBUG    RoxenDebug.ObjectMarker __marker = RoxenDebug.ObjectMarker (this); + #else +  DECLARE_OBJ_COUNT;   #endif       protected array(array(CacheActivationCB|array)) activation_cbs;
925: Inside #if defined(ID_CACHEKEY_DEBUG)
  #ifdef ID_CACHEKEY_DEBUG    __marker ? "[" + __marker->count + "]" : "",   #else -  "" +  OBJ_COUNT   #endif    );    }
1015: Inside #if defined(ID_OBJ_DEBUG)
  {   #ifdef ID_OBJ_DEBUG    RoxenDebug.ObjectMarker __marker = RoxenDebug.ObjectMarker (this); + #else +  DECLARE_OBJ_COUNT;   #endif       Configuration conf;
1372:    return real_cookies + eaten;    }    +  DECLARE_OBJ_COUNT; +     protected string _sprintf(int fmt)    { -  return fmt == 'O' && sprintf("CookieJar(%O)", +  return fmt == 'O' && sprintf("CookieJar(%O)" + OBJ_COUNT,    RequestID::this && real_cookies);    }    }
3092: Inside #if defined(ID_OBJ_DEBUG)
   return flag == 'O' && ("RequestID(" + (raw_url||"") + ")"   #ifdef ID_OBJ_DEBUG    + (__marker ? "[" + __marker->count + "]" : "") + #else +  + OBJ_COUNT   #endif    );    }