本文整理汇总了C++中Verbose函数的典型用法代码示例。如果您正苦于以下问题:C++ Verbose函数的具体用法?C++ Verbose怎么用?C++ Verbose使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Verbose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SDLGL_OpenVideoContext
static int
SDLGL_OpenVideoContext(void *obj, void *ctx, Uint flags)
{
AG_DriverSDLGL *sgl = obj;
AG_DriverSw *dsw = obj;
AG_Driver *drv = obj;
SDL_Surface *ctxSu = (SDL_Surface *)ctx;
if (!(ctxSu->flags & SDL_OPENGL)) {
AG_SetError("Given display surface is not SDL_OPENGL");
return (-1);
}
/* Set the requested display options. */
if (flags & AG_VIDEO_OVERLAY)
dsw->flags |= AG_DRIVER_SW_OVERLAY;
if (flags & AG_VIDEO_BGPOPUPMENU)
dsw->flags |= AG_DRIVER_SW_BGPOPUP;
/* Use the given display surface. */
sgl->s = (SDL_Surface *)ctx;
if ((drv->videoFmt = AG_SDL_GetPixelFormat(sgl->s)) == NULL) {
goto fail;
}
dsw->w = sgl->s->w;
dsw->h = sgl->s->h;
dsw->depth = (Uint)drv->videoFmt->BitsPerPixel;
Verbose(_("SDLGL: Using existing display (%ux%ux%d bpp)\n"),
dsw->w, dsw->h, (int)drv->videoFmt->BitsPerPixel);
/* Initialize our OpenGL context and viewport. */
if (AG_GL_InitContext(sgl, &sgl->gl) == -1) {
goto fail;
}
AG_GL_SetViewport(&sgl->gl, AG_RECT(0, 0, dsw->w, dsw->h));
/* Create the cursors. */
if (AG_SDL_InitDefaultCursor(sgl) == -1 ||
AG_InitStockCursors(drv) == -1)
goto fail;
return (0);
fail:
if (drv->videoFmt) {
AG_PixelFormatFree(drv->videoFmt);
drv->videoFmt = NULL;
}
return (-1);
}
示例2: withPortFilter
int withPortFilter(Connection *Conn,PCStr(what),PCStr(proto),PCStr(method),PVStr(filter)){
if( streq(proto,"starttls") )
if( streq(what,"FCL") && (AccPort_Flags&(SVP_SSL|SVP_STLS)) ){
Verbose("----PortFilter[%s] [%s][%s] -P%d/%X\n",
what,proto,method,
AccPort_Port,AccPort_Flags);
strcpy(filter,"sslway");
return 1;
}
if( streq(proto,"starttls") )
if( streq(what,"FSV") && (ConnectFlags&(COF_SSL_SV)) ){
/* MASTER=host:port/ssl */
if( ServerFlags & (PF_SSL_ON) ){
return 0;
}else{
Verbose("----PortFilter[%s] [%s][%s]\n",
what,proto,method,ConnectFlags);
strcpy(filter,"sslway");
return 1;
}
}
return 0;
}
示例3: fitTo
RooFitResult * fitTo(RooAbsPdf * pdf, RooDataSet * data, RooArgSet * cons = NULL, string opt = "" )
{
//freopen ("tmp.txt","w",stdout);
RooFitResult * res = NULL;
if(cons!=NULL)
res = pdf->fitTo(*data,PrintLevel(-1),Save(),NumCPU(2),
ExternalConstraints(*cons),Warnings(false), Verbose(kFALSE), Minos(true));
else
res = pdf->fitTo(*data,PrintLevel(-1),Save(),Warnings(false),NumCPU(2), Minos(true));
//freopen ("/dev/tty", "a", stdout);
return res;
}
示例4: assert
int Tracter::Unframe::ContiguousFetch(
IndexType iIndex, int iLength, int iOffset
)
{
assert(iIndex >= 0);
// Limits
int inSize = mInput->Frame().size;
IndexType loIndex = iIndex / inSize;
IndexType hiIndex = (iIndex + iLength) / inSize;
int loOffset = iIndex % inSize;
int hiOffset = (iIndex + iLength) % inSize;
Verbose(3, "Reading %d from %d of %ld to %d of %ld\n",
iLength, loOffset, loIndex, hiOffset, hiIndex);
// First frame
int nRead = 0;
const float* ip = mInput->UnaryRead(loIndex);
if (!ip)
return nRead;
float* oData = GetPointer(iOffset);
int hi = (loIndex == hiIndex) ? hiOffset : inSize;
for (int i=loOffset; i<hi; i++)
oData[nRead++] = ip[i];
// Middle frames
for (IndexType j=loIndex+1; j<hiIndex; j++)
{
ip = mInput->UnaryRead(j);
if (!ip)
return nRead;
for (int i=0; i<inSize; i++)
oData[nRead++] = ip[i];
}
// Last frame
if (nRead != iLength)
{
ip = mInput->UnaryRead(hiIndex);
if (!ip)
return nRead;
for (int i=0; i<hiOffset; i++)
oData[nRead++] = ip[i];
}
// Done
assert(nRead == iLength);
return nRead;
}
示例5: pollIZ
int pollIZ(const char *wh,double timeout,int in,int exsock){
int rem;
int tom = 1000;
int to1;
int rdy1;
int nrdy = 0;
Verbose("---- poll(%s) [%d][%d] %.1f ...\n",wh,in,exsock,timeout);
if( isWindows() && readyAlways(in) ){ /* 9.9.5 for Windows */
nrdy = 1;
if( 0 <= exsock && !IsAlive(exsock) ){
nrdy |= 2;
}
}else
for( rem = (int)(timeout*1000); 0 < rem; rem -= to1 ){
if( 0 <= exsock && !IsAlive(exsock) ){
nrdy |= 2;
break;
}
if( tom < rem )
to1 = tom;
else to1 = rem;
rdy1 = PollIn(in,to1);
if( rdy1 != 0 ){
nrdy |= 1;
}
Verbose("---- poll(%s) [%d][%d] %.1f %.1f rdy=%X\n",wh,
in,exsock,timeout,rem/1000.0,nrdy);
if( nrdy ){
break;
}
}
if( LOG_VERBOSE || (nrdy == 0) || (nrdy & 2) )
sv1log("---- poll(%s) [%d][%d] %.1f (%.1f) rdy=%X\n",wh,
in,exsock,timeout,rem/1000.0,nrdy);
return nrdy;
}
示例6: Hostname2IPString
char *
Hostname2IPString(char *hostname)
{
static char ipbuffer[65];
int err;
#if defined(HAVE_GETADDRINFO) && !defined(DARWIN)
struct addrinfo query, *response, *ap;
memset(&query,0,sizeof(struct addrinfo));
query.ai_family = AF_UNSPEC;
query.ai_socktype = SOCK_STREAM;
memset(ipbuffer,0,63);
if ((err = getaddrinfo(hostname,NULL,&query,&response)) != 0) {
snprintf(g_output,CF_BUFSIZE,
"Unable to lookup hostname (%s) or cfengine service: %s",
hostname,gai_strerror(err));
CfLog(cferror,g_output,"");
return hostname;
}
for (ap = response; ap != NULL; ap = ap->ai_next) {
strncpy(ipbuffer,sockaddr_ntop(ap->ai_addr),64);
Debug("Found address (%s) for host %s\n",ipbuffer,hostname);
freeaddrinfo(response);
return ipbuffer;
}
#else
struct hostent *hp;
struct sockaddr_in cin;
memset(&cin,0,sizeof(cin));
memset(ipbuffer,0,63);
if ((hp = gethostbyname(hostname)) != NULL) {
cin.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr;
strncpy(ipbuffer,inet_ntoa(cin.sin_addr),63);
Verbose("Found address (%s) for host %s\n",ipbuffer,hostname);
return ipbuffer;
}
#endif
snprintf(ipbuffer,63,"Unknown IP %s",hostname);
return ipbuffer;
}
示例7: ProcessDeleteOperation
static int ProcessDeleteOperation(AwaServerDeleteOperation * operation, const char * clientID)
{
int result = 0;
if (AwaServerDeleteOperation_Perform(operation, OPERATION_PERFORM_TIMEOUT) != AwaError_Success)
{
Error("AwaServerDeleteOperation_Perform failed\n");
result = 1;
}
const AwaServerDeleteResponse * response = AwaServerDeleteOperation_GetResponse(operation, clientID);
if (response != NULL)
{
AwaPathIterator * pathIterator = AwaServerDeleteResponse_NewPathIterator(response);
if (pathIterator != NULL)
{
while(AwaPathIterator_Next(pathIterator))
{
const char * path = AwaPathIterator_Get(pathIterator);
const AwaPathResult * result = AwaServerDeleteResponse_GetPathResult(response, path);
AwaError error = AwaPathResult_GetError(result);
if (error == AwaError_Success)
{
Verbose("Target %s deleted\n", path);
}
else
{
if (error != AwaError_LWM2MError)
{
Error("Failed to delete target %s: %s\n", path, AwaError_ToString(error));
}
else
{
Error("Failed to delete target %s: %s\n", path, AwaLWM2MError_ToString(AwaPathResult_GetLWM2MError(result)));
}
}
}
AwaPathIterator_Free(&pathIterator);
}
else
{
Error("AwaServerDeleteResponse_NewPathIterator returned NULL");
}
}
else
{
Error("AwaServerDeleteOperation_GetResponse returned NULL");
}
return result;
}
示例8: File
void Optimizer::summarizeTool(DFA* tool){
std::string dirpath = logger::settings::FULL_DIR_STR;
std::string toolDirpath = dirpath + "/" + "tool";
if (mkdir(toolDirpath.c_str(), 0777) < 0)
if (errno !=EEXIST) ERR("mkdir");
stringstream ssTool;
ssTool << "Tool Summary" << std::endl;
ssTool << *tool;
std::string toolFileName = toolDirpath + "/" + "dfa_tool";
//drawing::drawDFA(*tool, toolFileName);
logger::log(Verbose(OPTIMIZER_V), File("result.txt"), ssTool.str());
}
示例9: threadFilter
static int threadFilter(Connection *Conn,PCStr(fname),iFUNCP func,FILE *ioin,FILE *out,PCStr(args)){
int code;
IStr(buf,1);
int osock;
setthreadgid(0,STX_tid);
osock = ClientSock;
//ClientSock = dup(ClientSock);
Verbose("-- F openFilter: %s [%d][%d] [%d]>>[%d]\n",
fname, osock,ClientSock, FromS,ToC);
// write(fileno(ioin),"\n",1); /* for sync. of thread_fork */
PollIn(fileno(ioin),1000);
clearConnPTR(Conn);
code = (*func)(Conn,ioin,out,args);
Verbose("-- F openFilter: DONE %d\n",code);
fflush(out);
ShutdownSocket(fileno(ioin));
/*
close(fth.f_sync[1]);
*/
sv1log("-- F openFilter: EXIT(%d) %s\n",code,fname);
return 0;
}
示例10: LoadDllFunctions
static bool LoadDllFunctions(dllhandle_t dllhandle, const dllfunction_t *fcts, bool complain, bool has_next)
{
const dllfunction_t *func;
if(dllhandle)
{
for (func = fcts; func && func->name != NULL; func++)
if (!(*func->funcvariable = (void *) DllGetProcAddress (dllhandle, func->name)))
{
if(complain)
{
Verbose (" - missing function \"%s\" - broken library!", func->name);
if (has_next)
Verbose("\nContinuing with");
}
goto notfound;
}
return true;
notfound:
for (func = fcts; func && func->name != NULL; func++)
*func->funcvariable = NULL;
}
return false;
}
示例11: ChangeCallback
void ChangeCallback(const AwaChangeSet * changeSet, void * context)
{
g_notifyCount++;
Verbose("Notify %d:\n", g_notifyCount);
const AwaClientSession * session = AwaChangeSet_GetClientSession(changeSet);
bool quiet = *((bool*)context);
char * output = ChangeSetToCString((void *)session, changeSet, quiet);
if (output != NULL)
{
printf("%s", output);
}
free(output);
output = NULL;
}
示例12: DrvAdvancedDocumentProperties
LONG
DrvAdvancedDocumentProperties(
HWND hwnd,
HANDLE hPrinter,
PWSTR pDeviceName,
PDEVMODE pdmOutput,
PDEVMODE pdmInput
)
/*++
Routine Description:
Set the private members of a DEVMODE structure.
In this release, this function is almost identical to
DrvDocumentProperties above with a few minor exceptions
[Note:]
Please refer to WinNT DDK/SDK documentation for more details.
This is the old entry point for the spooler. Even though
no one should be using this, do it for compatibility.
--*/
{
Verbose(("Entering DrvAdvancedDocumentProperties...\n"));
//
// Return the number of bytes required if pdmOutput is NULL
//
if (pdmOutput == NULL)
return sizeof(XLDEVMODE);
//
// Otherwise, call the common routine shared with DrvDocumentProperties
//
return PsDocumentProperties(hwnd,
hPrinter,
pDeviceName,
pdmOutput,
pdmInput,
DM_COPY|DM_PROMPT|DM_ADVANCED) > 0;
}
示例13: ObserveCallback
void ObserveCallback(const AwaChangeSet * changeSet, void * context)
{
Verbose("Notify %d from clientID %s:\n", g_notifyCount, AwaChangeSet_GetClientID(changeSet));
const AwaServerSession * session = AwaChangeSet_GetServerSession(changeSet);
ObserveContext * observeContext = (ObserveContext *)context;
char * output = ChangeSetToCString(session, changeSet, observeContext->targets, observeContext->numTargets, observeContext->quiet);
if (output != NULL)
{
printf("%s", output);
// Provide output immediately
fflush(stdout);
}
free(output);
output = NULL;
g_notifyCount++;
}
示例14: while
void RegionMerger::mergeQueuedRegions(int desiredCount){
while((int)regionList.size()>desiredCount){
if(Verbose()>1 && (regionList.size()<100 || currentTime%100==0))
cout <<"region count:" << regionList.size()
<< " queue size: " << queue_vector.size() << endl;
if(clearThreshold>0 && queue_vector.size() >
(size_t)clearThreshold*regionList.size())
fillPriorityQueue();
mergeTopRegions();
}
}
示例15: GetEnv
Tracter::Select::Select(Component<float>* iInput, const char* iObjectName)
{
mObjectName = iObjectName;
mInput = iInput;
mLoIndex = GetEnv("Lo", 0);
mHiIndex = GetEnv("Hi", iInput->Frame().size-1);
mFrame.size = mHiIndex - mLoIndex + 1;
assert(mFrame.size >= 0);
assert(mHiIndex < iInput->Frame().size);
assert(mLoIndex >= 0);
Verbose(1, "passing indexes %d-%d of %d\n",
mLoIndex, mHiIndex, iInput->Frame().size);
Connect(iInput, 1);
}