本文整理匯總了C++中ERROR_MESSAGE函數的典型用法代碼示例。如果您正苦於以下問題:C++ ERROR_MESSAGE函數的具體用法?C++ ERROR_MESSAGE怎麽用?C++ ERROR_MESSAGE使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ERROR_MESSAGE函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: printLastError
/*
* Print the last transport error
*/
static void
printLastError(jdwpTransportEnv *t, jdwpTransportError err)
{
char *msg;
jbyte *utf8msg;
jdwpTransportError rv;
msg = NULL;
utf8msg = NULL;
rv = (*t)->GetLastError(t, &msg); /* This is a platform encoded string */
if ( msg != NULL ) {
int len;
int maxlen;
/* Convert this string to UTF8 */
len = (int)strlen(msg);
maxlen = len+len/2+2; /* Should allow for plenty of room */
utf8msg = (jbyte*)jvmtiAllocate(maxlen+1);
(void)(gdata->npt->utf8FromPlatform)(gdata->npt->utf,
msg, len, utf8msg, maxlen);
utf8msg[maxlen] = 0;
}
if (rv == JDWPTRANSPORT_ERROR_NONE) {
ERROR_MESSAGE(("transport error %d: %s",err, utf8msg));
} else if ( msg!=NULL ) {
ERROR_MESSAGE(("transport error %d: %s",err, utf8msg));
} else {
ERROR_MESSAGE(("transport error %d: %s",err, "UNKNOWN"));
}
jvmtiDeallocate(msg);
jvmtiDeallocate(utf8msg);
}
示例2: DP_MultipleLocalBlockAlignGeneric
int DP_MultipleLocalBlockAlignGeneric(
const DP_BlockInfo *blocks, DP_BlockScoreFunction BlockScore, DP_LoopPenaltyFunction LoopScore,
unsigned int queryFrom, unsigned int queryTo,
DP_MultipleAlignmentResults **alignments, unsigned int maxAlignments)
{
if (!blocks || blocks->nBlocks < 1 || !blocks->blockSizes || !BlockScore || queryTo < queryFrom) {
ERROR_MESSAGE("DP_MultipleLocalBlockAlignGeneric() - invalid parameters");
return STRUCT_DP_PARAMETER_ERROR;
}
for (unsigned int block=0; block<blocks->nBlocks; ++block) {
if (blocks->freezeBlocks[block] != DP_UNFROZEN_BLOCK) {
WARNING_MESSAGE("DP_MultipleLocalBlockAlignGeneric() - frozen block specifications are ignored...");
break;
}
}
Matrix matrix(blocks->nBlocks, queryTo - queryFrom + 1);
int status = CalculateLocalMatrixGeneric(matrix, blocks, BlockScore, LoopScore, queryFrom, queryTo);
if (status != STRUCT_DP_OKAY) {
ERROR_MESSAGE("DP_MultipleLocalBlockAlignGeneric() - CalculateLocalMatrixGeneric() failed");
return status;
}
return TracebackMultipleLocalAlignments(matrix, blocks, queryFrom, queryTo, alignments, maxAlignments);
}
示例3: DP_GlobalBlockAlign
int DP_GlobalBlockAlign(
const DP_BlockInfo *blocks, DP_BlockScoreFunction BlockScore,
unsigned int queryFrom, unsigned int queryTo,
DP_AlignmentResult **alignment)
{
if (!blocks || blocks->nBlocks < 1 || !blocks->blockSizes || !BlockScore || queryTo < queryFrom) {
ERROR_MESSAGE("DP_GlobalBlockAlign() - invalid parameters");
return STRUCT_DP_PARAMETER_ERROR;
}
unsigned int i, sumBlockLen = 0;
for (i=0; i<blocks->nBlocks; ++i)
sumBlockLen += blocks->blockSizes[i];
if (sumBlockLen > queryTo - queryFrom + 1) {
ERROR_MESSAGE("DP_GlobalBlockAlign() - sum of block lengths longer than query region");
return STRUCT_DP_PARAMETER_ERROR;
}
int status = ValidateFrozenBlockPositions(blocks, queryFrom, queryTo, true);
if (status != STRUCT_DP_OKAY) {
ERROR_MESSAGE("DP_GlobalBlockAlign() - ValidateFrozenBlockPositions() returned error");
return status;
}
Matrix matrix(blocks->nBlocks, queryTo - queryFrom + 1);
status = CalculateGlobalMatrix(matrix, blocks, BlockScore, queryFrom, queryTo);
if (status != STRUCT_DP_OKAY) {
ERROR_MESSAGE("DP_GlobalBlockAlign() - CalculateGlobalMatrix() failed");
return status;
}
return TracebackGlobalAlignment(matrix, blocks, queryFrom, queryTo, alignment);
}
示例4: TracebackGlobalAlignment
int TracebackGlobalAlignment(const Matrix& matrix,
const DP_BlockInfo *blocks, unsigned int queryFrom, unsigned int queryTo,
DP_AlignmentResult **alignment)
{
if (!alignment) {
ERROR_MESSAGE("TracebackGlobalAlignment() - NULL alignment handle");
return STRUCT_DP_PARAMETER_ERROR;
}
*alignment = NULL;
// find max score (e.g., best-scoring position of last block)
int score = DP_NEGATIVE_INFINITY;
unsigned int residue, lastBlockPos = 0;
for (residue=queryFrom; residue<=queryTo; ++residue) {
if (matrix[blocks->nBlocks - 1][residue - queryFrom].score > score) {
score = matrix[blocks->nBlocks - 1][residue - queryFrom].score;
lastBlockPos = residue;
}
}
if (score == DP_NEGATIVE_INFINITY) {
ERROR_MESSAGE("TracebackGlobalAlignment() - somehow failed to find any allowed global alignment");
return STRUCT_DP_ALGORITHM_ERROR;
}
// INFO_MESSAGE("Score of best global alignment: " << score);
*alignment = new DP_AlignmentResult;
return TracebackAlignment(matrix, blocks->nBlocks - 1, lastBlockPos, queryFrom, *alignment);
}
示例5: get
INTERNAL_TYPE_GRID_PA GridPA :: get(INTERNAL_SIZE_GRID_PA seq, INTERNAL_SIZE_SEQ_GRID_PA pos){
if(seq>size()){
ERROR_MESSAGE("Invalid sequence ("<< seq <<").");
}
if(pos>size(seq)){
ERROR_MESSAGE("Invalid pos in sequence ("<< pos <<").");
}
return v_sequences[seq][pos];
}
示例6: CHKMerror
/** <!--******************************************************************-->
*
* @fn CHKMerror
*
* @brief Touched the node and its sons/attributes
*
* @param arg_node Error node to process
* @param arg_info pointer to info structure
*
* @return processed node
*
***************************************************************************/
node *
CHKMerror (node * arg_node, info * arg_info)
{
DBUG_ENTER ("CHKMerror");
NODE_ERROR (arg_node) = CHKMTRAV (NODE_ERROR (arg_node), arg_info);
ERROR_NEXT (arg_node) = CHKMTRAV (ERROR_NEXT (arg_node), arg_info);
ERROR_MESSAGE (arg_node) =
CHKMattribString (ERROR_MESSAGE (arg_node), arg_info);
DBUG_RETURN (arg_node);
}
示例7: createGIF
bool createGIF(string fileName, bool show) {
if (!createImage(fileName, "gif")) {
ERROR_MESSAGE("FSMmodel::createGIF - unable to create GIF from DOT file. Check Graphviz\bin is your PATH.");
return false;
}
if (show && !showImage(fileName + ".gif")) {
ERROR_MESSAGE("FSMmodel::createGIF - unable to show GIF");
return false;
}
return true;
}
示例8: createPNG
bool createPNG(string fileName, bool show) {
if (!createImage(fileName, "png")) {
ERROR_MESSAGE("FSMmodel::createPNG - unable to create PNG from DOT file. Check Graphviz\bin is your PATH.");
return false;
}
if (show && !showImage(fileName + ".png")) {
ERROR_MESSAGE("FSMmodel::createPNG - unable to show PNG");
return false;
}
return true;
}
示例9: yacc_at
void
yacc_at (location loc, const char *message, ...)
{
if (yacc_flag)
{
ERROR_MESSAGE (&loc, NULL, message);
complaint_issued = true;
}
else if (warnings_flag & warnings_yacc)
{
set_warning_issued ();
ERROR_MESSAGE (&loc, _("warning"), message);
}
}
示例10: COPYerror
/** <!--******************************************************************-->
*
* @fn COPYerror
*
* @brief Copies the node and its sons/attributes
*
* @param arg_node Error node to process
* @param arg_info pointer to info structure
*
* @return processed node
*
***************************************************************************/
node *
COPYerror (node * arg_node, info * arg_info)
{
node *result = TBmakeError (NULL, PH_initial, NULL);
DBUG_ENTER ("COPYerror");
LUTinsertIntoLutP (INFO_LUT (arg_info), arg_node, result);
/* Copy attributes */
ERROR_MESSAGE (result) = STRcpy (ERROR_MESSAGE (arg_node));
ERROR_ANYPHASE (result) = ERROR_ANYPHASE (arg_node);
/* Copy sons */
ERROR_NEXT (result) = COPYTRAV (ERROR_NEXT (arg_node), arg_info);
/* Return value */
DBUG_RETURN (result);
}
示例11: LoadFile
void Shader::Init()
{
std::string tmp_vertexShaderSourceCode = "";
std::string tmp_geometryShaderSourceCode = "";
std::string tmp_fragmentShaderSourceCode = "";
try
{
tmp_vertexShaderSourceCode = LoadFile( m_vertexShaderFile );
}
catch(std::string &e){ ERROR_MESSAGE(e);}
try
{
tmp_geometryShaderSourceCode = LoadFile( m_geometryShaderFile );
}
catch(std::string &e){ ERROR_MESSAGE(e);}
try
{
tmp_fragmentShaderSourceCode = LoadFile( m_fragmentShaderFile );
}
catch(std::string &e){ ERROR_MESSAGE(e);}
// TODO: geometry shader
GLuint tmp_vertexShaderObject = glCreateShader(GL_VERTEX_SHADER);
GLuint tmp_fragmentShaderObject = glCreateShader(GL_FRAGMENT_SHADER);
// attach shader source code to shader
// https://stackoverflow.com/questions/6047527/how-to-convert-stdstring-to-const-char
const char *c_str = tmp_vertexShaderSourceCode.c_str();
glShaderSource(tmp_vertexShaderObject,1,&c_str,NULL);
c_str = tmp_fragmentShaderSourceCode.c_str();
glShaderSource(tmp_fragmentShaderObject,1,&c_str,NULL);
glCompileShader(tmp_vertexShaderObject);
glCompileShader(tmp_fragmentShaderObject);
// now check for errors:
CheckShader(tmp_vertexShaderObject);
CheckShader(tmp_fragmentShaderObject);
m_program = glCreateProgram();
glAttachShader(m_program,tmp_vertexShaderObject);
glAttachShader(m_program,tmp_fragmentShaderObject);
glLinkProgram(m_program);
}
示例12: ERROR_MESSAGE
/*-------------------------------------------------------------------------------
* 関數説明
* ベクトルを正規化する
* 引數
* p_Vector :[I/ ] ベクトル
* 戻り値
* 正常終了 :正規化されたベクトル
* 異常終了 :全要素[0.0]
*-------------------------------------------------------------------------------*/
vec3 Math::Normalize(const vec3 &p_Vector)
{
vec3 normalize = { 0.0f }; //正規化されたベクトル
//計算しやすいように代入(誤差を少なくするために[double]で計算)
double x = (double)(p_Vector.x);
double y = (double)(p_Vector.y);
double z = (double)(p_Vector.z);
//引數チェック
if (0.0 == x && 0.0 == y && 0.0 == z)
{
ERROR_MESSAGE("ベクトルを正規化 引數エラー ベクトルが[0]です。\n");
return normalize;
}
//ベクトルの長さを求める
double length = sqrt(x * x + y * y + z * z);
//正規化する
length = 1.0 / length;
x *= length;
y *= length;
z *= length;
//戻り値を設定
normalize.x = (float)x;
normalize.y = (float)y;
normalize.z = (float)z;
return normalize;
}
示例13: PRTerror
node *
PRTerror (node * arg_node, info * arg_info)
{
bool first_error;
DBUG_ENTER ("PRTerror");
if (NODE_ERROR (arg_node) != NULL) {
NODE_ERROR (arg_node) = TRAVdo (NODE_ERROR (arg_node), arg_info);
}
first_error = INFO_FIRSTERROR( arg_info);
if( (global.outfile != NULL)
&& (ERROR_ANYPHASE( arg_node) == global.compiler_anyphase)) {
if ( first_error) {
printf ( "\n/******* BEGIN TREE CORRUPTION ********\n");
INFO_FIRSTERROR( arg_info) = FALSE;
}
printf ( "%s\n", ERROR_MESSAGE( arg_node));
if (ERROR_NEXT (arg_node) != NULL) {
TRAVopt (ERROR_NEXT (arg_node), arg_info);
}
if ( first_error) {
printf ( "******** END TREE CORRUPTION *******/\n");
INFO_FIRSTERROR( arg_info) = TRUE;
}
}
DBUG_RETURN (arg_node);
}
示例14: TracebackLocalAlignment
int TracebackLocalAlignment(const Matrix& matrix,
const DP_BlockInfo *blocks, unsigned int queryFrom, unsigned int queryTo,
DP_AlignmentResult **alignment)
{
if (!alignment) {
ERROR_MESSAGE("TracebackLocalAlignment() - NULL alignment handle");
return STRUCT_DP_PARAMETER_ERROR;
}
*alignment = NULL;
// find max score (e.g., best-scoring position of any block)
int score = DP_NEGATIVE_INFINITY;
unsigned int block, residue, lastBlock = 0, lastBlockPos = 0;
for (block=0; block<blocks->nBlocks; ++block) {
for (residue=queryFrom; residue<=queryTo; ++residue) {
if (matrix[block][residue - queryFrom].score > score) {
score = matrix[block][residue - queryFrom].score;
lastBlock = block;
lastBlockPos = residue;
}
}
}
if (score <= 0) {
// INFO_MESSAGE("No positive-scoring local alignment found.");
return STRUCT_DP_NO_ALIGNMENT;
}
// INFO_MESSAGE("Score of best local alignment: " << score);
*alignment = new DP_AlignmentResult;
return TracebackAlignment(matrix, lastBlock, lastBlockPos, queryFrom, *alignment);
}
示例15: CreateBlastMatrix
BLAST_Matrix * CreateBlastMatrix(const BlockMultipleAlignment *bma)
{
#ifdef DEBUG_PSSM
{{
CNcbiOfstream ofs("psimsa.txt", IOS_BASE::out);
}}
#endif
BLAST_Matrix *matrix = NULL;
try {
SU_PSSMInput input(bma);
CPssmEngine engine(&input);
CRef < CPssmWithParameters > pssm = engine.Run();
#ifdef DEBUG_PSSM
CNcbiOfstream ofs("psimsa.txt", IOS_BASE::out | IOS_BASE::app);
if (ofs) {
CObjectOStreamAsn oosa(ofs, false);
oosa << *pssm;
}
#endif
matrix = ConvertPSSMToBLASTMatrix(*pssm);
} catch (exception& e) {
ERROR_MESSAGE("CreateBlastMatrix() failed with exception: " << e.what());
}
return matrix;
}