本文整理汇总了C++中DB函数的典型用法代码示例。如果您正苦于以下问题:C++ DB函数的具体用法?C++ DB怎么用?C++ DB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xorWinOverlapDetect
/*******************************************************************************
* xorWinOverlapDetect - Detect XOR address windows overlaping
*
* DESCRIPTION:
* An unpredicted behaviour is expected in case XOR address decode
* windows overlaps.
* This function detects XOR address decode windows overlaping of a
* specified window. The function does not check the window itself for
* overlaping. The function also skipps disabled address decode windows.
*
* INPUT:
* winNum - address decode window number.
* pAddrDecWin - An address decode window struct.
*
* OUTPUT:
* None.
*
* RETURN:
* MV_TRUE if the given address window overlap current address
* decode map, MV_FALSE otherwise, MV_ERROR if reading invalid data
* from registers.
*
*******************************************************************************/
static MV_STATUS xorWinOverlapDetect(MV_U32 unit, MV_U32 winNum,
MV_ADDR_WIN *pAddrWin)
{
MV_U32 baseAddrEnableReg;
MV_U32 winNumIndex, chan;
MV_UNIT_WIN_INFO addrDecWin;
if (pAddrWin == NULL) {
DB(mvOsPrintf("%s: ERR. pAddrWin is NULL pointer\n", __func__));
return MV_BAD_PTR;
}
for (chan = 0; chan < MV_XOR_MAX_CHAN_PER_UNIT; chan++) {
/* Read base address enable register. Do not check disabled windows */
baseAddrEnableReg = MV_REG_READ(XOR_WINDOW_CTRL_REG(unit, chan));
for (winNumIndex = 0; winNumIndex < XOR_MAX_ADDR_DEC_WIN; winNumIndex++) {
/* Do not check window itself */
if (winNumIndex == winNum)
continue;
/* Do not check disabled windows */
if ((baseAddrEnableReg & XEXWCR_WIN_EN_MASK(winNumIndex)) == 0)
continue;
/* Get window parameters */
if (MV_OK != mvXorTargetWinRead(unit, winNumIndex, &addrDecWin)) {
DB(mvOsPrintf("%s: ERR. TargetWinGet failed\n", __func__));
return MV_ERROR;
}
if (MV_TRUE == mvWinOverlapTest(pAddrWin, &(addrDecWin.addrWin)))
return MV_TRUE;
}
}
return MV_FALSE;
}
示例2: DB
omni_thread::init_t::init_t(void)
{
if (count++ != 0) // only do it once however many objects get created.
return;
DB(cerr << "omni_thread::init: NT implementation initialising\n");
self_tls_index = TlsAlloc();
if (self_tls_index == 0xffffffff)
throw omni_thread_fatal(GetLastError());
next_id_mutex = new omni_mutex;
//
// Create object for this (i.e. initial) thread.
//
omni_thread* t = new omni_thread;
t->_state = STATE_RUNNING;
if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
GetCurrentProcess(), &t->handle,
0, FALSE, DUPLICATE_SAME_ACCESS))
throw omni_thread_fatal(GetLastError());
t->nt_id = GetCurrentThreadId();
DB(cerr << "initial thread " << t->id() << " NT thread id " << t->nt_id
<< endl);
if (!TlsSetValue(self_tls_index, (LPVOID)t))
throw omni_thread_fatal(GetLastError());
if (!SetThreadPriority(t->handle, nt_priority(PRIORITY_NORMAL)))
throw omni_thread_fatal(GetLastError());
}
示例3: readdir
struct direct *
readdir (DIR *dir)
{
struct FAB *dfab = &dir->fab;
struct NAM *dnam = (struct NAM *)(dfab->fab$l_nam);
struct direct *dentry = &dir->dir;
int i;
memset (dentry, 0, sizeof *dentry);
dnam->nam$l_rsa = dir->d_result;
dnam->nam$b_rss = MAXNAMLEN;
DB (DB_VERBOSE, ("."));
if (!((i = sys$search (dfab)) & 1))
{
DB (DB_VERBOSE, (_("sys$search() failed with %d\n"), i));
return (NULL);
}
dentry->d_off = 0;
if (dnam->nam$w_fid == 0)
dentry->d_fileno = 1;
else
dentry->d_fileno = dnam->nam$w_fid[0] + (dnam->nam$w_fid[1] << 16);
dentry->d_reclen = sizeof (struct direct);
dentry->d_namlen = dnam->nam$b_name + dnam->nam$b_type;
strncpy (dentry->d_name, dnam->nam$l_name, dentry->d_namlen);
dentry->d_name[dentry->d_namlen] = '\0';
#ifdef HAVE_CASE_INSENSITIVE_FS
uppercasify (dentry->d_name);
#endif
return (dentry);
}
示例4: DB
void
RenderArea::on_realize() {
try {
DB(cerr << "on_realize called" << endl);
queue_draw();
} catch (const asl::Exception & ex) {
AC_FATAL << "Exception caught: " << ex;
} catch (const exception & ex) {
AC_FATAL << "Exception caught: " << ex.what();
} catch (...) {
AC_FATAL << "Unknown exception";
}
Gtk::DrawingArea::on_realize();
}
示例5: FreeChannel_m
static void FreeChannel_m(VP_cl *self, Channel_Endpoint ep )
{
dcb_rw_t *rwp = RW(self);
dcb_ro_t *rop = RO(self);
ep_rw_t *eprw;
ep_ro_t *epro;
if ( ep >= rop->num_eps ) {
DB(eprintf("VP$FreeChannel: invalid EP.\n"));
RAISE_Channel$Invalid( ep );
}
epro = DCB_EPRO(rop,ep);
eprw = DCB_EPRW(rop,ep);
if ( epro->peer_dcb != NULL || eprw->state == Channel_State_Free ) {
DB(eprintf("VP$FreeChannel: Bad State.\n"));
RAISE_Channel$BadState( ep, eprw->state );
}
eprw->state = Channel_State_Free;
eprw->ack = (word_t)(rwp->free_eps);
rwp->free_eps = eprw;
}
示例6: common_init
static void common_init(Flash *fls)
{
memset(fls, 0, sizeof(*fls));
DB(fls->blk.priv.type = KBT_FLASH);
fls->hw = &flash_stm32_hw;
fls->blk.blk_size = FLASH_PAGE_SIZE;
fls->blk.blk_cnt = (F_SIZE * 1024) / FLASH_PAGE_SIZE;
/* Unlock flash memory for the FPEC Access */
EMB_FLASH->KEYR = FLASH_KEY1;
EMB_FLASH->KEYR = FLASH_KEY2;
}
示例7: gtk_dateentry_calendar_year
static void gtk_dateentry_calendar_year(GtkWidget *calendar, GtkDateEntry *dateentry)
{
guint year, month, day;
DB( g_print(" (dateentry) year changed\n") );
gtk_calendar_get_date (GTK_CALENDAR (dateentry->calendar), &year, &month, &day);
if( year < 1900)
g_object_set(calendar, "year", 1900, NULL);
if( year > 2200)
g_object_set(calendar, "year", 2200, NULL);
}
示例8: ser_init
/**
* Init serial driver for \a unit.
*
* Use values SER_UARTn as values for \a unit.
*/
void ser_init(struct Serial *fds, unsigned int unit)
{
memset(fds, 0, sizeof(*fds));
DB(fds->fd._type = KFT_SERIAL);
fds->fd.reopen = ser_reopen;
fds->fd.close = ser_close;
fds->fd.read = ser_read;
fds->fd.write = ser_write;
fds->fd.flush = ser_flush;
fds->fd.error = ser_error;
fds->fd.clearerr = ser_clearerr;
ser_open(fds, unit);
}
示例9: AbstractRenderWindow
RenderArea::RenderArea(RenderAreaPtr theContext) : AbstractRenderWindow(jslib::JSApp::ShellErrorReporter),
_myContextRefCount(0),
_isFirstFrame(true)
{
GdkGLConfig * myGLConfig = gdk_gl_config_new_by_mode(
GdkGLConfigMode(GDK_GL_MODE_RGBA | GDK_GL_MODE_DEPTH | GDK_GL_MODE_DOUBLE | GDK_GL_MODE_ALPHA));
if (myGLConfig == 0) {
throw asl::Exception("can't init GL",PLUS_FILE_LINE);
}
// If another render area is supplied as constructor paramter, this render area is uses as
// source for a shared y60-gl-context and gdk-gl-context.
GdkGLContext * myGdkGLContext = 0;
if (theContext) {
myGdkGLContext = theContext->getGdkGlContext();
if (!myGdkGLContext) {
throw asl::Exception("RenderArea: Failed to get gdk GL context from shared render area.", PLUS_FILE_LINE);
}
setGLContext(theContext->getGLContext());
} else {
setGLContext(GLContextPtr(new GLContext()));
}
/* Set OpenGL-capability to the widget. */
DB(cerr << "RenderArea::RenderArea() sharing with " << myGdkGLContext << endl);
if (!gtk_widget_set_gl_capability (GTK_WIDGET(gobj()),
myGLConfig,
myGdkGLContext,
true,
GDK_GL_RGBA_TYPE))
{
throw asl::Exception("RenderArea: could not create GL context!", PLUS_FILE_LINE);
}
// enable mouse events
Gdk::EventMask flags = get_events();
flags |= Gdk::BUTTON_PRESS_MASK;
flags |= Gdk::POINTER_MOTION_MASK;
flags |= Gdk::BUTTON_RELEASE_MASK;
flags |= Gdk::SCROLL_MASK;
flags |= Gdk::ENTER_NOTIFY_MASK;
flags |= Gdk::LEAVE_NOTIFY_MASK;
set_events(flags);
y60::EventDispatcher::get().addSource(&_myEventAdapter);
y60::EventDispatcher::get().addSink(this);
// TODO: createRenderer(theOtherRenderer);
ShaderLibrary::setGLisReadyFlag(true);
}
示例10: PhotoCommentQuery
bool PhotoCommentQuery(PacketHandlerData d){
NetPacket *p;
p = d.pkt;
bool ret = true;
int min, max;
min = NetGetNumberData(p, "min");
max = NetGetNumberData(p, "max");
PhotoComment *plist;
NetPacket *pkt;
int len;
pkt = NetCreatePacket();
plist = QueryPhotoCommentList(DB(d),NetGetNumberData(p, "photo_id")
, min, max, &len);
if(plist == NULL){
pkt->header.type = PHOTO_COMMENT_QUERY_FAILED;
NetAddStringData(pkt, "reason", REASON_MEMORY_ERROR);
goto CleanUp;
}
else
pkt->header.type = PHOTO_COMMENT_INFO;
NetAddNumberData(pkt, "count", len);
for(int i=0;i<len;i++){
char msg[8];
sprintf(msg,"i%d", i+1);
NetAddStringData(pkt, msg, plist[i].id);
sprintf(msg,"c%d", i+1);
NetAddStringData(pkt, msg, plist[i].comment);
sprintf(msg,"pi%d", i+1);
NetAddNumberData(pkt, msg, plist[i].photo_id);
sprintf(msg,"t%d", i+1);
NetAddNumberData(pkt, msg, plist[i].time);
}
CleanUp:
NetSendPacket(d.handle,d.io,pkt);
NetDisposePacket(pkt, true);
free(plist);
return ret;
}
示例11: handle_error
/* Clean up after an error. The caller should usually call do_request()
after this function returns. It can be called from an IRQ handler or the
normal kernel context. */
void handle_error(const char *from)
{
u_long flags;
if(current_req == NULL)
return;
save_flags(flags);
cli();
kprintf("\nfd: %s (%s): Error (retry number %d)\n",
from, REQ_FD_DEV(current_req)->name, current_req->retries);
dump_stat();
fd_intr = NULL;
if(current_req->retries++ < MAX_RETRIES)
{
#if 0
if((current_req->retries % RESET_FREQ) == 0)
reset_pending = TRUE;
#endif
if((current_req->retries % RECAL_FREQ) == 0)
REQ_FD_DEV(current_req)->recalibrate = TRUE;
/* Retry the current request, this simply means stacking it on the
front of the queue and calling do_request(). */
prepend_node(&fd_reqs, ¤t_req->node);
current_req = NULL;
DB(("fd:handle_error: Retrying request %p\n", current_req));
}
else
{
#if 0
reset_pending = TRUE;
#endif
REQ_FD_DEV(current_req)->recalibrate = TRUE;
DB(("\nfd: handle_error: Request %p has no more retries available.\n",
current_req));
fd_end_request(-1);
}
load_flags(flags);
}
示例12: mvXorProtWinSet
/*******************************************************************************
* mvXorSetProtWinSet - Configure access attributes of a XOR engine
* to one of the XOR memory windows.
*
* DESCRIPTION:
* Each engine can be configured with access attributes for each of the
* memory spaces. This function sets access attributes
* to a given window for the given engine
*
* INPUTS:
* chan - One of the possible engines.
* winNum - One of the possible XOR memory spaces.
* access - Protection access rights.
* write - Write rights.
*
* OUTPUT:
* None.
*
* RETURN:
* MV_BAD_PARAM if parameters to function invalid, MV_OK otherwise.
*
*******************************************************************************/
MV_STATUS mvXorProtWinSet(MV_U32 unit, MV_U32 chan, MV_U32 winNum, MV_BOOL access, MV_BOOL write)
{
MV_U32 temp;
/* Parameter checking */
if (chan >= MV_XOR_MAX_CHAN_PER_UNIT) {
DB(mvOsPrintf("%s: ERR. Invalid chan num %d\n", __func__, chan));
return MV_BAD_PARAM;
}
if (winNum >= XOR_MAX_ADDR_DEC_WIN) {
DB(mvOsPrintf("%s: ERR. Invalid win num %d\n", __func__, winNum));
return MV_BAD_PARAM;
}
temp = MV_REG_READ(XOR_WINDOW_CTRL_REG(unit, chan)) & (~XEXWCR_WIN_ACC_MASK(winNum));
/* if access is disable */
if (!access) {
/* disable access */
temp |= XEXWCR_WIN_ACC_NO_ACC(winNum);
}
/* if access is enable */
else {
/* if write is enable */
if (write) {
/* enable write */
temp |= XEXWCR_WIN_ACC_RW(winNum);
}
/* if write is disable */
else {
/* disable write */
temp |= XEXWCR_WIN_ACC_RO(winNum);
}
}
MV_REG_WRITE(XOR_WINDOW_CTRL_REG(unit, chan), temp);
return MV_OK;
}
示例13: DB
USHORT CHalWaveDevice::Service()
// Called at interrupt time to service the circular buffer
/////////////////////////////////////////////////////////////////////////////
{
ULONG ulReason = kReasonWave;
//DC('W');
//DPF(("CHalWaveDevice::Service: "));
//DB('s',COLOR_BOLD); DX8( (BYTE)m_ulDeviceNumber, COLOR_NORMAL );
// go see why we were called
ULONG ulStreamStatus = m_RegStreamStatus.Read();
//ULONG ulStreamControl = m_RegStreamControl.Read();
//DC('[');
//DX16( (USHORT)(ulStreamStatus & REG_STREAMSTAT_L2PTR_MASK), COLOR_NORMAL );
//DC(',');
//DX16( (USHORT)(ulStreamControl & REG_STREAMCTL_PCPTR_MASK), COLOR_NORMAL );
//DC(']');
//DPF(("Stream Status %08lx\n", ulStreamStatus ));
// was the limit hit bit set?
if( ulStreamStatus & REG_STREAMSTAT_LIMHIT )
{
//DC('L');
//DPF(("Limit Hit\n"));
}
// was the overrun bit set?
if( ulStreamStatus & REG_STREAMSTAT_OVER )
{
DB('O',COLOR_BOLD);
m_ulOverrunCount++;
DPF(("\nCHalWaveDevice: Overrun Detected %ld\n", m_ulOverrunCount ));
ulReason = kReasonWaveEmpty;
}
if( m_usMode != MODE_RUNNING )
{
//DPF(("<%02ld %08lx %08lx>", m_ulDeviceNumber, m_RegStreamControl.Read(), ulStreamStatus ));
Stop();
//DPF(("Interrupt Detected on IDLE device %02ld\n", m_ulDeviceNumber ));
return( HSTATUS_INVALID_MODE );
}
// let the driver service the interrupt for this device
CHalDevice::Service( ulReason );
return( HSTATUS_OK );
}
示例14: DB
void sched.insert(int d, object* who)
/*
schedule THIS to run in ``d'' time units
inserted by who
*/
{
register sched * p;
register sched * pp;
register long tt = s_time = clock + d;
DB(("%x->sched::insert( %x, %x )\n",this,d,who));
switch (s_state) {
case TERMINATED:
task_error(E_RESTERM,this);
break;
case IDLE:
break;
case RUNNING:
if (this != (class sched *)thistask) task_error(E_RESRUN,this);
}
if (d<0) task_error(E_NEGTIME,this);
if (o_next) task_error(E_RESOBJ,this);
s_state = RUNNING;
if (o_type == TASK) ((task *) this)->t_alert = who;
/* run_chain ordered by s_time */
if (p = run_chain) {
if (tt < p->s_time) {
o_next = (object*) run_chain;
run_chain = this;
}
else {
while (pp = (sched *) p->o_next) {
if (tt < pp->s_time) {
o_next = pp;
p->o_next = this;
return;
}
else p = pp;
}
p->o_next = this;
}
}
else
run_chain = this;
}
示例15: ahbToMbusRemapRegOffsGet
/*******************************************************************************
* ahbToMbusRemapRegOffsGet - Get CPU address remap register offsets
*
* DESCRIPTION:
* CPU to PCI address remap registers offsets are inconsecutive.
* This function returns PCI address remap registers offsets.
*
* INPUT:
* cpu - CPU id
* winNum - Address decode window number. See MV_U32 enumerator.
*
* OUTPUT:
* None.
*
* RETURN:
* MV_ERROR if winNum is not a PCI one.
*
*******************************************************************************/
static MV_STATUS ahbToMbusRemapRegOffsGet(MV_U32 cpu, MV_U32 winNum,
AHB_TO_MBUS_REMAP_REG_OFFS *pRemapRegs)
{
pRemapRegs->lowRegOffs = AHB_TO_MBUS_WIN_REMAP_LOW_REG(cpu, winNum);
pRemapRegs->highRegOffs = AHB_TO_MBUS_WIN_REMAP_HIGH_REG(cpu, winNum);
if ((pRemapRegs->lowRegOffs == 0) || (pRemapRegs->highRegOffs == 0))
{
DB(mvOsPrintf("ahbToMbusRemapRegOffsGet: ERR. Invalid winNum %d\n",
winNum));
return MV_NO_SUCH;
}
return MV_OK;
}