本文整理汇总了C++中raiseError函数的典型用法代码示例。如果您正苦于以下问题:C++ raiseError函数的具体用法?C++ raiseError怎么用?C++ raiseError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了raiseError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: loadAnimation
/**
* アニメーションを読み込む
*/
void loadAnimation(ANIME_SET* graphic,ARCHIVE* archive,const char* file_name){
BUF* gfx_file = getFile(archive,file_name);
//ヘッダを飛ばす。
seekBuf(gfx_file,(long)strlen(ANIME_HEADER),SEEK_SET);
//ファイル名取得
int filename_size;
readBuf(gfx_file,&filename_size,sizeof(filename_size));
graphic->filename_size = filename_size;
graphic->filename = malloc(filename_size+1);
readBuf(gfx_file,graphic->filename,filename_size);
graphic->filename[filename_size] = '\0';
//スプライト取得
SDL_RWops* frame_ops = getGraphixFile(archive,graphic->filename);
getSpriteFromOPS(&graphic->sprite,frame_ops);
frame_ops->close(frame_ops); //メモリ開放は忘れずに
//スプライトエリア用スプライト
SPRITE* anime_sprite = &graphic->sprite;
//モード、フラグ、アニメ数。
readBuf(gfx_file,&graphic->mode,sizeof(graphic->mode));
readBuf(gfx_file,&graphic->flag,sizeof(graphic->flag));
readBuf(gfx_file,&graphic->anime_num,sizeof(graphic->anime_num));
int anime_num = graphic->anime_num;
graphic->anime = malloc( sizeof(ANIMATION*) * anime_num );
int i=0;
for(;i<anime_num;i++){
//アニメ番号
int num = 0;
readBuf(gfx_file,&num,sizeof(num));
if(anime_num < num) raiseError("invalid animation file:",file_name);
//メモリ確保。
graphic->anime[num] = malloc(sizeof(ANIMATION));
ANIMATION* anime = graphic->anime[num];
anime->num = num;
//フレーム番号取得
int frame_num;
readBuf(gfx_file,&frame_num,sizeof(frame_num));
anime->frame_num = frame_num;
anime->frame = malloc(sizeof(ANIMATION_FRAME)*frame_num);
int j;
for(j=0;i<frame_num;j++){
//フレームへのポインタの設定
ANIMATION_FRAME* frame = &anime->frame[j];
//持続時間
readBuf(gfx_file,&frame->frame_time,sizeof(frame->frame_time));
//スプライトの設定
frame->sprite_area.sprite = anime_sprite;
readBuf(gfx_file,&frame->sprite_area.x,sizeof(frame->sprite_area.x));
readBuf(gfx_file,&frame->sprite_area.y,sizeof(frame->sprite_area.y));
readBuf(gfx_file,&frame->sprite_area.width,sizeof(frame->sprite_area.width));
readBuf(gfx_file,&frame->sprite_area.height,sizeof(frame->sprite_area.height));
}
}
deleteBuf(gfx_file);
}
开发者ID:ledyba,项目名称:20060910-C-Stg,代码行数:57,代码来源:animation.c
示例2: c_init_serial
void c_init_serial(
TermPair *termStorage, const char *devicePath,
const int speed, const Bool hw_flow_control
) {
if (termStorage == NULL) {
raiseError("The storage for the file descriptor must not be NULL");
}
termStorage->fd = open(devicePath, O_RDWR|O_NONBLOCK);
c_init_serialFD(termStorage, speed, hw_flow_control);
}
开发者ID:odeke-em,项目名称:telemetry-over-wifi,代码行数:11,代码来源:cserial.c
示例3: wasserted
/* "warning" assert -- safe to continue, so we don't throw exception. */
void wasserted(const char *msg, const char *file, unsigned line) {
problem() << "warning Assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
sayDbContext();
raiseError(0,msg && *msg ? msg : "wassertion failure");
assertionCount.condrollover( ++assertionCount.warning );
#if defined(_DEBUG) || defined(_DURABLEDEFAULTON)
// this is so we notice in buildbot
log() << "\n\n***aborting after wassert() failure in a debug/test build\n\n" << endl;
abort();
#endif
}
开发者ID:andradeandrey,项目名称:mongo,代码行数:12,代码来源:assert_util.cpp
示例4: raiseError
static PyObject *isOptionSettable (PyObject * self, PyObject * args)
{
SANE_Int cap;
long lg;
if (!PyArg_ParseTuple (args, "l", &lg))
raiseError("Invalid arguments");
cap = lg;
return PyInt_FromLong (SANE_OPTION_IS_SETTABLE (cap));
}
开发者ID:danwallach,项目名称:VoteBox-v1,代码行数:11,代码来源:scanext.c
示例5: if
void XSchemaSequence::scanForAttributes(QDomAttr &attribute, void * /*context*/)
{
QString name = attribute.nodeName();
if(name == IO_GENERIC_ID) {
_id = attribute.value() ;
} else if(name == IO_GENERIC_MINOCCURS) {
if(!_minOccurs.setValueFromAttribute(attribute.value())) {
raiseError(this, attribute, false);
}
} else if(name == IO_GENERIC_MAXOCCURS) {
if(!_maxOccurs.setValueFromAttribute(attribute.value())) {
raiseError(this, attribute, false);
}
} else {
if(!readOtherAttributes(attribute)) {
raiseError(this, attribute, false);
}
}
}
开发者ID:superliujian,项目名称:ICD_Creator,代码行数:20,代码来源:XSDSchemaSequence.cpp
示例6: asserted
void asserted(const char *msg, const char *file, unsigned line) {
problem() << "Assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
sayDbContext();
raiseError(msg && *msg ? msg : "assertion failure");
lastAssert[0].set(msg, getDbContext().c_str(), file, line);
stringstream temp;
temp << "assertion " << file << ":" << line;
AssertionException e;
e.msg = temp.str();
throw e;
}
开发者ID:hashrocket,项目名称:mongo,代码行数:11,代码来源:assert_util.cpp
示例7: fitModel
PClassifier TLogRegLearner::operator()(PExampleGenerator gen, const int &weight)
{
int error;
PVariable var;
PClassifier cl = fitModel(gen, weight, error, var);
if (error >= TLogRegFitter::Constant)
raiseError("%s in %s", error==TLogRegFitter::Constant ? "constant" : "singularity", var->get_name().c_str());
return cl;
}
开发者ID:electricFeel,项目名称:BeatKeeperHRM,代码行数:11,代码来源:logistic.cpp
示例8: server
void QxThreadPool::runServer()
{
QxServer server(this);
server.setMaxPendingConnections(QxConnect::getSingleton()->getThreadCount());
quint16 serverPort = (quint16)(QxConnect::getSingleton()->getPort());
if (! server.listen(QHostAddress::Any, serverPort))
{ raiseError(QString("[QxOrm] cannot run server : '") + server.errorString() + QString("'"), QxTransaction_ptr()); return; }
Q_EMIT serverIsRunning(true, (& server));
exec();
Q_EMIT serverIsRunning(false, NULL);
}
开发者ID:arBmind,项目名称:QxORM-1.32,代码行数:11,代码来源:QxThreadPool.cpp
示例9: loadAnimation
/**
* アニメーションを読み込む
*/
void loadAnimation(ANIME_SET* graphic,ARCHIVE* archive,const char* file_name){
SDL_RWops* gfx_file = getFile(archive,file_name);
//ヘッダを飛ばす。
SDL_RWseek(gfx_file,(long)strlen(ANIME_HEADER),SEEK_SET);
//ファイル名取得
int filename_size;
SDL_RWread(gfx_file,&filename_size,sizeof(filename_size),1);
graphic->filename_size = filename_size;
graphic->filename = malloc(filename_size+1);
SDL_RWread(gfx_file,graphic->filename,filename_size,1);
graphic->filename[filename_size] = '\0';
//モード、フラグ、アニメ数、アルファブレンディング
SDL_RWread(gfx_file,&graphic->mode,sizeof(graphic->mode),1);
SDL_RWread(gfx_file,&graphic->flag,sizeof(graphic->flag),1);
SDL_RWread(gfx_file,&graphic->anime_num,sizeof(graphic->anime_num),1);
SDL_RWread(gfx_file,&graphic->is_alpha_blending,sizeof(graphic->is_alpha_blending),1);
//スプライト取得
getSpriteFromArchive(&graphic->sprite,archive,graphic->filename,graphic->is_alpha_blending,TRUE);
//スプライトエリア用スプライト
SPRITE* anime_sprite = &graphic->sprite;
int anime_num = graphic->anime_num;
graphic->anime = malloc( sizeof(ANIMATION*) * anime_num );
int i=0;
for(;i<anime_num;i++){
//アニメ番号
int num = 0;
SDL_RWread(gfx_file,&num,sizeof(num),1);
if(anime_num < num) raiseError("invalid animation file:",file_name);
//メモリ確保。
graphic->anime[num] = malloc(sizeof(ANIMATION));
ANIMATION* anime = graphic->anime[num];
anime->num = num;
//フレーム番号取得
int frame_num;
SDL_RWread(gfx_file,&frame_num,sizeof(frame_num),1);
anime->frame_num = frame_num;
anime->frame = malloc(sizeof(ANIMATION_FRAME)*frame_num);
int j;
for(j=0;i<frame_num;j++){
//フレームへのポインタの設定
ANIMATION_FRAME* frame = &anime->frame[j];
//持続時間
SDL_RWread(gfx_file,&frame->frame_time,sizeof(frame->frame_time),1);
//スプライトの設定
int x,y,w,h;
SDL_RWread(gfx_file,&x,sizeof(x),1);
SDL_RWread(gfx_file,&y,sizeof(y),1);
SDL_RWread(gfx_file,&w,sizeof(w),1);
SDL_RWread(gfx_file,&h,sizeof(h),1);
makeSpriteArea(&frame->sprite_area,anime_sprite,x,y,w,h);
}
}
SDL_RWclose(gfx_file);
}
开发者ID:ledyba,项目名称:PGL_-_PsiGameLibrary,代码行数:57,代码来源:animation.c
示例10: acmFormatTagDetails
CACMWaveFormat::CACMWaveFormat(WORD fmt, DWORD sz)
{
MMRESULT mmr;
m_fmt = NULL;
m_size = 0;
if (0 == sz)
{
CACMStruct<ACMFORMATTAGDETAILS> tagD;
// WIN95 bug keeps us from using the correct fmt here,
// because acmFormatEnum fails later if not
tagD->dwFormatTag = WAVE_FORMAT_UNKNOWN;
mmr = acmFormatTagDetails(NULL,
tagD,
ACM_FORMATTAGDETAILSF_LARGESTSIZE
);
if (0 != mmr)
raiseError(mmr,
"Error getting format descriptor size");
sz = tagD->cbFormatSize;
}
m_fmt = (LPWAVEFORMATEX)
GlobalAlloc(GMEM_FIXED|GMEM_ZEROINIT, sz);
if (m_fmt)
{
m_fmt->wFormatTag = fmt;
m_size = sz;
}
else
{
raiseError(MMSYSERR_NOMEM,
"No memory for wave format descriptor");
}
}
开发者ID:Marenz,项目名称:EnemyNations,代码行数:41,代码来源:ACMUTIL.CPP
示例11: while
void QHelpProjectDataPrivate::readProject()
{
while (!atEnd()) {
readNext();
if (isStartElement()) {
if (name() == QLatin1String("virtualFolder")) {
virtualFolder = readElementText();
if (!hasValidSyntax(QLatin1String("test"), virtualFolder))
raiseError(QCoreApplication::translate("QHelpProject",
"Virtual folder has invalid syntax in file: \"%1\"").arg(fileName));
} else if (name() == QLatin1String("namespace")) {
namespaceName = readElementText();
if (!hasValidSyntax(namespaceName, QLatin1String("test")))
raiseError(QCoreApplication::translate("QHelpProject",
"Namespace \"%1\" has invalid syntax in file: \"%2\"").arg(namespaceName, fileName));
} else if (name() == QLatin1String("customFilter")) {
readCustomFilter();
} else if (name() == QLatin1String("filterSection")) {
readFilterSection();
} else if (name() == QLatin1String("metaData")) {
QString n = attributes().value(QLatin1String("name")).toString();
if (!metaData.contains(n))
metaData[n]
= attributes().value(QLatin1String("value")).toString();
else
metaData.insert(n, attributes().
value(QLatin1String("value")).toString());
} else {
raiseUnknownTokenError();
}
} else if (isEndElement() && name() == QLatin1String("QtHelpProject")) {
if (namespaceName.isEmpty())
raiseError(QCoreApplication::translate("QHelpProject",
"Missing namespace in QtHelpProject file: \"%1\"").arg(fileName));
else if (virtualFolder.isEmpty())
raiseError(QCoreApplication::translate("QHelpProject",
"Missing virtual folder in QtHelpProject file: \"%1\"").arg(fileName));
break;
}
}
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:41,代码来源:qhelpprojectdata.cpp
示例12: openXmlFile
static bool openXmlFile(QDomDocument &doc, const Utils::FileName &fileName)
{
QFile f(fileName.toString());
if (!f.open(QIODevice::ReadOnly))
return false;
if (!doc.setContent(f.readAll())) {
raiseError(AndroidManager::tr("Cannot parse \"%1\".").arg(fileName.toUserOutput()));
return false;
}
return true;
}
开发者ID:choenig,项目名称:qt-creator,代码行数:12,代码来源:androidmanager.cpp
示例13: return
bool xbnode::getBool()
{
if( isBool() )
return (this->getText()=="true");
if( isNumeric() )
return getNumeric()!=0;
if( isText() )
return !getText().empty();
raiseError( "getBool() cant convert", __FILE__,__LINE__);
return false;
}
开发者ID:manumehta123,项目名称:xbn,代码行数:12,代码来源:xbnode.cpp
示例14: addData
void QHelpProjectDataPrivate::readData(const QByteArray &contents)
{
addData(contents);
while (!atEnd()) {
readNext();
if (isStartElement()) {
if (name() == QLatin1String("QtHelpProject")
&& attributes().value(QLatin1String("version")) == QLatin1String("1.0"))
readProject();
else
raiseError(QCoreApplication::translate("QHelpProject",
"Unknown token. Expected \"QtHelpProject\"."));
}
}
if (hasError()) {
raiseError(QCoreApplication::translate("QHelpProject",
"Error in line %1: %2").arg(lineNumber())
.arg(errorString()));
}
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:21,代码来源:qhelpprojectdata.cpp
示例15: raiseError
bool Crypto::testSha256()
{
QByteArray sha256Test = CryptoHash::hash("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
CryptoHash::Sha256);
if (sha256Test != QByteArray::fromHex("248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1")) {
raiseError("SHA-256 mismatch.");
return false;
}
return true;
}
开发者ID:daniellandau,项目名称:keepassx,代码行数:12,代码来源:Crypto.cpp
示例16: raiseError
void OpenCLFramework<T>::addInputBuffer(int argumentCounter, std::vector<T> input) {
if (vectorSize != -1 && vectorSize != input.size()) {
raiseError("You passed vectors with different lengths to the framework");
}
vectorSize = input.size();
cl_mem inputBuffer = clCreateBuffer(context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, vectorSize * sizeof(T), (void *)&input[0], NULL);
status = clSetKernelArg(kernel, argumentCounter, sizeof(cl_mem), (void *)&inputBuffer);
checkError("clSetKernelArg input");
inputBufferVector.push_back(inputBuffer);
}
开发者ID:KBraham,项目名称:EasyOpenCL,代码行数:12,代码来源:easyopencl.cpp
示例17: asserted
void asserted(const char *msg, const char *file, unsigned line) {
assertionCount.condrollover( ++assertionCount.regular );
problem() << "Assertion failure " << msg << ' ' << file << ' ' << dec << line << endl;
sayDbContext();
raiseError(0,msg && *msg ? msg : "assertion failure");
lastAssert[0].set(msg, getDbContext().c_str(), file, line);
stringstream temp;
temp << "assertion " << file << ":" << line;
AssertionException e(temp.str(),0);
breakpoint();
throw e;
}
开发者ID:kapouer,项目名称:mongo-debian,代码行数:12,代码来源:assert_util.cpp
示例18: QXmlStreamReader
/// Start the parsing of the plist. If it isn't a valid plist this method return false.
/// (it only checks and reads the existence of <plist>)
bool BasePListParser::beginParsing(QIODevice* device)
{
lastErrorMessage_.clear();
elementStack_.clear();
xml_ = new QXmlStreamReader(device);
if( readNextElement("plist" ) ) {
return true;
} else {
raiseError( QObject::tr("Start element not found!"));
return false;
}
}
开发者ID:letmefly,项目名称:edbee-lib,代码行数:15,代码来源:baseplistparser.cpp
示例19: raiseError
PClassifier
TSimpleTreeLearner::operator()(PExampleGenerator ogen, const int &weight)
{
struct Example *examples, *ex;
struct SimpleTreeNode *tree;
struct Args args;
int cls_vals;
if (!ogen->domain->classVar)
raiseError("class-less domain");
if (!ogen->numberOfExamples() > 0)
raiseError("no examples");
/* create a tabel with pointers to examples */
ASSERT(examples = (struct Example *)calloc(ogen->numberOfExamples(), sizeof *examples));
ex = examples;
PEITERATE(ei, ogen) {
ex->example = &(*ei);
ex->weight = 1.0;
ex++;
}
开发者ID:pauloortins,项目名称:Computer-Vision-Classes---UFBA,代码行数:22,代码来源:tdidt_simple.cpp
示例20: cuda_computeCapability
Object cuda_computeCapability(Object self, int nparts, int *argcv,
Object *argv, int flags) {
cuInit(0);
int deviceCount = 0;
cuDeviceGetCount(&deviceCount);
if (deviceCount == 0) {
raiseError("No CUDA devices found");
}
CUdevice cuDevice;
int major, minor;
cuDeviceComputeCapability(&major, &minor, cuDevice);
return alloc_Float64(major + minor / 10.0);
}
开发者ID:mwh,项目名称:grace-cuda,代码行数:13,代码来源:cuda.c
注:本文中的raiseError函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论