Pol  Revision:4b29d2b
passert.h File Reference
#include "compilerspecifics.h"
#include <string>

Go to the source code of this file.

Namespaces

 Pol
 
 Pol::Clib
 

Macros

#define INC_PASSERT_PARANOID   INC_PASSERT
 
#define passert(exp)
 
#define passert_always(exp)
 
#define passert_always_r(exp, reason)
 
#define passert_paranoid(exp)
 
#define passert_paranoid_r(exp, reason)
 
#define passert_r(exp, reason)
 

Functions

void Pol::Clib::force_backtrace (bool complete)
 
void Pol::Clib::passert_failed (const char *expr, const char *file, unsigned line)
 
void Pol::Clib::passert_failed (const char *expr, const std::string &reason, const char *file, unsigned line)
 

Detailed Description

History
  • 2005/01/17 Shinigami: added passert*_r, same as passert* with additional param "reason"
  • 2005/09/16 Shinigami: scripts_thread_script* moved to passert
Warning
This header is part of the PCH
Remove the include in all StdAfx.h files or live with the consequences :)

Definition in file passert.h.

Macro Definition Documentation

#define INC_PASSERT_PARANOID   INC_PASSERT

Definition at line 25 of file passert.h.

#define passert (   exp)
Value:
(void)( ( exp ) || ( Clib::passert_failed( #exp, __FILE__, __LINE__ ), 0 ) ); \
#define passert_assume(x)
void passert_failed(const char *expr, const char *file, unsigned line)
Definition: passert.cpp:65

Works the same way as assert(), but is not stripped at non-debug compilation time. Use this for non-crucial assertions.

Definition at line 62 of file passert.h.

Referenced by Pol::Bscript::EScriptProgram::add_ins_dbg_info(), Pol::Testing::add_item(), Pol::Core::add_item_to_world(), Pol::Testing::add_multi(), Pol::Bscript::EScriptProgram::addToken(), Pol::Items::UWeapon::anim(), Pol::Mobile::Character::attribute(), Pol::Mobile::AttributeValue::base(), Pol::Multi::UBoat::boatshape(), Pol::Bscript::BObject::BObject(), Pol::Core::check_blocked(), Pol::Core::check_scheduled_tasks(), Pol::Clib::BinaryFile::Close(), Pol::Core::ClrCharacterWorldPosition(), Pol::Items::UWeapon::consume_projectile(), Pol::Bscript::BStruct::copy(), Pol::Items::UArmor::covers(), Pol::Items::Item::create(), Pol::Accounts::create_new_account(), Pol::Mobile::Character::CustomHousingMove(), Pol::Items::UWeapon::descriptor(), Pol::Core::UObject::destroy(), Pol::Accounts::duplicate_account(), Pol::Module::ECharacterRefObjImp::ECharacterRefObjImp(), Pol::Bscript::Executor::exec(), Pol::Bscript::Executor::execInstr(), Pol::Items::fast_find_doordesc(), Pol::Clib::BinaryFile::FileSize(), Pol::Core::UContainer::find(), Pol::Core::find_giveitem_container(), Pol::Core::Menu::find_menu(), Pol::Items::find_multidesc(), Pol::Core::UContainer::find_toplevel(), Pol::Plib::StaticServer::findstatic(), Pol::Core::ResourceRegion::get_harvest_difficulty(), Pol::Plib::FileMapServer::GetMapCell(), Pol::Plib::InMemoryMapServer::GetMapCell(), Pol::Plib::MapServer::GetMapShapes(), Pol::Bscript::Compiler::getMethodArguments(), Pol::Bscript::Executor::getParamImp(), Pol::Bscript::Executor::getParamImp2(), Pol::Plib::StaticServer::getstatics(), Pol::Bscript::Compiler::getUserArgs(), Pol::Core::getzone(), Pol::Bscript::Executor::GlobalVar(), Pol::Core::handle_menu_selection(), Pol::Core::ResourceRegion::harvest_resource(), Pol::Items::UWeapon::hit_sound(), Pol::Mobile::NPC::inform_imoved(), Pol::Mobile::NPC::inform_moved(), Pol::Bscript::Executor::ins_makeLocal(), Pol::Mobile::Character::is_attackable(), Pol::Items::UWeapon::is_projectile(), Pol::Bscript::Compiler::isUserFunc(), Pol::Bscript::EScriptProgram::leaveblock(), Pol::Plib::RawMap::load_full_map(), Pol::Plib::MapServer::LoadSecondLevelIndex(), Pol::Bscript::Executor::LocalVar(), Pol::Bscript::Executor::makeObj(), Pol::Module::UOExecutorModule::mf_Detach(), Pol::Items::UWeapon::miss_sound(), Pol::Items::UWeapon::mounted_anim(), Pol::Core::move_multi_in_world(), Pol::Core::MoveCharacterWorldPosition(), Pol::Core::MoveItemWorldPosition(), Pol::Multi::UBoat::multi_ifturn(), Pol::Multi::UMulti::multidef(), Pol::Multi::MultiDefByMultiID(), Pol::Core::OneShotTask::OneShotTask(), Pol::Clib::BinaryFile::Open(), Pol::Core::process_data(), Pol::Items::UWeapon::projectile_anim(), Pol::Items::UWeapon::projectile_sound(), Pol::Core::WornItemsContainer::PutItemOnLayer(), Pol::Core::UCorpse::PutItemOnLayer(), Pol::Plib::RawMap::rawinfo(), Pol::Crypt::CCryptBlowfish::Receive(), Pol::Crypt::CCryptBlowfishTwofish::Receive(), Pol::Crypt::CCryptTwofish::Receive(), Pol::Network::Client::recv_remaining(), Pol::Core::remove_item_from_world(), Pol::Core::remove_multi_from_world(), Pol::Core::WornItemsContainer::RemoveItemFromLayer(), Pol::Core::UCorpse::RemoveItemFromLayer(), Pol::Mobile::Character::schedule_spell(), Pol::Clib::BinaryFile::Seek(), Pol::Network::PacketRegistry::set_handler(), Pol::Items::UWeapon::set_hit_script(), Pol::Core::SetCharacterWorldPosition(), Pol::Mobile::Character::spend_gold(), Pol::Core::UContainer::spill_contents(), Pol::Mobile::NPC::start_script(), Pol::Mobile::Character::start_script(), Pol::Core::tasks_thread(), Pol::Plib::test_check_version(), Pol::Items::UArmor::tmplzones(), Pol::Multi::UBoat::UBoat(), Pol::Mobile::Character::unequip(), Pol::Mobile::Character::vital(), Pol::Bscript::EScriptProgram::write(), Pol::Core::zone_convert(), Pol::Core::UObject::~UObject(), and Pol::Module::UOExecutorModule::~UOExecutorModule().

#define passert_always (   exp)
Value:
(void)( ( exp ) || ( Clib::passert_failed( #exp, __FILE__, __LINE__ ), 0 ) ); \
#define passert_assume(x)
void passert_failed(const char *expr, const char *file, unsigned line)
Definition: passert.cpp:65

Works the same way as assert(), but is guaranteed to be never stripped. Use this for critical assertions that can't be ignored.

Definition at line 80 of file passert.h.

Referenced by Pol::Module::PolCore::call_method(), Pol::Items::Item::check_unequip_script(), Pol::Items::Item::check_unequiptest_scripts(), Pol::Core::UContainer::consume_sumof_objtype_noninuse(), Pol::Core::PropHolderContainer< Storage >::estimateSize(), Pol::Items::Item::extricate(), Pol::Core::find_legal_item(), Pol::Bscript::Expression::get_num_tokens(), Pol::Core::init_ipc_vars(), Pol::threadhelp::init_threadhelp(), Pol::Core::landtile_flags(), Pol::Core::landtile_uoflags(), Pol::Mobile::load_attributes_cfg(), Pol::Core::load_landtile_entry(), Pol::Core::load_tile_entry(), Pol::Core::load_vitals_cfg(), Pol::Core::WornItemsContainer::make_ref(), Pol::Core::newstat_dont_add(), Pol::Core::polsem_lock(), Pol::Core::polsem_unlock(), Pol::UoConvert::ProcessSolidBlock(), Pol::Bscript::Executor::pushArg(), Pol::Crypt::CCryptBlowfish::Receive(), Pol::Crypt::CCryptBlowfishTwofish::Receive(), Pol::Crypt::CCryptTwofish::Receive(), Pol::Core::UContainer::remove(), Pol::Core::run_script_to_completion(), Pol::Core::DynProps::setProperty(), Pol::Core::DynProps::setPropertyPointer(), Pol::Core::singleclick(), Pol::Core::test_decode(), Pol::Network::Client::transmit_encrypted(), Pol::Mobile::PrivUpdater::~PrivUpdater(), and Pol::Core::UContainer::~UContainer().

#define passert_always_r (   exp,
  reason 
)
#define passert_paranoid (   exp)
Value:
(void)( ( exp ) || ( Clib::passert_failed( #exp, __FILE__, __LINE__ ), 0 ) ); \
#define passert_assume(x)
void passert_failed(const char *expr, const char *file, unsigned line)
Definition: passert.cpp:65

This works the same way as assert(), but is guaranteed to be stripped at non-debug compilation time Use this for trivial assertions: "I've proved it's impossible, but ..."

Definition at line 95 of file passert.h.

Referenced by Pol::Core::check_scheduled_tasks(), Pol::Core::handle_menu_selection(), Pol::Module::ClilocExecutorModule::mf_PrintTextAboveCL(), Pol::Module::ClilocExecutorModule::mf_PrintTextAbovePrivateCL(), Pol::Module::ClilocExecutorModule::mf_SendSysMessageCL(), Pol::Bscript::BLong::operator new(), Pol::Bscript::Double::operator new(), and Pol::Core::ScriptScheduler::run_ready().

#define passert_paranoid_r (   exp,
  reason 
)
Value:
(void)( ( exp ) || ( Clib::passert_failed( #exp, reason, __FILE__, __LINE__ ), 0 ) ); \
#define passert_assume(x)
void passert_failed(const char *expr, const char *file, unsigned line)
Definition: passert.cpp:65

Just like passert_paranoid(), but allows to specify a reason as additional parameter

Definition at line 99 of file passert.h.

#define passert_r (   exp,
  reason 
)
Value:
(void)( ( exp ) || ( Clib::passert_failed( #exp, reason, __FILE__, __LINE__ ), 0 ) ); \
#define passert_assume(x)
void passert_failed(const char *expr, const char *file, unsigned line)
Definition: passert.cpp:65

Just like passert(), but allows to specify a reason as additional parameter

Definition at line 66 of file passert.h.

Referenced by Pol::Core::client_io_thread(), Pol::Mobile::Character::equip(), Pol::Items::find_container_desc(), Pol::Bscript::Executor::getParam(), Pol::Bscript::Executor::getParamImp(), Pol::Bscript::Executor::getParamImp2(), Pol::Plib::RawMap::load_full_map(), Pol::Core::load_realms(), Pol::Crypt::TwoFish::MakeKey(), Pol::Plib::RawMap::rawinfo(), and Pol::Clib::Socket::select().