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

C++ EINA_SAFETY_ON_NULL_RETURN_VAL函数代码示例

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

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



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

示例1: ewk_js_object_new

Ewk_JS_Object* ewk_js_object_new(const Ewk_JS_Class_Meta* jsMetaClass)
{
#if ENABLE(NETSCAPE_PLUGIN_API)
    Ewk_JS_Object* object;

    EINA_SAFETY_ON_NULL_RETURN_VAL(jsMetaClass, 0);

    object = static_cast<Ewk_JS_Object*>(malloc(sizeof(Ewk_JS_Object)));
    if (!object) {
        ERR("Could not allocate memory for ewk_js_object");
        return 0;
    }

    EINA_MAGIC_SET(object, EWK_JS_OBJECT_MAGIC);
    object->cls = ewk_js_class_new(jsMetaClass);
    object->view = 0;
    object->name = 0;
    object->type = EWK_JS_OBJECT_OBJECT;

    if (eina_hash_population(object->cls->properties) < 25)
        object->properties = eina_hash_string_small_new(reinterpret_cast<Eina_Free_Cb>(ewk_js_variant_free));
    else
        object->properties = eina_hash_string_superfast_new(reinterpret_cast<Eina_Free_Cb>(ewk_js_variant_free));

    for (int i = 0; object->cls->meta->properties && object->cls->meta->properties[i].name; i++) {
        Ewk_JS_Property prop = object->cls->meta->properties[i];
        const char* key = object->cls->meta->properties[i].name;
        Ewk_JS_Variant* value = static_cast<Ewk_JS_Variant*>(malloc(sizeof(Ewk_JS_Variant)));
        if (!value) {
            ERR("Could not allocate memory for ewk_js_variant");
            goto error;
        }
        if (prop.get)
            prop.get(object, key, value);
        else {
            value->type = prop.value.type;
            switch (value->type) {
            case EWK_JS_VARIANT_VOID:
            case EWK_JS_VARIANT_NULL:
                value->value.o = 0;
                break;
            case EWK_JS_VARIANT_STRING:
                value->value.s = eina_stringshare_add(prop.value.value.s);
                break;
            case EWK_JS_VARIANT_BOOL:
                value->value.b = prop.value.value.b;
                break;
            case EWK_JS_VARIANT_INT32:
                value->value.i = prop.value.value.i;
                break;
            case EWK_JS_VARIANT_DOUBLE:
                value->value.d = prop.value.value.d;
                break;
            case EWK_JS_VARIANT_OBJECT:
                value->value.o = prop.value.value.o;
                break;
            }
        }
        eina_hash_add(object->properties, key, value);
    }

    object->base.object.referenceCount = 1;
    object->base.object._class = &EWK_NPCLASS;
    return object;

error:
    ewk_js_object_free(object);
    return 0;
#else
    UNUSED_PARAM(jsMetaClass);
    return 0;
#endif
}
开发者ID:dog-god,项目名称:iptv,代码行数:73,代码来源:ewk_js.cpp


示例2: eolian_function_type_get

EAPI Eolian_Function_Type
eolian_function_type_get(const Eolian_Function *fid)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EOLIAN_UNRESOLVED);
   return fid->type;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_function_api.c


示例3: efreet_desktop_category_count_get

EAPI unsigned int
efreet_desktop_category_count_get(Efreet_Desktop *desktop)
{
    EINA_SAFETY_ON_NULL_RETURN_VAL(desktop, 0);
    return eina_list_count(desktop->categories);
}
开发者ID:jordemort,项目名称:efreet,代码行数:6,代码来源:efreet_desktop.c


示例4: eolian_function_implement_get

EAPI const Eolian_Implement *
eolian_function_implement_get(const Eolian_Function *fid)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
   return fid->impl;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_function_api.c


示例5: eolian_function_object_is_const

EAPI Eina_Bool
eolian_function_object_is_const(const Eolian_Function *fid)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
   return fid->obj_is_const;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_function_api.c


示例6: ewk_context_menu_item_title_set

const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title)
{
    EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0);
    eina_stringshare_replace(&o->title, title);
    return o->title;
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:6,代码来源:ewk_contextmenu.cpp


示例7: ewk_context_menu_item_enabled_set

Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item *o, Eina_Bool enabled)
{
    EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
    o->enabled = enabled;
    return EINA_TRUE;
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:6,代码来源:ewk_contextmenu.cpp


示例8: eolian_typedecl_type_get

EAPI Eolian_Typedecl_Type
eolian_typedecl_type_get(const Eolian_Typedecl *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EOLIAN_TYPEDECL_UNKNOWN);
   return tp->type;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例9: eolian_typedecl_is_extern

EAPI Eina_Bool
eolian_typedecl_is_extern(const Eolian_Typedecl *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
   return tp->is_extern;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例10: eolian_typedecl_base_type_get

EAPI const Eolian_Type *
eolian_typedecl_base_type_get(const Eolian_Typedecl *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
   return tp->base_type;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例11: eolian_type_is_ptr

EAPI Eina_Bool
eolian_type_is_ptr(const Eolian_Type *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
   return tp->is_ptr;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例12: eolian_type_builtin_type_get

EAPI Eolian_Type_Builtin_Type
eolian_type_builtin_type_get(const Eolian_Type *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EOLIAN_TYPE_BUILTIN_INVALID);
   return tp->btype;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例13: eolian_type_next_type_get

EAPI const Eolian_Type *
eolian_type_next_type_get(const Eolian_Type *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
   return tp->next_type;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例14: eolian_typedecl_documentation_get

EAPI const Eolian_Documentation *
eolian_typedecl_documentation_get(const Eolian_Typedecl *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
   return tp->doc;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例15: ewk_context_menu_item_action_set

Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Action action)
{
    EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
    o->action = action;
    return EINA_TRUE;
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:6,代码来源:ewk_contextmenu.cpp


示例16: eolian_typedecl_free_func_get

EAPI Eina_Stringshare *
eolian_typedecl_free_func_get(const Eolian_Typedecl *tp)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
   return tp->freefunc;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例17: ewk_context_menu_item_title_get

const char* ewk_context_menu_item_title_get(Ewk_Context_Menu_Item* o)
{
    EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0);
    return o->title;
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:5,代码来源:ewk_contextmenu.cpp


示例18: eolian_typedecl_struct_field_documentation_get

EAPI const Eolian_Documentation *
eolian_typedecl_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(fl, NULL);
   return fl->doc;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c


示例19: ewk_context_menu_item_enabled_get

Eina_Bool ewk_context_menu_item_enabled_get(Ewk_Context_Menu_Item* o)
{
    EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE);
    return o->enabled;
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:5,代码来源:ewk_contextmenu.cpp


示例20: eolian_typedecl_struct_field_type_get

EAPI const Eolian_Type *
eolian_typedecl_struct_field_type_get(const Eolian_Struct_Type_Field *fl)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(fl, NULL);
   return fl->type;
}
开发者ID:tasn,项目名称:efl,代码行数:6,代码来源:database_type_api.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ EI_TRACE_ERR0函数代码示例发布时间:2022-05-30
下一篇:
C++ EINA_SAFETY_ON_NULL_RETURN函数代码示例发布时间: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