您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ warning函数代码示例

51自学网 2021-06-03 09:52:06
  C++
这篇教程C++ warning函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中warning函数的典型用法代码示例。如果您正苦于以下问题:C++ warning函数的具体用法?C++ warning怎么用?C++ warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了warning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cgoto

voidcgoto(void){	int i, j, s;	int npos, curpos, n;	int tryit;	uchar tch[NCH];	int tst[NCH];	uchar *q;	/* generate initial state, for each start condition */	Bprint(&fout,"int yyvstop[] = {/n0,/n");	while(stnum < 2 || stnum/2 < sptr){		for(i = 0; i<tptr; i++) tmpstat[i] = 0;		count = 0;		if(tptr > 0)first(tptr-1);		add(state,stnum);# ifdef DEBUG		if(debug){			if(stnum > 1)				print("%s:/n",sname[stnum/2]);			pstate(stnum);		}# endif		stnum++;	}	stnum--;	/* even stnum = might not be at line begin */	/* odd stnum  = must be at line begin */	/* even states can occur anywhere, odd states only at line begin */	for(s = 0; s <= stnum; s++){		tryit = FALSE;		cpackflg[s] = FALSE;		sfall[s] = -1;		acompute(s);		for(i=0;i<NCH;i++) symbol[i] = 0;		npos = *state[s];		for(i = 1; i<=npos; i++){			curpos = *(state[s]+i);			if(name[curpos] < NCH) symbol[name[curpos]] = TRUE;			else switch(name[curpos]){			case RCCL:				tryit = TRUE;				q = ptr[curpos];				while(*q){					for(j=1;j<NCH;j++)						if(cindex[j] == *q)							symbol[j] = TRUE;					q++;				}				break;			case RSTR:				symbol[right[curpos]] = TRUE;				break;# ifdef DEBUG			case RNULLS:			case FINAL:			case S1FINAL:			case S2FINAL:				break;			default:				warning("bad switch cgoto %d state %d",curpos,s);				break;# endif			}		}# ifdef DEBUG		if(debug){			print("State %d transitions on:/n/t",s);			charc = 0;			for(i = 1; i<NCH; i++){				if(symbol[i]) allprint(i);				if(charc > LINESIZE){					charc = 0;					print("/n/t");				}			}			print("/n");		}# endif		/* for each char, calculate next state */		n = 0;		for(i = 1; i<NCH; i++){			if(symbol[i]){				nextstate(s,i);		/* executed for each state, transition pair */				xstate = notin(stnum);				if(xstate == -2) warning("bad state  %d %o",s,i);				else if(xstate == -1){					if(stnum >= nstates)						error("Too many states %s",(nstates == NSTATES ? "/nTry using %n num":""));					add(state,++stnum);# ifdef DEBUG					if(debug)pstate(stnum);# endif					tch[n] = i;					tst[n++] = stnum;				} else {		/* xstate >= 0 ==> state exists */					tch[n] = i;					tst[n++] = xstate;				}//.........这里部分代码省略.........
开发者ID:99years,项目名称:plan9,代码行数:101,


示例2: warning

void ScriptFunctions::lockCameraDirection(Aurora::NWScript::FunctionContext &ctx) {	warning("TODO: LockCameraDirection");}
开发者ID:mclark4386,项目名称:xoreos,代码行数:3,


示例3: mach_xfer_memory_remainder

static intmach_xfer_memory_remainder (CORE_ADDR memaddr, char *myaddr,                            int len, int write,                            task_t task){  vm_size_t pagesize = child_get_pagesize ();  vm_offset_t mempointer;       /* local copy of inferior's memory */  mach_msg_type_number_t memcopied;     /* for vm_read to use */  CORE_ADDR pageaddr = memaddr - (memaddr % pagesize);  kern_return_t kret;  CHECK_FATAL (((memaddr + len - 1) - ((memaddr + len - 1) % pagesize))               == pageaddr);  if (!write)    {      kret = mach_vm_read (task, pageaddr, pagesize, &mempointer, &memcopied);            if (kret != KERN_SUCCESS)	{#ifdef DEBUG_MACOSX_MUTILS	  mutils_debug	    ("Unable to read page for region at 0x%8.8llx with length %lu from inferior: %s (0x%lx)/n",	     (uint64_t) pageaddr, (unsigned long) len,	     MACH_ERROR_STRING (kret), kret);#endif	  return 0;	}      if (memcopied != pagesize)	{	  kret = vm_deallocate (mach_task_self (), mempointer, memcopied);	  if (kret != KERN_SUCCESS)	    {	      warning		("Unable to deallocate memory used by failed read from inferior: %s (0x%lx)",		 MACH_ERROR_STRING (kret), (unsigned long) kret);	    }#ifdef DEBUG_MACOSX_MUTILS	  mutils_debug	    ("Unable to read region at 0x%8.8llx with length %lu from inferior: "	     "vm_read returned %lu bytes instead of %lu/n",	     (uint64_t) pageaddr, (unsigned long) pagesize,	     (unsigned long) memcopied, (unsigned long) pagesize);#endif	  return 0;	}            memcpy (myaddr, ((unsigned char *) 0) + mempointer              + (memaddr - pageaddr), len);      kret = vm_deallocate (mach_task_self (), mempointer, memcopied);      if (kret != KERN_SUCCESS)	{	  warning	    ("Unable to deallocate memory used to read from inferior: %s (0x%ulx)",	     MACH_ERROR_STRING (kret), kret);	  return 0;	}    }  else    {      /* We used to read in a whole page, then modify the page	 contents, then write that page back out.  I bet we did that	 so we didn't break up page maps or something like that.	 However, in Leopard there's a bug in the shared cache	 implementation, such that if we write into it with whole	 pages the maximum page protections don't get set properly and	 we can no longer reset the execute bit.  In 64 bit Leopard	 apps, the execute bit has to be set or we can't run code from	 there.	 If we figure out that not writing whole pages causes problems	 of it's own, then we will have to revisit this.  */#if defined (TARGET_POWERPC)      vm_machine_attribute_val_t flush = MATTR_VAL_CACHE_FLUSH;      /* This vm_machine_attribute only works on PPC, so no reason	 to keep failing on x86... */      kret = vm_machine_attribute (mach_task_self (), mempointer,                                   pagesize, MATTR_CACHE, &flush);#ifdef DEBUG_MACOSX_MUTILS      if (kret != KERN_SUCCESS)        {          mutils_debug            ("Unable to flush GDB's address space after memcpy prior to vm_write: %s (0x%lx)/n",             MACH_ERROR_STRING (kret), kret);        }#endif#endif      kret =        mach_vm_write (task, memaddr, (pointer_t) myaddr, len);      if (kret != KERN_SUCCESS)        {#ifdef DEBUG_MACOSX_MUTILS          mutils_debug            ("Unable to write region at 0x%8.8llx with length %lu to inferior: %s (0x%lx)/n",             (uint64_t) memaddr, (unsigned long) len,//.........这里部分代码省略.........
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:101,


示例4: mach_xfer_memory_block

static intmach_xfer_memory_block (CORE_ADDR memaddr, char *myaddr,                        int len, int write, task_t task){  vm_size_t pagesize = child_get_pagesize ();  vm_offset_t mempointer;       /* local copy of inferior's memory */  mach_msg_type_number_t memcopied;     /* for vm_read to use */  kern_return_t kret;  CHECK_FATAL ((memaddr % pagesize) == 0);  CHECK_FATAL ((len % pagesize) == 0);  if (!write)    {      kret =        mach_vm_read (task, memaddr, len, &mempointer,                      &memcopied);      if (kret != KERN_SUCCESS)        {#ifdef DEBUG_MACOSX_MUTILS          mutils_debug            ("Unable to read region at 0x%8.8llx with length %lu from inferior: %s (0x%lx)/n",             (uint64_t) memaddr, (unsigned long) len,             MACH_ERROR_STRING (kret), kret);#endif          return 0;        }      if (memcopied != len)        {          kret = vm_deallocate (mach_task_self (), mempointer, memcopied);          if (kret != KERN_SUCCESS)            {              warning                ("Unable to deallocate memory used by failed read from inferior: %s (0x%ux)",                 MACH_ERROR_STRING (kret), kret);            }#ifdef DEBUG_MACOSX_MUTILS          mutils_debug            ("Unable to read region at 0x%8.8llx with length %lu from inferior: "             "vm_read returned %lu bytes instead of %lu/n",             (uint64_t) memaddr, (unsigned long) len,             (unsigned long) memcopied, (unsigned long) len);#endif          return 0;        }      memcpy (myaddr, ((unsigned char *) 0) + mempointer, len);      kret = vm_deallocate (mach_task_self (), mempointer, memcopied);      if (kret != KERN_SUCCESS)        {          warning            ("Unable to deallocate memory used by read from inferior: %s (0x%ulx)",             MACH_ERROR_STRING (kret), kret);          return 0;        }    }  else    {      kret =        mach_vm_write (task, memaddr, (pointer_t) myaddr, len);      if (kret != KERN_SUCCESS)        {#ifdef DEBUG_MACOSX_MUTILS          mutils_debug            ("Unable to write region at 0x%8.8llx with length %lu from inferior: %s (0x%lx)/n",             (uint64_t) memaddr, (unsigned long) len,             MACH_ERROR_STRING (kret), kret);#endif          return 0;        }    }  return len;}
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:75,


示例5: check_local_mod

static int check_local_mod(unsigned char *head, int index_only){	/*	 * Items in list are already sorted in the cache order,	 * so we could do this a lot more efficiently by using	 * tree_desc based traversal if we wanted to, but I am	 * lazy, and who cares if removal of files is a tad	 * slower than the theoretical maximum speed?	 */	int i, no_head;	int errs = 0;	no_head = is_null_sha1(head);	for (i = 0; i < list.nr; i++) {		struct stat st;		int pos;		struct cache_entry *ce;		const char *name = list.name[i];		unsigned char sha1[20];		unsigned mode;		int local_changes = 0;		int staged_changes = 0;		pos = cache_name_pos(name, strlen(name));		if (pos < 0)			continue; /* removing unmerged entry */		ce = active_cache[pos];		if (lstat(ce->name, &st) < 0) {			if (errno != ENOENT)				warning("'%s': %s", ce->name, strerror(errno));			/* It already vanished from the working tree */			continue;		}		else if (S_ISDIR(st.st_mode)) {			/* if a file was removed and it is now a			 * directory, that is the same as ENOENT as			 * far as git is concerned; we do not track			 * directories.			 */			continue;		}		/*		 * "rm" of a path that has changes need to be treated		 * carefully not to allow losing local changes		 * accidentally.  A local change could be (1) file in		 * work tree is different since the index; and/or (2)		 * the user staged a content that is different from		 * the current commit in the index.		 *		 * In such a case, you would need to --force the		 * removal.  However, "rm --cached" (remove only from		 * the index) is safe if the index matches the file in		 * the work tree or the HEAD commit, as it means that		 * the content being removed is available elsewhere.		 */		/*		 * Is the index different from the file in the work tree?		 */		if (ce_match_stat(ce, &st, 0))			local_changes = 1;		/*		 * Is the index different from the HEAD commit?  By		 * definition, before the very initial commit,		 * anything staged in the index is treated by the same		 * way as changed from the HEAD.		 */		if (no_head		     || get_tree_entry(head, name, sha1, &mode)		     || ce->ce_mode != create_ce_mode(mode)		     || hashcmp(ce->sha1, sha1))			staged_changes = 1;		/*		 * If the index does not match the file in the work		 * tree and if it does not match the HEAD commit		 * either, (1) "git rm" without --cached definitely		 * will lose information; (2) "git rm --cached" will		 * lose information unless it is about removing an		 * "intent to add" entry.		 */		if (local_changes && staged_changes) {			if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))				errs = error(_("'%s' has staged content different "					     "from both the file and the HEAD/n"					     "(use -f to force removal)"), name);		}		else if (!index_only) {			if (staged_changes)				errs = error(_("'%s' has changes staged in the index/n"					     "(use --cached to keep the file, "					     "or -f to force removal)"), name);			if (local_changes)				errs = error(_("'%s' has local modifications/n"					     "(use --cached to keep the file, "					     "or -f to force removal)"), name);		}//.........这里部分代码省略.........
开发者ID:allwinnertech,项目名称:cute-cat,代码行数:101,


示例6: LOG

    Status Database::dropCollection( TransactionExperiment* txn, const StringData& fullns ) {        LOG(1) << "dropCollection: " << fullns << endl;        massertNamespaceNotIndex( fullns, "dropCollection" );        Collection* collection = getCollection( txn, fullns );        if ( !collection ) {            // collection doesn't exist            return Status::OK();        }        {            NamespaceString s( fullns );            verify( s.db() == _name );            if( s.isSystem() ) {                if( s.coll() == "system.profile" ) {                    if ( _profile != 0 )                        return Status( ErrorCodes::IllegalOperation,                                       "turn off profiling before dropping system.profile collection" );                }                else {                    return Status( ErrorCodes::IllegalOperation, "can't drop system ns" );                }            }        }        BackgroundOperation::assertNoBgOpInProgForNs( fullns );        audit::logDropCollection( currentClient.get(), fullns );        try {            Status s = collection->getIndexCatalog()->dropAllIndexes(txn, true);            if ( !s.isOK() ) {                warning() << "could not drop collection, trying to drop indexes"                          << fullns << " because of " << s.toString();                return s;            }        }        catch( DBException& e ) {            stringstream ss;            ss << "drop: dropIndexes for collection failed. cause: " << e.what();            ss << ". See http://dochub.mongodb.org/core/data-recovery";            warning() << ss.str() << endl;            return Status( ErrorCodes::InternalError, ss.str() );        }        verify( collection->_details->getTotalIndexCount() == 0 );        LOG(1) << "/t dropIndexes done" << endl;        Top::global.collectionDropped( fullns );        Status s = _dropNS( txn, fullns );        _clearCollectionCache( fullns ); // we want to do this always        if ( !s.isOK() )            return s;        DEV {            // check all index collection entries are gone            string nstocheck = fullns.toString() + ".$";            scoped_lock lk( _collectionLock );            for ( CollectionMap::const_iterator i = _collections.begin();                  i != _collections.end();                  ++i ) {                string temp = i->first;                if ( temp.find( nstocheck ) != 0 )                    continue;                log() << "after drop, bad cache entries for: "                      << fullns << " have " << temp;                verify(0);            }        }        return Status::OK();    }
开发者ID:vigneshncc,项目名称:mongo,代码行数:76,


示例7: QDialog

KeyManager::KeyManager(QWidget *parent) : QDialog(parent){    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);    setWindowIcon(QIcon(":/gfx/key.png"));    resize(540, 0);    keyCreator = new KeyCreator(this);    radioPem = new QRadioButton(this);    radioKey = new QRadioButton(this);    radioPem->setText("PEM/PK8");    boxPem = new FileBox(this);    boxPk8 = new FileBox(this);    boxKey = new FileBox(this);    boxPem->setTitle("PEM:");    boxPk8->setTitle("PK8:");    boxPem->setTitleWidth(26);    boxPk8->setTitleWidth(26);    boxPem->setFormats("PEM (*.pem);;");    boxPk8->setFormats("PK8 (*.pk8);;");    boxKey->setFormats("KeyStore (*.keystore);;");    btnNew = new QPushButton(this);    QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);    labelAlias = new QLabel(this);    labelAliasPass = new QLabel(this);    labelStorePass = new QLabel(this);    editAlias = new QLineEdit(this);    editAliasPass = new QLineEdit(this);    editStorePass = new QLineEdit(this);    editAliasPass->setEchoMode(QLineEdit::Password);    editStorePass->setEchoMode(QLineEdit::Password);    groupPem = new QGroupBox(this);    QVBoxLayout *layoutPem = new QVBoxLayout;    layoutPem->addWidget(boxPem);    layoutPem->addWidget(boxPk8);    groupPem->setLayout(layoutPem);    groupKey = new QGroupBox(this);    QGridLayout *layoutKey = new QGridLayout;    layoutKey->addWidget(boxKey, 0, 0, 1, 0);    layoutKey->addWidget(labelStorePass, 1, 0);    layoutKey->addWidget(editStorePass, 1, 1);    layoutKey->addWidget(labelAlias, 2, 0, Qt::AlignLeft);    layoutKey->addWidget(editAlias, 2, 1);    layoutKey->addWidget(labelAliasPass, 3, 0, Qt::AlignLeft);    layoutKey->addWidget(editAliasPass, 3, 1);    layoutKey->addWidget(btnNew, 4, 0, 1, 0);    groupKey->setLayout(layoutKey);    QVBoxLayout *layout = new QVBoxLayout(this);    layout->addWidget(radioPem);    layout->addWidget(radioKey);    layout->addWidget(groupPem);    layout->addWidget(groupKey);    layout->addWidget(buttons);    connect(radioPem, SIGNAL(clicked()), this, SLOT(setOptionPem()));    connect(radioKey, SIGNAL(clicked()), this, SLOT(setOptionKey()));    connect(btnNew, SIGNAL(clicked()), keyCreator, SLOT(open()));    connect(keyCreator, SIGNAL(created(QString)), this, SLOT(setFileKey(QString)));    connect(keyCreator, SIGNAL(success(QString, QString)), this, SIGNAL(success(QString, QString)));    connect(keyCreator, SIGNAL(warning(QString, QString)), this, SIGNAL(warning(QString, QString)));    connect(keyCreator, SIGNAL(error(QString, QString)), this, SIGNAL(error(QString, QString)));    connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));    connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));}
开发者ID:vaginessa,项目名称:apk-icon-editor,代码行数:75,


示例8: warning

void KeyCreator::accept(){    // Validate data:    if (editStorePass1->text().length() < 6) {        emit warning(NULL, tr("Password must be at least 6 characters."));        editStorePass1->setFocus();        editStorePass1->selectAll();        return;    }    if (editStorePass1->text() != editStorePass2->text()) {        emit warning(NULL, tr("Passwords do not match."));        editStorePass2->setFocus();        editStorePass2->selectAll();        return;    }    if (editAlias->text().isEmpty()) {        emit warning(NULL, tr("Enter alias name."));        editAlias->setFocus();        editAlias->selectAll();        return;    }    if (editAliasPass1->text() != editAliasPass2->text()) {        emit warning(NULL, tr("Passwords do not match."));        editAliasPass2->setFocus();        editAliasPass2->selectAll();        return;    }    if (editAliasPass1->text().length() < 6) {        emit warning(NULL, tr("Password must be at least 6 characters."));        editAliasPass1->setFocus();        editAliasPass1->selectAll();        return;    }    // Create KeyStore and Alias:    const QString FILENAME = QFileDialog::getSaveFileName(this, NULL, NULL, "KeyStore (*.keystore)");    if (FILENAME.isEmpty()) {        return;    }    qDebug() << "Creating KeyStore...";    const QString ENV_PATH = qgetenv("PATH");    const QString JAVA_HOME = qgetenv("JAVA_HOME");    const QString KEYTOOL_CMD =            QString("keytool -genkeypair -v -keystore /"%1/" -storepass /"%10/""                    " -alias /"%2/" -keyalg RSA -keysize 2048"                    " -dname /"CN=%3, OU=%4, O=%5, L=%6, S=%7, C=%8/""                    " -validity %9 -keypass /"%11/"")                        .arg(FILENAME)                        .arg(editAlias->text())                        .arg(editName->text())                        .arg(editUnit->text())                        .arg(editOrgan->text())                        .arg(editCity->text())                        .arg(editState->text())                        .arg(editCountry->text())                        .arg(editYears->text().toInt() * 365);    qputenv("PATH", ENV_PATH.toStdString().c_str());    qputenv("PATH", QString("%1;%2/bin").arg(ENV_PATH, JAVA_HOME).toStdString().c_str());    qDebug() << qPrintable(KEYTOOL_CMD.arg("*****", "*****"));    QProcess p;    p.start(KEYTOOL_CMD.arg(editStorePass1->text(), editAliasPass1->text()));    qputenv("PATH", ENV_PATH.toStdString().c_str());    if (p.waitForStarted(-1)) {        p.waitForFinished(10000);        if (p.exitCode() != 0) {            QString error_text = p.readAllStandardError().trimmed();            if (error_text.isEmpty()) error_text = p.readAllStandardOutput().trimmed();            qDebug() << qPrintable(QString("Keytool exit code: %1").arg(p.exitCode()));            qDebug() << error_text;            emit warning("Keytool", tr("%1: invalid parameters").arg("Keytool"));            return;        }    }    else {        const QString ERROR_TEXT = tr("Error starting %1./n"                                      "Check your JDK installation and "                                      "PATH environment variable.").arg("Keytool");        emit error("Keytool", ERROR_TEXT);        return;    }    qDebug() << "Done./n";    emit success("Keytool", tr("KeyStore successfully created/updated!"));    emit created(FILENAME);    clear();    QDialog::accept();}
开发者ID:vaginessa,项目名称:apk-icon-editor,代码行数:93,


示例9: packtrans

//.........这里部分代码省略.........			ach = cwork;			ast = swork;			cnt = k;			cpackflg[st] = TRUE;# endif		}	}	for(i=0; i<st; i++){	/* get most similar state */				/* reject state with more transitions, state already represented by a third state,					and state which is compressed by char if ours is not to be */		if(sfall[i] != -1) continue;		if(cpackflg[st] == 1) if(!(cpackflg[i] == 1)) continue;		p = gotof[i];		if(p == -1) /* no transitions */ continue;		tcnt = nexts[p];		if(tcnt > cnt) continue;		diff = 0;		j = 0;		upper = p + tcnt;		while(ach[j] && p < upper){			while(ach[j] < nchar[p] && ach[j]){diff++; j++; }			if(ach[j] == 0)break;			if(ach[j] > nchar[p]){diff=NCH;break;}			/* ach[j] == nchar[p] */			if(ast[j] != nexts[++p] || ast[j] == -1 || (cpackflg[st] && ach[j] != match[ach[j]]))diff++;			j++;		}		while(ach[j]){			diff++;			j++;		}		if(p < upper)diff = NCH;		if(diff < cval && diff < tcnt){			cval = diff;			cmin = i;			if(cval == 0)break;		}	}	/* cmin = state "most like" state st */# ifdef DEBUG	if(debug)print("select st %d for st %d diff %d/n",cmin,st,cval);# endif# ifdef PS	if(cmin != -1){ /* if we can use st cmin */		gotof[st] = nptr;		k = 0;		sfall[st] = cmin;		p = gotof[cmin]+1;		j = 0;		while(ach[j]){			/* if cmin has a transition on c, then so will st */			/* st may be "larger" than cmin, however */			while(ach[j] < nchar[p-1] && ach[j]){				k++;				nchar[nptr] = ach[j];				nexts[++nptr] = ast[j];				j++;			}			if(nchar[p-1] == 0)break;			if(ach[j] > nchar[p-1]){				warning("bad transition %d %d",st,cmin);				goto nopack;			}			/* ach[j] == nchar[p-1] */			if(ast[j] != nexts[p] || ast[j] == -1 || (cpackflg[st] && ach[j] != match[ach[j]])){				k++;				nchar[nptr] = ach[j];				nexts[++nptr] = ast[j];			}			p++;			j++;		}		while(ach[j]){			nchar[nptr] = ach[j];			nexts[++nptr] = ast[j++];			k++;		}		nexts[gotof[st]] = cnt = k;		nchar[nptr++] = 0;	} else {# endifnopack:	/* stick it in */		gotof[st] = nptr;		nexts[nptr] = cnt;		for(i=0;i<cnt;i++){			nchar[nptr] = ach[i];			nexts[++nptr] = ast[i];		}		nchar[nptr++] = 0;# ifdef PS	}# endif	if(cnt < 1){		gotof[st] = -1;		nptr--;	} else		if(nptr > ntrans)			error("Too many transitions %s",(ntrans==NTRANS?"/nTry using %a num":""));}
开发者ID:99years,项目名称:plan9,代码行数:101,


示例10: mach_xfer_memory

//.........这里部分代码省略.........        }      r_end = r_start + r_size;      CHECK_FATAL (r_start <= cur_memaddr);      CHECK_FATAL (r_end >= cur_memaddr);      CHECK_FATAL ((r_start % pagesize) == 0);      CHECK_FATAL ((r_end % pagesize) == 0);      CHECK_FATAL (r_end >= (r_start + pagesize));      if ((cur_memaddr % pagesize) != 0)        {          int max_len = pagesize - (cur_memaddr % pagesize);          int op_len = cur_len;          if (op_len > max_len)            {              op_len = max_len;            }          ret = mach_xfer_memory_remainder (cur_memaddr, cur_myaddr, op_len,                                            write, task);        }      else if (cur_len >= pagesize)        {          int max_len = r_end - cur_memaddr;          int op_len = cur_len;          if (op_len > max_len)            {              op_len = max_len;            }          op_len -= (op_len % pagesize);          ret = mach_xfer_memory_block (cur_memaddr, cur_myaddr, op_len,                                        write, task);        }      else        {          ret = mach_xfer_memory_remainder (cur_memaddr, cur_myaddr, cur_len,                                            write, task);        }      if (write)        {	  /* This vm_machine_attribute isn't supported on i386,	     so let's not try.  */#if defined (TARGET_POWERPC)	  vm_machine_attribute_val_t flush = MATTR_VAL_CACHE_FLUSH;          kret = vm_machine_attribute (task, r_start, r_size,                                       MATTR_CACHE, &flush);          if (kret != KERN_SUCCESS)            {              static int nwarn = 0;              nwarn++;              if (nwarn <= MAX_INSTRUCTION_CACHE_WARNINGS)                {                  warning                    ("Unable to flush data/instruction cache for region at 0x%8.8llx: %s",                     (uint64_t) r_start, MACH_ERROR_STRING (ret));                }              if (nwarn == MAX_INSTRUCTION_CACHE_WARNINGS)                {                  warning                    ("Support for flushing the data/instruction cache on this "		     "machine appears broken");                  warning ("No further warning messages will be given.");                }            }#endif	  /* Try and restore permissions on the minimal address range.  */	  if (changed_protections)	    {	      mach_vm_size_t prot_size;	      if (cur_len < r_size - (cur_memaddr - r_start))		prot_size = cur_len;	      else		prot_size = cur_memaddr - r_start;	      kret = macosx_vm_protect (task, r_start, r_size, 					cur_memaddr, prot_size, 					orig_protection, 0);	      if (kret != KERN_SUCCESS)		{		  warning		    ("Unable to restore original permissions for region at 0x%8.8llx",		     (uint64_t) r_start);		}	    }        }      cur_memaddr += ret;      cur_myaddr += ret;      cur_len -= ret;      if (ret == 0)        {          break;        }    }  return len - cur_len;}
开发者ID:HoMeCracKeR,项目名称:gdb-ng,代码行数:101,


示例11: sentinelTimestamp

void OplogReader::connectToSyncSource(OperationContext* txn,                                      const OpTime& lastOpTimeFetched,                                      ReplicationCoordinator* replCoord) {    const Timestamp sentinelTimestamp(duration_cast<Seconds>(Milliseconds(curTimeMillis64())), 0);    const OpTime sentinel(sentinelTimestamp, std::numeric_limits<long long>::max());    OpTime oldestOpTimeSeen = sentinel;    invariant(conn() == NULL);    while (true) {        HostAndPort candidate = replCoord->chooseNewSyncSource(lastOpTimeFetched.getTimestamp());        if (candidate.empty()) {            if (oldestOpTimeSeen == sentinel) {                // If, in this invocation of connectToSyncSource(), we did not successfully                // connect to any node ahead of us,                // we apparently have no sync sources to connect to.                // This situation is common; e.g. if there are no writes to the primary at                // the moment.                return;            }            // Connected to at least one member, but in all cases we were too stale to use them            // as a sync source.            error() << "too stale to catch up -- entering maintenance mode";            log() << "our last optime : " << lastOpTimeFetched;            log() << "oldest available is " << oldestOpTimeSeen;            log() << "See http://dochub.mongodb.org/core/resyncingaverystalereplicasetmember";            setMinValid(txn, {lastOpTimeFetched, oldestOpTimeSeen});            auto status = replCoord->setMaintenanceMode(true);            if (!status.isOK()) {                warning() << "Failed to transition into maintenance mode.";            }            bool worked = replCoord->setFollowerMode(MemberState::RS_RECOVERING);            if (!worked) {                warning() << "Failed to transition into " << MemberState(MemberState::RS_RECOVERING)                          << ". Current state: " << replCoord->getMemberState();            }            return;        }        if (!connect(candidate)) {            LOG(2) << "can't connect to " << candidate.toString() << " to read operations";            resetConnection();            replCoord->blacklistSyncSource(candidate, Date_t::now() + Seconds(10));            continue;        }        // Read the first (oldest) op and confirm that it's not newer than our last        // fetched op. Otherwise, we have fallen off the back of that source's oplog.        BSONObj remoteOldestOp(findOne(rsOplogName.c_str(), Query()));        OpTime remoteOldOpTime =            fassertStatusOK(28776, OpTime::parseFromOplogEntry(remoteOldestOp));        // remoteOldOpTime may come from a very old config, so we cannot compare their terms.        if (!lastOpTimeFetched.isNull() &&            lastOpTimeFetched.getTimestamp() < remoteOldOpTime.getTimestamp()) {            // We're too stale to use this sync source.            resetConnection();            replCoord->blacklistSyncSource(candidate, Date_t::now() + Minutes(1));            if (oldestOpTimeSeen.getTimestamp() > remoteOldOpTime.getTimestamp()) {                warning() << "we are too stale to use " << candidate.toString()                          << " as a sync source";                oldestOpTimeSeen = remoteOldOpTime;            }            continue;        }        // TODO: If we were too stale (recovering with maintenance mode on), then turn it off, to        //       allow becoming secondary/etc.        // Got a valid sync source.        return;    }  // while (true)}
开发者ID:AnkyrinRepeat,项目名称:mongo,代码行数:75,


示例12: main

int main(int argc, char *argv[]){    gif_bitmap_callback_vt bitmap_callbacks = {        bitmap_create,        bitmap_destroy,        bitmap_get_buffer,        bitmap_set_opaque,        bitmap_test_opaque,        bitmap_modified    };    gif_animation gif;    size_t size;    gif_result code;    unsigned int i;    if (argc != 2) {        fprintf(stderr, "Usage: %s image.gif/n", argv[0]);        return 1;    }    /* create our gif animation */    gif_create(&gif, &bitmap_callbacks);    /* load file into memory */    unsigned char *data = load_file(argv[1], &size);    /* begin decoding */    do {        code = gif_initialise(&gif, size, data);        if (code != GIF_OK && code != GIF_WORKING) {            warning("gif_initialise", code);            exit(1);        }    } while (code != GIF_OK);    printf("P3/n");    printf("# %s/n", argv[1]);    printf("# width                %u /n", gif.width);    printf("# height               %u /n", gif.height);    printf("# frame_count          %u /n", gif.frame_count);    printf("# frame_count_partial  %u /n", gif.frame_count_partial);    printf("# loop_count           %u /n", gif.loop_count);    printf("%u %u 256/n", gif.width, gif.height * gif.frame_count);    /* decode the frames */    for (i = 0; i != gif.frame_count; i++) {        unsigned int row, col;        unsigned char *image;        code = gif_decode_frame(&gif, i);        if (code != GIF_OK)            warning("gif_decode_frame", code);        printf("# frame %u:/n", i);        image = (unsigned char *) gif.frame_image;        for (row = 0; row != gif.height; row++) {            for (col = 0; col != gif.width; col++) {                size_t z = (row * gif.width + col) * 4;                printf("%u %u %u ",                    (unsigned char) image[z],                    (unsigned char) image[z + 1],                    (unsigned char) image[z + 2]);            }            printf("/n");        }    }    /* clean up */    gif_finalise(&gif);    free(data);    return 0;}
开发者ID:diogenesmonteiro,项目名称:carbotan,代码行数:73,


示例13: OPENSSL_MSVC_PRAGMA

 * copied and put under another distribution licence * [including the GNU Public Licence.] */#include <openssl/bio.h>#include <assert.h>#include <errno.h>#include <string.h>#if !defined(OPENSSL_WINDOWS)#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <unistd.h>#elseOPENSSL_MSVC_PRAGMA(warning(push, 3))#include <winsock2.h>#include <ws2tcpip.h>OPENSSL_MSVC_PRAGMA(warning(pop))#endif#include <openssl/buf.h>#include <openssl/err.h>#include <openssl/mem.h>#include "internal.h"#include "../internal.h"enum {  BIO_CONN_S_BEFORE,
开发者ID:ThomasWo,项目名称:proto-quic,代码行数:31,


示例14: gdk_threads_init

static void *gtk_thread(void *arg){	struct gtk_mod *mod = arg;	GtkMenuShell *app_menu;	GtkWidget *item;	GError *err = NULL;	struct le *le;	gdk_threads_init();	gtk_init(0, NULL);	g_set_application_name("baresip");	mod->app = g_application_new ("com.creytiv.baresip",			G_APPLICATION_FLAGS_NONE);	g_application_register (G_APPLICATION (mod->app), NULL, &err);	if (err != NULL) {		warning ("Unable to register GApplication: %s",				err->message);		g_error_free (err);		err = NULL;	}#ifdef USE_LIBNOTIFY	notify_init("baresip");#endif	mod->status_icon = gtk_status_icon_new_from_icon_name("call-start");	gtk_status_icon_set_tooltip_text (mod->status_icon, "baresip");	g_signal_connect(G_OBJECT(mod->status_icon),			"button_press_event",			G_CALLBACK(status_icon_on_button_press), mod);	gtk_status_icon_set_visible(mod->status_icon, TRUE);	mod->contacts_inited = false;	mod->dial_dialog = NULL;	mod->call_windows = NULL;	mod->incoming_call_menus = NULL;	/* App menu */	mod->app_menu = gtk_menu_new();	app_menu = GTK_MENU_SHELL(mod->app_menu);	/* Account submenu */	mod->accounts_menu = gtk_menu_new();	mod->accounts_menu_group = NULL;	item = gtk_menu_item_new_with_mnemonic("_Account");	gtk_menu_shell_append(app_menu, item);	gtk_menu_item_set_submenu(GTK_MENU_ITEM(item),			mod->accounts_menu);	/* Add accounts to submenu */	for (le = list_head(uag_list()); le; le = le->next) {		struct ua *ua = le->data;		accounts_menu_add_item(mod, ua);	}	/* Status submenu */	mod->status_menu = gtk_menu_new();	item = gtk_menu_item_new_with_mnemonic("_Status");	gtk_menu_shell_append(GTK_MENU_SHELL(app_menu), item);	gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), mod->status_menu);	/* Open */	item = gtk_radio_menu_item_new_with_label(NULL, "Open");	g_object_set_data(G_OBJECT(item), "presence",			GINT_TO_POINTER(PRESENCE_OPEN));	g_signal_connect(item, "activate",			G_CALLBACK(menu_on_presence_set), mod);	gtk_menu_shell_append(GTK_MENU_SHELL(mod->status_menu), item);	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);	/* Closed */	item = gtk_radio_menu_item_new_with_label_from_widget(			GTK_RADIO_MENU_ITEM(item), "Closed");	g_object_set_data(G_OBJECT(item), "presence",			GINT_TO_POINTER(PRESENCE_CLOSED));	g_signal_connect(item, "activate",			G_CALLBACK(menu_on_presence_set), mod);	gtk_menu_shell_append(GTK_MENU_SHELL(mod->status_menu), item);	gtk_menu_shell_append(app_menu, gtk_separator_menu_item_new());	/* Dial */	item = gtk_menu_item_new_with_mnemonic("_Dial...");	gtk_menu_shell_append(app_menu, item);	g_signal_connect(G_OBJECT(item), "activate",			G_CALLBACK(menu_on_dial), mod);	/* Dial contact */	mod->contacts_menu = gtk_menu_new();	item = gtk_menu_item_new_with_mnemonic("Dial _contact");	gtk_menu_shell_append(app_menu, item);	gtk_menu_item_set_submenu(GTK_MENU_ITEM(item),			mod->contacts_menu);	gtk_menu_shell_append(app_menu, gtk_separator_menu_item_new());	/* About *///.........这里部分代码省略.........
开发者ID:Studio-Link,项目名称:baresip,代码行数:101,


示例15: cfoll

voidcfoll(int v){	int i,j,k;	uchar *p;	i = name[v];	if(i < NCH) i = 1;	/* character */	switch(i){		case 1: case RSTR: case RCCL: case RNCCL: case RNULLS:			for(j=0;j<tptr;j++)				tmpstat[j] = FALSE;			count = 0;			follow(v);# ifdef PP			padd(foll,v);		/* packing version */# endif# ifndef PP			add(foll,v);		/* no packing version */# endif			if(i == RSTR) cfoll(left[v]);			else if(i == RCCL || i == RNCCL){	/* compress ccl list */				for(j=1; j<NCH;j++)					symbol[j] = (i==RNCCL);				p = ptr[v];				while(*p)					symbol[*p++] = (i == RCCL);				p = pcptr;				for(j=1;j<NCH;j++)					if(symbol[j]){						for(k=0;p+k < pcptr; k++)							if(cindex[j] == *(p+k))								break;						if(p+k >= pcptr)*pcptr++ = cindex[j];					}				*pcptr++ = 0;				if(pcptr > pchar + pchlen)					error("Too many packed character classes");				ptr[v] = p;				name[v] = RCCL;	/* RNCCL eliminated */# ifdef DEBUG				if(debug && *p){					print("ccl %d: %d",v,*p++);					while(*p)						print(", %d",*p++);					print("/n");				}# endif			}			break;		case CARAT:			cfoll(left[v]);			break;		case STAR: case PLUS: case QUEST: case RSCON: 			cfoll(left[v]);			break;		case BAR: case RCAT: case DIV: case RNEWE:			cfoll(left[v]);			cfoll(right[v]);			break;# ifdef DEBUG		case FINAL:		case S1FINAL:		case S2FINAL:			break;		default:			warning("bad switch cfoll %d",v);# endif	}}
开发者ID:99years,项目名称:plan9,代码行数:69,



注:本文中的warning函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ warningf函数代码示例
C++ warnf函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。