当前位置: 首页>>代码示例>>C++>>正文


C++ E_ERROR函数代码示例

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


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

示例1: main

int
main(int argc, char *argv[])
{
    lexicon_t *lex;
    model_def_t *mdef;

    if (initialize(&lex, &mdef,
		   argc, argv) != S3_SUCCESS) {
	E_ERROR("errors initializing.\n");
	return 1;
    }
    
    if (init_gau(lex, mdef) != S3_SUCCESS) {
	return 1;
    }

    return 0;
}
开发者ID:10v,项目名称:cmusphinx,代码行数:18,代码来源:main.c

示例2: sbthread_wait

int
sbthread_wait(sbthread_t *th)
{
    void *exit;
    int rv;

    /* It has already been joined. */
    if (th->th == (pthread_t)-1)
        return -1;

    rv = pthread_join(th->th, &exit);
    if (rv != 0) {
        E_ERROR("Failed to join thread: %d\n", rv);
        return -1;
    }
    th->th = (pthread_t)-1;
    return (int)(long)exit;
}
开发者ID:Amponti,项目名称:SpeechRecognition_DE1-SOC,代码行数:18,代码来源:sbthread.c

示例3: sbthread_start

sbthread_t *
sbthread_start(cmd_ln_t *config, sbthread_main func, void *arg)
{
    sbthread_t *th;
    int rv;

    th = ckd_calloc(1, sizeof(*th));
    th->config = config;
    th->func = func;
    th->arg = arg;
    th->msgq = sbmsgq_init(1024);
    if ((rv = pthread_create(&th->th, NULL, &sbthread_internal_main, th)) != 0) {
        E_ERROR("Failed to create thread: %d\n", rv);
        sbthread_free(th);
        return NULL;
    }
    return th;
}
开发者ID:Amponti,项目名称:SpeechRecognition_DE1-SOC,代码行数:18,代码来源:sbthread.c

示例4: fsg_model_writefile_symtab

void
fsg_model_writefile_symtab(fsg_model_t *fsg, char const *file)
{
    FILE *fp;

    assert(fsg);

    E_INFO("Writing FSM symbol table '%s'\n", file);

    if ((fp = fopen(file, "w")) == NULL) {
        E_ERROR("Failed to open symbol table '%s' for writing: %s\n", file, strerror(errno));
        return;
    }

    fsg_model_write_symtab(fsg, fp);

    fclose(fp);
}
开发者ID:OmkarKirpan,项目名称:CMUSphinx,代码行数:18,代码来源:fsg_model.c

示例5: pj_calloc

PJ *PROJECTION(loxim) {
    struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
    if (0==Q)
        return freeup_new (P);
    P->opaque = Q;

    Q->phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
    Q->cosphi1 = cos(Q->phi1);
    if (Q->cosphi1 < EPS)
        E_ERROR(-22);

    Q->tanphi1 = tan(M_FORTPI + 0.5 * Q->phi1);

    P->inv = s_inverse;
    P->fwd = s_forward;
    P->es = 0.;

   return P;
}
开发者ID:Maasik,项目名称:proj.4,代码行数:19,代码来源:PJ_loxim.c

示例6: sbthread_wait

int
sbthread_wait(sbthread_t *th)
{
    DWORD rv, exit;

    /* It has already been joined. */
    if (th->th == NULL)
        return -1;

    rv = WaitForSingleObject(th->th, INFINITE);
    if (rv == WAIT_FAILED) {
        E_ERROR("Failed to join thread: WAIT_FAILED\n");
        return -1;
    }
    GetExitCodeThread(th->th, &exit);
    CloseHandle(th->th);
    th->th = NULL;
    return (int)exit;
}
开发者ID:AtDinesh,项目名称:Jaf_pose_est,代码行数:19,代码来源:sbthread.c

示例7: priority_queue_add

void priority_queue_add(priority_queue_t *queue, void *element)
{
    size_t i;
    if (queue->size == queue->alloc_size) {
        E_ERROR("Trying to add element into full queue\n");
        return;
    }
    for (i = 0; i < queue->alloc_size; i++) {
        if (queue->pointers[i] == NULL) {
            queue->pointers[i] = element;
            break;
        }
    }

    if (queue->max_element == NULL || queue->compare(element, queue->max_element) < 0) {
        queue->max_element = element;
    }
    queue->size++;
}
开发者ID:Amponti,项目名称:SpeechRecognition_DE1-SOC,代码行数:19,代码来源:priority_queue.c

示例8: dict_add_g2p_word

int
dict_add_g2p_word(dict_t * dict, char const *word)
{
    int32 wid = 0;
    s3cipid_t *pron;
    char **phonestr, *tmp;
    int np, i;
    char *phones;

    phones = dict_g2p(word, dict->ngram_g2p_model);
    if (phones == NULL)
        return 0;

    E_INFO("Adding phone %s for word %s \n",  phones, word);
    tmp = ckd_salloc(phones);
    np = str2words(tmp, NULL, 0);
    phonestr = ckd_calloc(np, sizeof(*phonestr));
    str2words(tmp, phonestr, np);
    pron = ckd_calloc(np, sizeof(*pron));
    for (i = 0; i < np; ++i) {
        pron[i] = bin_mdef_ciphone_id(dict->mdef, phonestr[i]);
        if (pron[i] == -1) {
            E_ERROR("Unknown phone %s in phone string %s\n",
                    phonestr[i], tmp);
            ckd_free(phonestr);
            ckd_free(tmp);
            ckd_free(pron);
            ckd_free(phones);
            return -1;
        }
    }
    ckd_free(phonestr);
    ckd_free(tmp);
    ckd_free(phones);
    if ((wid = dict_add_word(dict, word, pron, np)) == -1) {
        ckd_free(pron);
        return -1;
    }
    ckd_free(pron);

    return wid;
}
开发者ID:imace,项目名称:gecko-dev-speech,代码行数:42,代码来源:dict.c

示例9: sbevent_init

sbevent_t *
sbevent_init(void)
{
    sbevent_t *evt;
    int rv;

    evt = ckd_calloc(1, sizeof(*evt));
    if ((rv = pthread_mutex_init(&evt->mtx, NULL)) != 0) {
        E_ERROR("Failed to initialize mutex: %d\n", rv);
        ckd_free(evt);
        return NULL;
    }
    if ((rv = pthread_cond_init(&evt->cond, NULL)) != 0) {
        E_ERROR_SYSTEM("Failed to initialize mutex: %d\n", rv);
        pthread_mutex_destroy(&evt->mtx);
        ckd_free(evt);
        return NULL;
    }
    return evt;
}
开发者ID:AtDinesh,项目名称:Jaf_pose_est,代码行数:20,代码来源:sbthread.c

示例10: calc_feat_idx

static int
calc_feat_idx(acmod_t *acmod, int frame_idx)
{
    int n_backfr, feat_idx;

    n_backfr = acmod->n_feat_alloc - acmod->n_feat_frame;
    if (frame_idx < 0 || acmod->output_frame - frame_idx > n_backfr) {
        E_ERROR("Frame %d outside queue of %d frames, %d alloc (%d > %d), cannot score\n",
                frame_idx, acmod->n_feat_frame, acmod->n_feat_alloc,
                acmod->output_frame - frame_idx, n_backfr);
        return -1;
    }

    /* Get the index in feat_buf/framepos of the frame to be scored. */
    feat_idx = ((acmod->feat_outidx + frame_idx - acmod->output_frame)
                % acmod->n_feat_alloc);
    if (feat_idx < 0) feat_idx += acmod->n_feat_alloc;

    return feat_idx;
}
开发者ID:OmkarKirpan,项目名称:CMUSphinx,代码行数:20,代码来源:acmod.c

示例11: _blkarray_list_init

blkarray_list_t *
_blkarray_list_init(int32 maxblks, int32 blksize)
{
    blkarray_list_t *bl;

    if ((maxblks <= 0) || (blksize <= 0)) {
        E_ERROR("Cannot allocate %dx%d blkarray\n", maxblks, blksize);
        return NULL;
    }

    bl = (blkarray_list_t *) ckd_calloc(1, sizeof(blkarray_list_t));
    bl->ptr = (void ***) ckd_calloc(maxblks, sizeof(void **));
    bl->maxblks = maxblks;
    bl->blksize = blksize;
    bl->n_valid = 0;
    bl->cur_row = -1;           /* No row is allocated (dummy) */
    bl->cur_row_free = blksize; /* The dummy row is full */

    return bl;
}
开发者ID:brunhil,项目名称:SMILE,代码行数:20,代码来源:blkarray_list.c

示例12: ngram2wid

/**
 * Map the given ngram string to an array of word IDs of the individual
 * words in the ngram.
 *
 * args:
 * ngram - the ngram string to map
 * length - the length of the ngram string
 * w - the word ID array
 * lm - the language model to use
 *
 * returns:
 * the number of words in the ngram string, or 0 if the string contains an
 * unknown word
 */
int
ngram2wid(char *ngram, int length, s3lmwid32_t * w, lm_t * lm)
{
    char *word[1024];
    int nwd;
    int i;

    if ((nwd = str2words(ngram, word, length)) < 0)
        E_FATAL("Increase word[] and w[] arrays size\n");

    for (i = 0; i < nwd; i++) {
        w[i] = lm_wid(lm, word[i]);
        if (NOT_LMWID(lm, w[i])) {
            E_ERROR("Unknown word: %s\n", word[i]);
            return 0;
        }
    }

    return nwd;
}
开发者ID:channainfo,项目名称:sphinx3-verboice,代码行数:34,代码来源:lm_test.c

示例13: utt_decode_block

void
utt_decode_block(float ***block_feat,   /* Incoming block of featurevecs */
                 int32 no_frm,  /* No. of vecs in cepblock */
                 int32 * curfrm,        /* Utterance level index of
                                           frames decoded so far */
                 kb_t * kb      /* kb structure with all model
                                   and decoder info */
    )
{

    srch_t *s;
    s = (srch_t *) kb->srch;

    /* These are necessary! */
    s->uttid = kb->uttid;
    s->uttfile = kb->uttfile;
    if (srch_utt_decode_blk(s, block_feat, no_frm, curfrm) == SRCH_FAILURE) {
        E_ERROR("srch_utt_decode_blk failed. \n");
    }
}
开发者ID:Ankit77,项目名称:cmusphinx,代码行数:20,代码来源:utt.c

示例14: acmod_rewind

int
acmod_rewind(acmod_t *acmod)
{
    /* If the feature buffer is circular, this is not possible. */
    if (acmod->output_frame > acmod->n_feat_alloc) {
        E_ERROR("Circular feature buffer cannot be rewound (output frame %d, "
                "alloc %d)\n", acmod->output_frame, acmod->n_feat_alloc);
        return -1;
    }

    /* Frames consumed + frames available */
    acmod->n_feat_frame = acmod->output_frame + acmod->n_feat_frame;

    /* Reset output pointers. */
    acmod->feat_outidx = 0;
    acmod->output_frame = 0;
    acmod->senscr_frame = -1;
    acmod->mgau->frame_idx = 0;

    return 0;
}
开发者ID:JonGBowen,项目名称:GoodVibes,代码行数:21,代码来源:acmod.c

示例15: cep_write_bin

int32 cep_write_bin(char const *file, float32 *buf, int32 len)
{
  int32 fd;

#ifdef WIN32
 fd = open(file, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644);
#else
  fd = open(file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
#endif

  if (fd < 0) {
    E_ERROR("Couldn't open %s for writing\n", file);
    return errno;
  }
  len *= sizeof(float32);
  if (write(fd, (char *)&len, sizeof(int32)) != sizeof(int32)) return -1;
  if (write(fd, (char *)buf, len) != len) return -1;
  if (close(fd) != ESUCCESS) return -1;

  return ESUCCESS;
}  
开发者ID:4auka,项目名称:cmusphinx,代码行数:21,代码来源:cep_rw.c


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