本文整理匯總了C++中ErrMsg函數的典型用法代碼示例。如果您正苦於以下問題:C++ ErrMsg函數的具體用法?C++ ErrMsg怎麽用?C++ ErrMsg使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ErrMsg函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: switch
const char *name_identifier(int i) {
static const char *cp_val = "data()", *cp_area = "area";
switch (i) {
case ID_OF_VALDATA:
return cp_val;
case ID_OF_AREA:
return cp_area;
default:
if (i >= get_n_vars() || i < 0) {
pr_warning("i = %d", i);
ErrMsg(ER_RANGE, "name_identifier(i): i outside range");
}
return ids[i];
}
}
示例2: delete_tmp_files
static rc_t delete_tmp_files( const sorter_params * params, uint32_t count )
{
rc_t rc = 0;
char buffer[ 4096 ];
uint32_t i;
for ( i = 0; rc == 0 && i < count; ++ i )
{
make_pool_src_filename( params, i + 1, buffer, sizeof buffer );
if ( rc == 0 )
rc = KDirectoryRemove( params->dir, true, "%s", buffer );
if ( rc != 0 )
ErrMsg( "KDirectoryRemove( 'tmp_%d.dat' ) -> %R", rc );
}
return rc;
}
示例3: make_output_filename_from_dir_and_accession
/* we have an output-dir and NO output-file */
static rc_t make_output_filename_from_dir_and_accession( tool_ctx_t * tool_ctx )
{
size_t num_writ;
bool es = ends_in_slash( tool_ctx -> output_dirname ); /* helper.c */
rc_t rc = string_printf( tool_ctx -> dflt_output, sizeof tool_ctx -> dflt_output,
&num_writ,
es ? "%s%s.fastq" : "%s/%s.fastq",
tool_ctx -> output_dirname,
tool_ctx -> accession_short );
if ( rc != 0 )
ErrMsg( "string_printf( output-filename ) -> %R", rc );
else
tool_ctx -> output_filename = tool_ctx -> dflt_output;
return rc;
}
示例4: pr_warning
void *ecalloc(size_t nobj, size_t size) {
void *p = NULL;
if (size == 0) {
pr_warning("ecalloc(): size 0 requested");
return NULL;
}
p = (void *) calloc(nobj, size);
if (p == NULL) {
if (DEBUG_DUMP)
message("calloc(%u,%u) returned NULL", nobj, size);
ErrMsg(ER_MEMORY, "");
}
return p;
}
示例5: make_output_filename_from_accession
/* we have NO output-dir and NO output-file */
static rc_t make_output_filename_from_accession( tool_ctx_t * tool_ctx )
{
/* we DO NOT have a output-directory : build output-filename from the accession */
/* generate the full path of the output-file, if not given */
size_t num_writ;
rc_t rc = string_printf( &tool_ctx -> dflt_output[ 0 ], sizeof tool_ctx -> dflt_output,
&num_writ,
"%s.fastq",
tool_ctx -> accession_short );
if ( rc != 0 )
ErrMsg( "string_printf( output-filename ) -> %R", rc );
else
tool_ctx -> output_filename = tool_ctx -> dflt_output;
return rc;
}
示例6: fill_cutoff_width
/*
* this function should be changed--the mask map stack is misused as
* to define the topology of variogram maps.
*
* use min/max coordinates for block diagonal as maximum cutoff
* Returns: about 1/3 the max. dist between any two points in data.
*/
void fill_cutoff_width(DATA *data /* pointer to DATA structure to derive
the values from */,
VARIOGRAM *v /* pointer to VARIOGRAM structure */)
{
double d = 0.0;
int i;
GRIDMAP *m;
SAMPLE_VGM *ev;
assert(data);
assert(v);
ev = v->ev;
if (get_n_masks() > 0) {
m = new_map();
m->is_write = 0;
m->filename = get_mask_name(0);
if ((m = map_read(m)) == NULL)
ErrMsg(ER_READ, "cannot open map");
ev->iwidth = 1.0;
ev->cutoff = m->rows * m->cols;
/* not a real cutoff, but rather the size of the container array */
ev->map = m;
} else if (gl_bounds != NULL) {
i = 0;
while (gl_bounds[i] >= 0.0) /* count length */
i++;
ev->cutoff = gl_bounds[i-1];
ev->iwidth = ev->cutoff / i;
} else {
if (is_mv_double(&(ev->cutoff))) {
if (gl_cutoff < 0.0) {
d = data_block_diagonal(data);
if (d == 0.0)
ev->cutoff = 1.0; /* ha ha ha */
else
ev->cutoff = d * gl_fraction;
} else
ev->cutoff = gl_cutoff;
}
if (is_mv_double(&(ev->iwidth))) {
if (gl_iwidth < 0.0)
ev->iwidth = ev->cutoff / gl_n_intervals;
else
ev->iwidth = gl_iwidth;
}
}
}
示例7: make_reply_obj_list
static rc_t make_reply_obj_list( struct reply_obj_list ** list )
{
rc_t rc = 0;
reply_obj_list * l = calloc( 1, sizeof * l );
if ( l == NULL )
{
rc = RC( rcVDB, rcNoTarg, rcConstructing, rcMemory, rcExhausted );
ErrMsg( "calloc( %d ) -> %R", ( sizeof * l ), rc );
}
else
{
VectorInit( &l->v, 0, 5 );
*list = l;
}
return rc;
}
示例8: ExeRtP
DEFAULT ExeRtP() /* execute right parenthesis command */
{
DBGFEN(1,"ExeRtP",NULL);
/*
* if no numeric arg. or not a number
*/
if ((EStTop == EStBot) || (EStack[EStTop].ElType != OPERAND)) {
ErrMsg(ERR_NAP); /* no argument before ) */
DBGFEX(1,DbgFNm,"FAILURE");
return FAILURE;
}
DBGFEX(1,DbgFNm,"PushEx(')')");
return PushEx((LONG)')', OPERATOR);
}
示例9: do_synthesis
void do_synthesis()
{
int nframe;
int shift_start, shift_end;
shift_start = mhead->totalduration -
((int )(SILENCE_LENGTH / FRAME_RATE));
shift_end = mtail->totalduration -
((int )(SILENCE_LENGTH / FRAME_RATE));
totalframe -= shift_end;
wave.rate = SAMPLE_RATE;
wave.nsample = SAMPLE_RATE * FRAME_RATE * (totalframe - shift_start) / 1000;
if ((wave.data = (short *) calloc (wave.nsample, sizeof (short))) == NULL)
{
ErrMsg("Memory allocation error !\n");
restart(1);
}
#ifdef AUTO_DA
nsample_frame = SAMPLE_RATE * FRAME_RATE / 1000;
synthesized_nsample = SAMPLE_RATE * FRAME_RATE * shift_start / 1000;
#endif
already_talked = 0;
for(nframe = shift_start; nframe < totalframe; nframe++)
{
/* for power modification */
coeff[nframe][0] = power.data[nframe];
/* MLSA filter */
vocoder(f0.data[nframe],coeff[nframe],mceppst.order,alpha.data[nframe],speaker[spid].postfilter_coef);
#ifdef AUTO_DA
synthesized_nsample += nsample_frame;
if( nframe == shift_start && slot_Auto_play == YES ) {
strcpy( slot_Speak_stat, "SPEAKING" );
if( prop_Speak_stat == AutoOutput ) inqSpeakStat();
do_auto_output();
}
#endif
}
synthesized_nsample = wave.nsample;
totalframe -= shift_start;
}
示例10: PrintUsage
void PrintUsage()
{
ErrMsg("\n");
ErrMsg("CountName [Input] [Column]\n\n");
ErrMsg("[Input] STRING\n");
ErrMsg("[Column] INTEGER The column to count.\n\n");
ErrMsg("Example: Count the number of occurrences of each 'Subject id' in the blast result.\n");
ErrMsg("CountName result.blast 2 > result.conut\n\n");
}
示例11: PrintUsage
void PrintUsage()
{
ErrMsg("\n");
ErrMsg("RmAmbiMapping [SAM] [Cut]\n\n");
ErrMsg("[SAM] FILE A SAM file.\n\n");
ErrMsg("[Cut] INT Chimera AS - co-linear AS > cut.\n\n");
ErrMsg("Example:\n");
ErrMsg("cat C3.sam | ./RmAmbiMapping C3.ref.sam > result.sam\n\n");
}
示例12: ExeCom
/*****************************************************************************
ExeCom()
This function executes a , (comma argument separator) command.
*****************************************************************************/
#include "zport.h" /* define portability identifiers */
#include "tecoc.h" /* define general identifiers */
#include "defext.h" /* define external global variables */
#include "deferr.h" /* define identifiers for error messages */
DEFAULT ExeCom() /* execute a , (comma) command */
{
DBGFEN(1,"ExeCom",NULL);
if (EStTop == EStBot) { /* if no numeric argument */
ErrMsg(ERR_NAC); /* no arg before , */
DBGFEX(1,DbgFNm,"FAILURE");
return FAILURE;
}
if (GetNmA() == FAILURE) {
DBGFEX(1,DbgFNm,"FAILURE");
return FAILURE;
}
MArgmt = NArgmt;
CmdMod |= MARGIS;
DBGFEX(1,DbgFNm,"SUCCESS");
return SUCCESS;
}
示例13: do_output_pros
void do_output_pros(char *ffile)
{
FILE *fp;
int dur;
PHONEME *phoneme;
MORPH *morph;
int i;
int shift_start;
shift_start = mhead->totalduration -
((int )(SILENCE_LENGTH / FRAME_RATE));
fp = fopen( ffile, "w" );
if( fp == NULL ) {
ErrMsg( "* File Open Error ... %s\n", ffile );
return;
}
if( input_text[0] ) {
fprintf( fp, "input_text: %s\n", input_text );
fprintf( fp, "spoken_text: %s\n", spoken_text );
} else {
/* ParsedText での入力のとき */
for( morph=mphead; morph; morph=morph->next ) {
if( strncmp(morph->kanji,"sil",3)==0 ) continue;
fprintf( fp, "%s", morph->kanji );
}
fprintf( fp, "\n" );
}
fprintf( fp, "number_of_phonemes: %d\n", slot_n_phonemes );
fprintf( fp, "total_duration: %d\n", slot_total_dur );
fprintf( fp, "-----\n" );
phoneme = phhead;
while( phoneme ) {
dur = (int)(phoneme->time);
fprintf( fp, "%s [%d]\n", phoneme->phoneme, dur );
phoneme = phoneme->next;
}
fprintf( fp, "-----\n" );
fprintf( fp, "total_frame: %d\n", totalframe );
fprintf( fp, "-----\n" );
for( i=0; i<totalframe; ++i ) {
fprintf( fp, "%d: %lf %lf\n", i, f0.data[i+shift_start], power.data[i+shift_start] );
}
fprintf( fp, "-----\n" );
fclose( fp );
}
示例14: setup_data_minmax
void setup_data_minmax(DATA *d) {
if (fix_minmax)
ErrMsg(ER_NULL, "min and max should be fixed");
if (d->id == 0) {
min.x = d->minX; min.y = d->minY; min.z = d->minZ;
max.x = d->maxX; max.y = d->maxY; max.z = d->maxZ;
} else {
min.x = MIN(min.x, d->minX);
min.y = MIN(min.y, d->minY);
min.z = MIN(min.z, d->minZ);
max.x = MAX(max.x, d->maxX);
max.y = MAX(max.y, d->maxY);
max.z = MAX(max.z, d->maxZ);
}
}
示例15: setErr
void setErr( char *rel, char *filename )
{
if( strcmp(rel,"=")==0 ) {
if( fp_err && strcmp(slot_Err_file,"CONSOLE")!=0 ) fclose( fp_err );
strcpy( slot_Err_file, filename );
if( strcmp(filename,"CONSOLE")==0 ) {
fp_err = stderr;
} else {
fp_err = fopen( filename, "a" );
if( fp_err == NULL ) {
ErrMsg( "error log file open error ... '%s'\n", filename );
}
}
} else {
unknown_com();
}
}