• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ASSERT_ARGS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: utf16_decode

PARROT_WARN_UNUSED_RESULT
static UINTVAL
utf16_decode(SHIM_INTERP, ARGIN(const utf16_t *p))
{
    ASSERT_ARGS(utf16_decode)
    UINTVAL c = *p;

    if (UNICODE_IS_HIGH_SURROGATE(c))
        c = UNICODE_DECODE_SURROGATE(c, p[1]);

    return c;
}
开发者ID:FROGGS,项目名称:parrot,代码行数:12,代码来源:utf16.c


示例2: mark_interp

static void
mark_interp(PARROT_INTERP)
{
    ASSERT_ARGS(mark_interp)
    PObj *obj;
    /* mark the list of iglobals */
    Parrot_gc_mark_PMC_alive(interp, interp->iglobals);

    /* mark the current continuation */
    obj = (PObj *)interp->current_cont;
    if (obj && obj != (PObj *)NEED_CONTINUATION)
        Parrot_gc_mark_PMC_alive(interp, (PMC *)obj);

    /* mark the current context. */
    Parrot_gc_mark_PMC_alive(interp, CURRENT_CONTEXT(interp));

    /* mark the vtables: the data, Class PMCs, etc. */
    Parrot_vtbl_mark_vtables(interp);

    /* mark the root_namespace */
    Parrot_gc_mark_PMC_alive(interp, interp->root_namespace);

    /* mark the concurrency scheduler */
    Parrot_gc_mark_PMC_alive(interp, interp->scheduler);

    /* mark caches and freelists */
    mark_object_cache(interp);

    /* Now mark the class hash */
    Parrot_gc_mark_PMC_alive(interp, interp->class_hash);

    /* Now mark the HLL stuff */
    Parrot_gc_mark_PMC_alive(interp, interp->HLL_info);
    Parrot_gc_mark_PMC_alive(interp, interp->HLL_namespace);

    /* Mark the registry */
    PARROT_ASSERT(interp->gc_registry);
    Parrot_gc_mark_PMC_alive(interp, interp->gc_registry);

    /* Mark the MMD cache. */
    if (interp->op_mmd_cache)
        Parrot_mmd_cache_mark(interp, interp->op_mmd_cache);

    /* Walk the iodata */
    Parrot_IOData_mark(interp, interp->piodata);

    if (!PMC_IS_NULL(interp->final_exception))
        Parrot_gc_mark_PMC_alive(interp, interp->final_exception);

    if (interp->parent_interpreter)
        mark_interp(interp->parent_interpreter);
}
开发者ID:Quakexxx,项目名称:parrot,代码行数:52,代码来源:mark_sweep.c


示例3: imcc_get_pir_compreg_api

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
Parrot_Int
imcc_get_pir_compreg_api(Parrot_PMC interp_pmc, int add_compreg, ARGOUT(Parrot_PMC *compiler))
{
    ASSERT_ARGS(imcc_get_pir_compreg_api)
    IMCC_API_CALLIN(interp_pmc, interp)
    *compiler = get_compreg_pmc(interp, 0, add_compreg);
    if (PMC_IS_NULL(*compiler))
        Parrot_ex_throw_from_c_noargs(interp, EXCEPTION_UNEXPECTED_NULL,
            "Could not create PIR compiler PMC");
    IMCC_API_CALLOUT(interp_pmc, interp)
}
开发者ID:biddyweb,项目名称:parrot,代码行数:13,代码来源:api.c


示例4: Parrot_io_poll_handle

PARROT_EXPORT
INTVAL
Parrot_io_poll_handle(PARROT_INTERP, ARGMOD(PMC *pmc), INTVAL which, INTVAL sec, INTVAL usec)
{
    ASSERT_ARGS(Parrot_io_poll_handle)
    Parrot_Socket_attributes *io = PARROT_SOCKET(pmc);

    if (Parrot_io_socket_is_closed(interp, pmc))
        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
                "Can't poll closed socket");

    return Parrot_io_poll(interp, io->os_handle, which, sec, usec);
}
开发者ID:KrisShannon,项目名称:parrot,代码行数:13,代码来源:socket_api.c


示例5: IMCC_fatal_standalone

PARROT_DOES_NOT_RETURN
void
IMCC_fatal_standalone(ARGMOD(imc_info_t * imcc), int code, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_fatal_standalone)
    va_list ap;
    STRING * s = STRINGNULL;

    va_start(ap, fmt);
    s = Parrot_vsprintf_c(imcc->interp, fmt, ap);
    va_end(ap);
    Parrot_ex_throw_from_c_args(imcc->interp, NULL, code, "%Ss", s);
}
开发者ID:HashNuke,项目名称:parrot,代码行数:13,代码来源:debug.c


示例6: IMCC_fatal_standalone

PARROT_EXPORT
PARROT_DOES_NOT_RETURN
void
IMCC_fatal_standalone(PARROT_INTERP, int code, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_fatal_standalone)
    va_list ap;

    va_start(ap, fmt);
    imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
    va_end(ap);
    Parrot_exit(interp, code);
}
开发者ID:khairulsyamil,项目名称:parrot,代码行数:13,代码来源:debug.c


示例7: getchr_va

PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static STRING *
getchr_va(PARROT_INTERP, SHIM(INTVAL size), ARGIN(SPRINTF_OBJ *obj))
{
    ASSERT_ARGS(getchr_va)
    va_list *arg = (va_list *)(obj->data);

    /* char promoted to int */
    char ch = (char)va_arg(*arg, int);

    return Parrot_str_new_init(interp, &ch, 1, Parrot_latin1_encoding_ptr, 0);
}
开发者ID:Cristofor,项目名称:parrot,代码行数:13,代码来源:spf_vtable.c


示例8: IMCC_debug

PARROT_EXPORT
void
IMCC_debug(PARROT_INTERP, int level, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_debug)
    va_list ap;

    if (!(level & IMCC_INFO(interp)->debug))
        return;
    va_start(ap, fmt);
    imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
    va_end(ap);
}
开发者ID:khairulsyamil,项目名称:parrot,代码行数:13,代码来源:debug.c


示例9: IMCC_fataly

PARROT_EXPORT
PARROT_DOES_NOT_RETURN
void
IMCC_fataly(PARROT_INTERP, SHIM(int code), ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_fataly)
    va_list ap;

    va_start(ap, fmt);
    IMCC_INFO(interp)->error_message = Parrot_vsprintf_c(interp, fmt, ap);
    va_end(ap);
    IMCC_THROW(IMCC_INFO(interp)->jump_buf, IMCC_FATALY_EXCEPTION);
}
开发者ID:khairulsyamil,项目名称:parrot,代码行数:13,代码来源:debug.c


示例10: IMCC_warning

PARROT_EXPORT
void
IMCC_warning(PARROT_INTERP, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_warning)
    va_list ap;
    if (IMCC_INFO(interp)->imcc_warn)
        return;

    va_start(ap, fmt);
    imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
    va_end(ap);
}
开发者ID:khairulsyamil,项目名称:parrot,代码行数:13,代码来源:debug.c


示例11: Parrot_api_string_export_ascii

PARROT_API
Parrot_Int
Parrot_api_string_export_ascii(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String string),
        ARGOUT(char ** strout))
{
    ASSERT_ARGS(Parrot_api_string_export_ascii)
    EMBED_API_CALLIN(interp_pmc, interp);
    if (!STRING_IS_NULL(string))
        *strout = Parrot_str_to_cstring(interp, string);
    else
        *strout = NULL;
    EMBED_API_CALLOUT(interp_pmc, interp);
}
开发者ID:Kristaba,项目名称:parrot,代码行数:13,代码来源:strings.c


示例12: PackFile_ConstTable_pack_size

PARROT_EXPORT
size_t
PackFile_ConstTable_pack_size(PARROT_INTERP, ARGIN(PackFile_Segment *seg))
{
    ASSERT_ARGS(PackFile_ConstTable_pack_size)
    opcode_t i;
    const PackFile_ConstTable* const self = (const PackFile_ConstTable *) seg;
    size_t size = 1;    /* const_count */

    for (i = 0; i < self->const_count; ++i)
        size += PackFile_Constant_pack_size(interp, self->constants[i], self);
    return size;
}
开发者ID:khairulsyamil,项目名称:parrot,代码行数:13,代码来源:packout.c


示例13: IMCC_info

void
IMCC_info(ARGMOD(imc_info_t * imcc), int level, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_info)
    va_list ap;

    if (level > imcc->verbose)
        return;

    va_start(ap, fmt);
    imcc_vfprintf(imcc, Parrot_io_STDERR(imcc->interp), fmt, ap);
    va_end(ap);
}
开发者ID:HashNuke,项目名称:parrot,代码行数:13,代码来源:debug.c


示例14: pf_const_dump_str

static void
pf_const_dump_str(PARROT_INTERP, ARGIN(const STRING *self))
{
    ASSERT_ARGS(pf_const_dump_str)

    Parrot_io_printf(interp, "    [ 'PFC_STRING', {\n");
    pobj_flag_dump(interp, (long)PObj_get_FLAGS(self));
    Parrot_io_printf(interp, "        ENCODING => %s,\n", self->encoding->name);
    Parrot_io_printf(interp, "        SIZE     => %ld,\n", self->bufused);
    Parrot_io_printf(interp, "        DATA     => \"%Ss\"\n",
            Parrot_str_escape(interp, self));
    Parrot_io_printf(interp, "    } ],\n");
}
开发者ID:biddyweb,项目名称:parrot,代码行数:13,代码来源:packdump.c


示例15: verify_CD

static void
verify_CD(ARGIN(char *external_data), ARGMOD_NULLOK(PMC *user_data))
{
    ASSERT_ARGS(verify_CD)
    PARROT_INTERP = NULL;
    PMC    *interp_pmc;
    STRING *sc;

    /*
     * 1.) user_data is from external code so:
     *     verify that we get a PMC that is one that we have passed in
     *     as user data, when we prepared the callback
     */

    /* a NULL pointer or a pointer not aligned is very likely wrong */
    if (!user_data)
        PANIC(interp, "user_data is NULL");
    if (PMC_IS_NULL(user_data))
        PANIC(interp, "user_data is PMCNULL");
    if ((UINTVAL)user_data & 3)
        PANIC(interp, "user_data doesn't look like a pointer");

    /* Fetch original interpreter from prop */
    LOCK(interpreter_array_mutex);

    interp      = interpreter_array[0];
    sc          = CONST_STRING(interp, "_interpreter");
    interp_pmc  = VTABLE_getprop(interp, user_data, sc);
    GETATTR_ParrotInterpreter_interp(interp, interp_pmc, interp);

    UNLOCK(interpreter_array_mutex);
    if (!interp)
        PANIC(interp, "interpreter not found for callback");

    /*
     * 2) some more checks
     * now we should have the interpreter where that callback
     * did originate - do some further checks on the PMC
     */

    /* if that doesn't look like a PMC we are still lost */
    if (!PObj_is_PMC_TEST(user_data))
        PANIC(interp, "user_data isn't a PMC");

    if (!user_data->vtable)
        PANIC(interp, "user_data hasn't a vtable");
    /*
     * ok fine till here
     */
    callback_CD(interp, external_data, user_data);
}
开发者ID:Cristofor,项目名称:parrot,代码行数:51,代码来源:inter_cb.c


示例16: encoding_to_encoding

PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
STRING *
encoding_to_encoding(PARROT_INTERP, ARGIN(const STRING *src),
        ARGIN(const STR_VTABLE *encoding), double avg_bytes)
{
    ASSERT_ARGS(encoding_to_encoding)
    STRING           *result;
    String_iter       src_iter, dest_iter;
    UINTVAL           src_len, alloc_bytes;
    UINTVAL           max_bytes = encoding->max_bytes_per_codepoint;

    if (src->encoding == encoding)
        return Parrot_str_clone(interp, src);

    src_len          = src->strlen;
    result           = Parrot_gc_new_string_header(interp, 0);
    result->encoding = encoding;
    result->strlen   = src_len;

    if (!src_len)
        return result;

    alloc_bytes = (UINTVAL)(src_len * avg_bytes);
    if (alloc_bytes < max_bytes)
        alloc_bytes = max_bytes;
    Parrot_gc_allocate_string_storage(interp, result, alloc_bytes);
    result->bufused = alloc_bytes;

    STRING_ITER_INIT(interp, &src_iter);
    STRING_ITER_INIT(interp, &dest_iter);

    while (src_iter.charpos < src_len) {
        const UINTVAL c      = STRING_iter_get_and_advance(interp, src, &src_iter);
        const UINTVAL needed = dest_iter.bytepos + max_bytes;

        if (needed > result->bufused) {
            alloc_bytes  = src_len - src_iter.charpos;
            alloc_bytes  = (UINTVAL)(alloc_bytes * avg_bytes);
            alloc_bytes += needed;
            Parrot_gc_reallocate_string_storage(interp, result, alloc_bytes);
            result->bufused = alloc_bytes;
        }

        STRING_iter_set_and_advance(interp, result, &dest_iter, c);
    }

    result->bufused = dest_iter.bytepos;

    return result;
}
开发者ID:tidatida,项目名称:parrot,代码行数:51,代码来源:shared.c


示例17: Parrot_io_send_handle

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL
Parrot_io_send_handle(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD(STRING *buf))
{
    ASSERT_ARGS(Parrot_io_send_handle)
    Parrot_Socket_attributes *io = PARROT_SOCKET(pmc);

    if (Parrot_io_socket_is_closed(interp, pmc))
        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
                "Can't send to closed socket");

    return Parrot_io_send(interp, io->os_handle, buf->strstart, buf->bufused);
}
开发者ID:KrisShannon,项目名称:parrot,代码行数:14,代码来源:socket_api.c


示例18: open_file

PARROT_CAN_RETURN_NULL
FILE *
open_file(ARGIN(char const * const filename), ARGIN(char const * const mode))
{
    ASSERT_ARGS(open_file)
    FILE *fp = NULL;

#ifdef _MSC_VER
    fopen_s(&fp, filename, mode);
#else
    fp = fopen(filename, mode);
#endif
    return fp;
}
开发者ID:mpeters,项目名称:parrot,代码行数:14,代码来源:pircapi.c


示例19: utf16_skip_forward

PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static const utf16_t *
utf16_skip_forward(ARGIN(const utf16_t *p), UINTVAL count)
{
    ASSERT_ARGS(utf16_skip_forward)
    UINTVAL i;

    for (i = 0; i < count; ++i) {
        p += UTF16SKIP(*p);
    }

    return p;
}
开发者ID:FROGGS,项目名称:parrot,代码行数:14,代码来源:utf16.c


示例20: encoding_find_cclass

PARROT_WARN_UNUSED_RESULT
INTVAL
encoding_find_cclass(PARROT_INTERP, INTVAL flags, ARGIN(const STRING *src),
        UINTVAL offset, UINTVAL count)
{
    ASSERT_ARGS(encoding_find_cclass)
    String_iter iter;
    UINTVAL     codepoint;
    UINTVAL     end = offset + count;

    static UINTVAL last_char_offset;
    static String_iter cached_iter;
    static STRING *last_string = 0;

    if (last_string == src && offset > last_char_offset) {
        iter = cached_iter;
        STRING_iter_skip(interp, src, &iter, offset - last_char_offset);
    }
    else if (last_string == src && offset == last_char_offset) {
        iter = cached_iter;
    }
    else {
        STRING_ITER_INIT(interp, &iter);
        STRING_iter_skip(interp, src, &iter, offset);
    }

    end = src->strlen < end ? src->strlen : end;

    while (iter.charpos < end) {
        codepoint = STRING_iter_get_and_advance(interp, src, &iter);
        if (codepoint >= 256) {
            if (u_iscclass(interp, codepoint, flags))
                goto return_and_cache;
        }
        else {
            if (Parrot_iso_8859_1_typetable[codepoint] & flags)
                goto return_and_cache;
        }
    }

    return end;
return_and_cache:
    if (iter.charpos > 128) {
        last_char_offset = iter.charpos;
        cached_iter = iter;
        last_string = (STRING*)PTR2INTVAL(src);
    }
    return iter.charpos - 1;
}
开发者ID:tidatida,项目名称:parrot,代码行数:49,代码来源:shared.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ASSERT_BREAK函数代码示例发布时间:2022-05-30
下一篇:
C++ ASSERT_ARG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap