本文整理汇总了C++中STOP函数的典型用法代码示例。如果您正苦于以下问题:C++ STOP函数的具体用法?C++ STOP怎么用?C++ STOP使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了STOP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PROFILE
CCity::CCity()
{
PROFILE("CCity::CCity()");
m_nImageID = -1;
m_nGoldTribute = 0;
m_nCurrentOwner = -1;
m_dwColor = 0;
m_bIsAttackable = false;
m_ptAttackPoint.x = 0;
m_ptAttackPoint.y = 0;
STOP("CCity::CCity()");
}
示例2: struct_Create
/*创建一个对象,传入该对象对应的原型的ID,并传入构造函数所需的参数(如果有的话)*/
Var struct_Create(int id,Var init_arg[],int args)
{
Var result;
result.content.type=VAR_TYPE_OBJ;
result.content.var_value.struct_obj.handle_value=create_instance(id);
var_SetObjId (&result,id);
/*若存在初始化函数,则调用它*/
if(struct_list[id].initializer_index>=0)
{
if(struct_list[id].initializer_acc==STRUCT_PRIVATE && env_index!=id)
{
STOP("private initializer only can be assigned inside\n");
}
int old_env =env_index;
env_index=id;/*环境索引改变为类内部*/
/*函数栈压入*/
vm_RTstackPush();
/*获取构造函数*/
Function *f=func_get_by_index(struct_list[id].initializer_index);
if(f->arg_counts!=args)
{
STOP("struct constructor not matched!");
}
self_ptr=result;
/*传入参数*/
int i;
for(i=0; i<f->arg_counts; i++)
{
vm_rt_stack_var_cast_set ( i,init_arg[i]);
}
IL_list * old_list=current_list;
func_PlainInvoke ( struct_list[id].initializer_index);/*执行构造函数*/
current_list=old_list;
/*函数的栈弹出*/
vm_RTstackPop();
self_ptr.content.type=VAR_TYPE_NILL;
env_index=old_env;/*维持环境*/
}
return result;
}
示例3: astinvad_sh_port_4_w
/* LT 20-3-1998 */
void astinvad_sh_port_4_w(int offset, int data)
{
static int port4State;
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
bitsChanged = port4State ^ data;
bitsGoneHigh = bitsChanged & data;
bitsGoneLow = bitsChanged & ~data;
port4State = data;
if ( bitsGoneHigh & OUT_PORT_4_UFO ) PLAY( SND_UFO, 1 );
if ( bitsGoneLow & OUT_PORT_4_UFO ) STOP( SND_UFO );
if ( bitsGoneHigh & OUT_PORT_4_SHOT ) PLAY( SND_SHOT, 0 );
if ( bitsGoneLow & OUT_PORT_4_SHOT ) STOP( SND_SHOT );
if ( bitsGoneHigh & OUT_PORT_4_BASEHIT )
{
PLAY( SND_BASEHIT, 0 );
/* turn all colours red here */
invaders_screen_red_w(1);
}
if ( bitsGoneLow & OUT_PORT_4_BASEHIT )
{
STOP( SND_BASEHIT );
/* restore colours here */
invaders_screen_red_w(0);
}
if ( bitsGoneHigh & OUT_PORT_4_INVADERHIT ) PLAY( SND_INVADERHIT, 0 );
if ( bitsGoneLow & OUT_PORT_4_INVADERHIT ) STOP( SND_INVADERHIT );
if ((bitsChanged & OUT_PORT_4_UNUSED) && errorlog) fprintf(errorlog, "Snd Port 4 = %02X\n", data & OUT_PORT_4_UNUSED);
}
示例4: namei_init
void
namei_init(void) {
START(namei,init);
nc = name_cache_init(4096,64);
name_cache_removefunc(namei_cache_remove_func);
#ifdef CACHEDLOOKUP
// kprintf("Namei with cached lookups\n");
#endif
assert(nc);
//atexit(pr_namei_stat);
STOP(namei,init);
}
示例5: fnMotoST
// 电机停止
int fnMotoST(void)
{
STOP(x)
statusL |= 0x20; // 清正调状态
statusL |= 0x10; // 清反调状态
statusH |= 0x04; // 清开臂标志
statusH |= 0x08; // 清收臂标志
zbFlag = ModeNull;
STOP(x)
if(Task[0] == ModeST)
TaskCreate(ModeNull);
return ModeST;
}
示例6: return
//----------------------------------------------------------------------
long MC_TextureManager::saveTexture (DWORD textureIndex, const char *textureFullPathName)
{
if ((MC_MAXTEXTURES <= textureIndex) || (NULL == masterTextureNodes[textureIndex].textureData))
{
return (~NO_ERR);
}
File textureFile;
long textureFileOpenResult = textureFile.create(textureFullPathName);
if (NO_ERR != textureFileOpenResult)
{
textureFile.close();
return textureFileOpenResult;
}
{
if (masterTextureNodes[textureIndex].width == 0)
{
textureFile.close();
return (~NO_ERR); //These faces have no texture!!
}
{
//------------------------------------------
// Badboys are now LZ Compressed in texture cache.
long origSize = LZDecomp(MC_TextureManager::lzBuffer2,(MemoryPtr)masterTextureNodes[textureIndex].textureData,masterTextureNodes[textureIndex].lzCompSize);
if (origSize != (long)(masterTextureNodes[textureIndex].width & 0x0fffffff))
STOP(("Decompressed to different size from original! Txm:%s Width:%d DecompSize:%d",masterTextureNodes[textureIndex].nodeName,(masterTextureNodes[textureIndex].width & 0x0fffffff),origSize));
if (origSize >= MAX_LZ_BUFFER_SIZE)
STOP(("Texture TOO large: %s",masterTextureNodes[textureIndex].nodeName));
textureFile.write(MC_TextureManager::lzBuffer2, origSize);
}
textureFile.close();
}
return NO_ERR;
}
示例7: serial_port
void GPSDATA::PASER_GPS::startGPS() {
if(conf.GPS_ENABLE == 0){
return;
}
bool error;
bool m_ReadingStarted = false;
// repeating reconnection if problems arise
do {
error = false;
try {
// create the serial device, note it takes the io service and the port name
m_Port = new serial_port(m_IO, conf.GPS_SERIAL_PORT);
// m_Port = new serial_port(m_IO, "/dev/ttyS2");
} catch (...) {
error = true;
PASER_LOG_WRITE_LOG(PASER_LOG_ERROR, "Problem wile trying to access port %s\n", conf.GPS_SERIAL_PORT.c_str());
boost::xtime xt;
boost::xtime_get(&xt, boost::TIME_UTC);
xt.nsec += 1000000000;
boost::thread::sleep(xt);
// after some time try to reconnect;
}
} while (error);
// prepare settings
serial_port_base::baud_rate BAUD(conf.GPS_SERIAL_SPEED); // what baud rate do we communicate at
// serial_port_base::baud_rate BAUD(4800); // what baud rate do we communicate at
serial_port_base::character_size CSIZE2(8); // how big is each "packet" of data (default is 8 bits)
serial_port_base::flow_control FLOW(serial_port_base::flow_control::none); // what flow control is used (default is none)
serial_port_base::parity PARITY(serial_port_base::parity::none); // what parity is used (default is none)
serial_port_base::stop_bits STOP(serial_port_base::stop_bits::one); // how many stop bits are used (default is one)
// go through and set all the options as we need them
// all of them are listed, but the default values work for most cases
m_Port->set_option(BAUD);
m_Port->set_option(CSIZE2);
m_Port->set_option(FLOW);
m_Port->set_option(PARITY);
m_Port->set_option(STOP);
if (!m_ReadingStarted) {
boost::thread t(boost::bind(&boost::asio::io_service::run, &m_IO));
boost::asio::async_read_until(*m_Port, b, '\n',
boost::bind(&GPSDATA::PASER_GPS::Handler, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
m_ReadingStarted = true;
}
}
示例8: namei_lookup
int
namei_lookup(struct file *old_filp, char *name, struct file *new_filp) {
struct file *filp = NULL;
static int malloc_count = 0;
static int mesg = 1;
int error;
START(namei,lookup);
namei_lookup_count++;
if (namei_cache_lookup(old_filp,name,&filp)) {
*new_filp = *filp;
} else {
/* miss */
error = DOOP(old_filp,lookup,(old_filp,name,new_filp));
if (error) {
// NAMEI_RELEASE(old_filp,&release);
#ifdef NAMEIDEBUG
printf("LOOKUP old_filp %s failed errno: %s\n",next,strerror(errno));
#endif
STOP(namei,lookup);
return -1;
}
if (mesg) filp = (struct file *)__malloc(sizeof (struct file));
if (filp == 0 && mesg) {
kprintf("malloc failed (on try: %d\n",malloc_count);
mesg = 0;
} else {
malloc_count++;
*filp = *new_filp;
namei_cache_add(old_filp,name,filp);
}
}
STOP(namei,lookup);
return 0;
}
示例9: Unsweep
//
// Unsweep for a sight map
//
static void Unsweep(Map *map)
{
START(unSweepTime);
PREFETCH(&__prefetch);
// Last sweep position
S32 tileX = map->lastX;
S32 tileZ = map->lastZ;
// Last sweep radius
S32 r = map->lastR;
// Get viewing mask for lower layer
U8 *mapLo = map->GetByteMap(Map::LV_LO);
U8 maskLo = map->GetBitMask(Map::LV_LO);
// Dirty cells that line of sight has changed in
DirtyCells(tileX - r, tileZ - r, tileX + r, tileZ + r, map->lastTeam);
// iterate over all tiles within last scan radius
S32 first = XZToSeemap(-r, -r);
for (S32 y = -r; y <= r; y++, first += MAPSIDE)
{
PREFETCH(&mapLo[first+MAPSIDE]);
for (S32 x = -r, index = first; x <= r; x++, index++)
{
// Unsweep tile on ground level if was swept
if (mapLo[index] & maskLo)
{
// Unsweep for all teams last swept
CantSee(tileX + x, tileZ + y, x, y, map->lastTeam, Map::LV_LO);
// Clear seen bit
mapLo[index] &= ~maskLo;
}
}
}
// Reset last radius and team mask
map->lastR = 0;
map->lastTeam = 0;
map->lastAlt = F32_MAX;
STOP(unSweepTime);
}
示例10: gosASSERT
DWORD MC_TextureManager::copyTexture( DWORD texNodeID )
{
gosASSERT( texNodeID < MC_MAXTEXTURES );
if ( masterTextureNodes[texNodeID].gosTextureHandle != -1 )
{
masterTextureNodes[texNodeID].numUsers++;
return texNodeID;
}
else
{
STOP(( "tried to copy an invalid texture" ));
}
return -1;
}
示例11: Trace
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BitTrace::BitTrace(const char* name):
Trace(name, BitType)
{
activeLine = NextActiveLine++;
bitFlag = (NextBit < 32) ? 1 << NextBit++ : 0;
#if defined(USE_ACTIVE_PROFILE)
DEBUG_STREAM << name << " used trace line "
<< static_cast<int>(activeLine) << "!\n";
if (!IsLineValidImplementation(activeLine))
{
STOP(("Invalid active trace line!"));
}
#endif
BitTrace::ResetTrace();
}
示例12: Apu0F
void Apu0F()
{
// BRK
#if 0
STOP("BRK");
#else
PushW((IAPU.PC + 1 - IAPU.RAM));
S9xAPUPackStatus();
Push(IAPU.P);
APUSetBreak();
APUClearInterrupt();
// XXX:Where is the BRK vector ???
IAPU.PC = IAPU.RAM + APU.ExtraRAM[0x20] + (APU.ExtraRAM[0x21] << 8);
#endif
}
示例13: STOP
//
//#############################################################################
//#############################################################################
//
void
UnitQuaternion::TestInstance() const
{
Scalar diff = x*x + y*y + z*z + w*w - 1.0f;
if (!Small_Enough(diff))
{
UnitQuaternion q2 = *this;
q2.Normalize();
diff = q2.x*q2.x + q2.y*q2.y + q2.z*q2.z + q2.w*q2.w - 1.0f;
if (Small_Enough(diff))
STOP(("UnitQuaternion needs normalizing"));
}
Verify(Small_Enough(diff));
}
示例14: distanceInform
void Master::checkOK(){
ok = false;
distanceInform(vel.linear.x, vel.angular.z);
checkDistance(vel.linear.x, vel.angular.z);
if (!ok){
//if ((vel.linear.x != 0.2) || (vel.angular.x != 0.2) || ((vel.linear.x != 0.0) && (vel.angular.x != 0.0)) ){
//reAdjustSpeed();
//}
STOP();
}
else if(ok){
vel_pub_.publish(vel);
}
ok = false;
}
示例15: fatal_error_signal
/* Handle bus errors, illegal instruction, etc. */
void
fatal_error_signal (int sig)
{
#ifdef BSD
int tpgrp;
#endif /* BSD */
fatal_error_code = sig;
signal (sig, SIG_DFL);
/* If fatal error occurs in code below, avoid infinite recursion. */
if (fatal_error_in_progress)
kill (getpid (), fatal_error_code);
fatal_error_in_progress = 1;
/* If we are controlling the terminal, reset terminal modes */
#ifdef BSD
if (ioctl(0, TIOCGPGRP, &tpgrp) == 0
&& tpgrp == getpgrp ())
#endif /* BSD */
{
reset_sys_modes ();
if (sig != SIGTERM)
fprintf (stderr, "Fatal error (%d).", sig);
}
/* Clean up */
#ifdef subprocesses
kill_buffer_processes (Qnil);
#endif
Fdo_auto_save (Qt);
#ifdef CLASH_DETECTION
unlock_all_files ();
#endif /* CLASH_DETECTION */
#ifdef VMS
kill_vms_processes ();
LIB$STOP (SS$_ABORT);
#else
/* Signal the same code; this time it will really be fatal. */
kill (getpid (), fatal_error_code);
#endif /* not VMS */
}