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

C++ GSIZE_TO_POINTER函数代码示例

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

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



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

示例1: tail_align

static void
tail_align (gpointer ptr,
            gsize size,
            const AlignmentCriteria * criteria,
            TailAlignResult * result)
{
  gsize unaligned_start_address, unaligned_end_address;
  gsize next_tail_boundary;
  gsize aligned_start_address, aligned_end_address;

  unaligned_start_address = GPOINTER_TO_SIZE (ptr);
  unaligned_end_address = unaligned_start_address + size - 1;
  next_tail_boundary = ((unaligned_end_address / criteria->tail) + 1) * criteria->tail;

  aligned_start_address = ((next_tail_boundary - size) / criteria->front) * criteria->front;
  if (aligned_start_address < unaligned_start_address)
  {
    aligned_start_address += criteria->tail;
    next_tail_boundary += criteria->tail;
  }
  aligned_end_address = aligned_start_address + size - 1;

  result->aligned_ptr = GSIZE_TO_POINTER (aligned_start_address);
  result->next_tail_ptr = GSIZE_TO_POINTER (next_tail_boundary);
  result->gap_size = next_tail_boundary - (aligned_end_address + 1);
}
开发者ID:Fitblip,项目名称:frida-gum,代码行数:26,代码来源:gumpagepool.c


示例2: torflowrelay_addMeasurement

void torflowrelay_addMeasurement(TorFlowRelay* relay,
        gsize contentLength, gsize roundTripTime, gsize payloadTime, gsize totalTime) {
    g_assert(relay);

    relay->transferTimes = g_slist_prepend(relay->transferTimes, GSIZE_TO_POINTER(totalTime));
    relay->transferSizes = g_slist_prepend(relay->transferSizes, GSIZE_TO_POINTER(contentLength));
}
开发者ID:shadow,项目名称:shadow-plugin-tor,代码行数:7,代码来源:torflow-relay.c


示例3: build_address_lookup

int build_address_lookup(char* first_snapshot, char* second_snapshot) {
    ssize_t rc;
    char* line;
    size_t len = 0;
    uint32_t addr;
    u_long taint_val;

    address_lookup = g_hash_table_new(g_direct_hash, g_direct_equal); 
    second_address_lookup = g_hash_table_new(g_direct_hash, g_direct_equal); 
   
/*  First Snapshot ############################################# */
    FILE* fp = fopen(first_snapshot, "r");
    assert(fp);
    while ((rc = getline(&line, &len, fp)) != -1) {
        sscanf(line, "%x: %lu\n", &addr, &taint_val);
        g_hash_table_insert(address_lookup, GUINT_TO_POINTER(addr), GSIZE_TO_POINTER(taint_val));
    }
    
/*  Second Snapshot ############################################# */
    fp = fopen(second_snapshot, "r");
    assert(fp);
    while ((rc = getline(&line, &len, fp)) != -1) {
        sscanf(line, "%x: %lu\n", &addr, &taint_val);
        g_hash_table_insert(second_address_lookup, GUINT_TO_POINTER(addr), GSIZE_TO_POINTER(taint_val));
    }
    return 1;
}
开发者ID:andrewjylee,项目名称:taint_trackers,代码行数:27,代码来源:stitch_working.cpp


示例4: glx_ctx_push_thread_local

void
glx_ctx_push_thread_local(VdpDeviceData *deviceData)
{
    glx_ctx_lock();
    Display *dpy = deviceData->display;
    const Window wnd = deviceData->root;
    thread_id_t thread_id = get_current_thread_id();

    ctx_stack.dpy = glXGetCurrentDisplay();
    if (!ctx_stack.dpy)
        ctx_stack.dpy = dpy;
    ctx_stack.wnd =     glXGetCurrentDrawable();
    ctx_stack.glc =     glXGetCurrentContext();
    ctx_stack.element_count ++;

    struct val_s *val = g_hash_table_lookup(glc_hash_table, GSIZE_TO_POINTER(thread_id));
    if (!val) {
        GLXContext glc = glXCreateContext(dpy, root_vi, root_glc, GL_TRUE);
        assert(glc);
        val = make_val(dpy, glc);
        g_hash_table_insert(glc_hash_table, GSIZE_TO_POINTER(thread_id), val);

        // try cleanup expired entries
        g_hash_table_foreach_remove(glc_hash_table, is_thread_expired, NULL);
    }
    assert(val->dpy == dpy);

    glXMakeCurrent(dpy, wnd, val->glc);
}
开发者ID:Dangku,项目名称:libvdpau-va-gl,代码行数:29,代码来源:ctx-stack.c


示例5: _insert_grl_mex_link

static void
_insert_grl_mex_link (GrlKeyID grl_key, MexContentMetadata mex_key)
{
  /* g_hash_table_insert (grl_to_mex, */
  /*                      GSIZE_TO_POINTER (grl_key), */
  /*                      GSIZE_TO_POINTER (mex_key)); */
  g_hash_table_insert (mex_to_grl,
                       GSIZE_TO_POINTER (mex_key),
                       GSIZE_TO_POINTER (grl_key));
}
开发者ID:jpwhiting,项目名称:media-explorer,代码行数:10,代码来源:mex-grilo.c


示例6: register_conversion_function

static void
register_conversion_function (GType          type,
                              ParseFunc      parse,
                              ToStringFunc   to_string)
{
  if (parse)
    g_hash_table_insert (parse_funcs, GSIZE_TO_POINTER (type), parse);
  if (to_string)
    g_hash_table_insert (to_string_funcs, GSIZE_TO_POINTER (type), to_string);
}
开发者ID:nacho,项目名称:gtk-,代码行数:10,代码来源:gtkcssstringfuncs.c


示例7: ipcam_event_input_msg_handler_read_param

static gboolean
ipcam_event_input_msg_handler_read_param(IpcamEventInputMsgHandler *handler, JsonBuilder *builder, const gchar *name)
{
    IpcamIConfig *iconfig;
    g_object_get(G_OBJECT(handler), "app", &iconfig, NULL);
    gboolean ret = FALSE;
    GVariant *value = NULL;

    value = ipcam_iconfig_read(iconfig, IPCAM_EVENT_INPUT_TYPE, name, "enable");
    if (value)
    {
        json_builder_set_member_name(builder, "enable");
        json_builder_add_boolean_value(builder, g_variant_get_boolean(value));
        g_variant_unref(value);
    }
    
    value = ipcam_iconfig_read(iconfig, IPCAM_EVENT_INPUT_TYPE, name, "schedules");
    if (value)
    {
        Schedules *sche;
        if (IS_64BIT_MACHINE)
        {
            sche = GSIZE_TO_POINTER(g_variant_get_uint64(value));
        }
        else
        {
            sche = GSIZE_TO_POINTER(g_variant_get_uint32(value));
        }
        gint i = 0;
        json_builder_set_member_name(builder, "schedules");
        json_builder_begin_object(builder);
        if (sche)
        {            
            for (i = ENUM_MON; i < ENUM_WEEKDAY_LAST; i++)
            {
                if (sche->schedule[i])
                {
                    json_builder_set_member_name(builder, weekday_name[i]);
                    json_builder_add_string_value(builder, sche->schedule[i]);
                    g_free(sche->schedule[i]);
                }
            }
            g_free(sche);
        }
        json_builder_end_object(builder);

        g_variant_unref(value);
    }
    
    return ret;
}
开发者ID:TangCheng,项目名称:iconfig,代码行数:51,代码来源:ipcam-event-input-handler.c


示例8: main_loop

static void
main_loop ()
{
  log_write ("openvassd %s started\n", OPENVASSD_VERSION);
  proctitle_set ("openvassd: Waiting for incoming connections");
  for (;;)
    {
      int soc;
      int family;
      unsigned int lg_address;
      struct sockaddr_in6 address6;
      struct sockaddr_in6 *p_addr;
      struct arglist *globals;
      struct addrinfo *ai;

      check_and_reload ();
      wait_for_children1 ();
      ai = arg_get_value (g_options, "addr");
      lg_address = sizeof (struct sockaddr_in6);
      soc = accept (global_iana_socket, (struct sockaddr *) (&address6),
                    &lg_address);
      if (soc == -1)
        continue;

      /*
       * MA: you cannot share an open SSL connection through fork/multithread
       * The SSL connection shall be open _after_ the fork */
      globals = emalloc (sizeof (struct arglist));
      arg_add_value (globals, "global_socket", ARG_INT, -1,
                     GSIZE_TO_POINTER (soc));

      arg_add_value (globals, "plugins", ARG_ARGLIST, -1, global_plugins);
      arg_add_value (globals, "preferences", ARG_ARGLIST, -1, global_preferences);

      p_addr = emalloc (sizeof (struct sockaddr_in6));
      family = ai->ai_family;
      memcpy (p_addr, &address6, sizeof (address6));
      arg_add_value (globals, "client_address", ARG_PTR, -1, p_addr);
      arg_add_value (globals, "family", ARG_INT, -1, GSIZE_TO_POINTER (family));

      /* we do not want to create an io thread, yet so the last argument is -1 */
      if (create_process ((process_func_t) scanner_thread, globals) < 0)
        {
          log_write ("Could not fork - client won't be served");
          sleep (2);
        }
      close (soc);
      arg_free (globals);
    }
}
开发者ID:manfredgithub,项目名称:Openvas-Source,代码行数:50,代码来源:openvassd.c


示例9: gum_store_runtime_bounds

static gboolean
gum_store_runtime_bounds (const GumModuleDetails * details,
                          GumRuntimeBounds * bounds)
{
  const GumMemoryRange * range = details->range;

  if (strcmp (details->name, "libandroid_runtime.so") != 0)
    return TRUE;

  bounds->start = GSIZE_TO_POINTER (range->base_address);
  bounds->end = GSIZE_TO_POINTER (range->base_address + range->size);

  return FALSE;
}
开发者ID:aonorin,项目名称:frida-gum,代码行数:14,代码来源:interceptor-android.c


示例10: af_animator_register_type_transformation

void
af_animator_register_type_transformation (GType                    type,
                                          AfTypeTransformationFunc trans_func)
{
  if (!transformable_types)
    transformable_types = g_hash_table_new (g_direct_hash, g_direct_equal);

  if (!trans_func)
    g_hash_table_remove (transformable_types, GSIZE_TO_POINTER (type));
  else
    g_hash_table_insert (transformable_types,
                         GSIZE_TO_POINTER (type),
                         trans_func);
}
开发者ID:troja84,项目名称:af,代码行数:14,代码来源:af-animator.c


示例11: gum_script_backend_obtain_v8

GumScriptBackend *
gum_script_backend_obtain_v8 (void)
{
  static volatile gsize gonce_value;

  if (g_once_init_enter (&gonce_value))
  {
    GumScriptBackend * backend = NULL;

    if (gum_query_is_rwx_supported ())
    {
#ifdef HAVE_V8
      backend = GUM_SCRIPT_BACKEND (
          g_object_new (GUM_V8_TYPE_SCRIPT_BACKEND, NULL));
#endif

      if (backend != NULL)
        _gum_register_early_destructor (gum_script_backend_deinit_v8);
    }

    g_once_init_leave (&gonce_value, GPOINTER_TO_SIZE (backend) + 1);
  }

  return GUM_SCRIPT_BACKEND (GSIZE_TO_POINTER (gonce_value - 1));
}
开发者ID:aonorin,项目名称:frida-gum,代码行数:25,代码来源:gumscriptbackend.c


示例12: gum_emit_malloc_range

static gboolean
gum_emit_malloc_range (const GumMallocRangeDetails * details,
                       gpointer user_data)
{
  GumJscMatchContext * mc = user_data;
  GumJscCore * core = mc->self->core;
  GumJscScope scope = GUM_JSC_SCOPE_INIT (core);
  JSContextRef ctx = mc->ctx;
  JSObjectRef range;
  JSValueRef result;
  gboolean proceed;
  gchar * str;

  range = JSObjectMake (ctx, NULL, NULL);
  _gumjs_object_set_pointer (ctx, range, "base",
      GSIZE_TO_POINTER (details->range->base_address), core);
  _gumjs_object_set_uint (ctx, range, "size", details->range->size);

  result = JSObjectCallAsFunction (ctx, mc->on_match, NULL, 1,
      (JSValueRef *) &range, &scope.exception);
  _gum_jsc_scope_flush (&scope);

  proceed = TRUE;
  if (result != NULL && _gumjs_string_try_get (ctx, result, &str, NULL))
  {
    proceed = strcmp (str, "stop") != 0;
    g_free (str);
  }

  return proceed;
}
开发者ID:terry2012,项目名称:frida-gum,代码行数:31,代码来源:gumjscprocess.c


示例13: find_image_text_section_ids

static GSList *
find_image_text_section_ids (gconstpointer address)
{
  GSList * ids = NULL;
  gsize section_count = 0;
  const gum_mach_header_t * header = address;
  guint8 * p;
  guint cmd_index, section_index;

  p = (guint8 *) (header + 1);
  for (cmd_index = 0; cmd_index != header->ncmds; cmd_index++)
  {
    struct load_command * lc = (struct load_command *) p;

    if (lc->cmd == GUM_LC_SEGMENT)
    {
      gum_segment_command_t * segcmd = (gum_segment_command_t *) lc;

      if ((segcmd->initprot & VM_PROT_EXECUTE) != 0)
      {
        for (section_index = 0; section_index != segcmd->nsects; section_index++)
        {
          ids = g_slist_prepend (ids,
              GSIZE_TO_POINTER (section_count + section_index + 1));
        }
      }

      section_count += segcmd->nsects;
    }

    p += lc->cmdsize;
  }

  return g_slist_reverse (ids);
}
开发者ID:idkwim,项目名称:frida-gum,代码行数:35,代码来源:gumprocess-darwin.c


示例14: gum_metal_array_get_extents

void
gum_metal_array_get_extents (GumMetalArray * self,
                             gpointer * start,
                             gpointer * end)
{
  GumMemoryRange range;
  guint size;

  size = (guint) ((guint8 *) gum_metal_array_element_at (self, self->capacity) -
      (guint8 *) self->data);
  gum_query_page_allocation_range (self->data, gum_round_up_to_page_size (size),
      &range);

  *start = GSIZE_TO_POINTER (range.base_address);
  *end = GSIZE_TO_POINTER (range.base_address + range.size);
}
开发者ID:frida,项目名称:frida-gum,代码行数:16,代码来源:gummetalarray.c


示例15: tny_gnome_keyring_password_getter_register_type

static gpointer
tny_gnome_keyring_password_getter_register_type (gpointer notused)
{
	GType type = 0;
	static const GTypeInfo info = 
		{
			sizeof (TnyGnomeKeyringPasswordGetterClass),
			NULL,   /* base_init */
			NULL,   /* base_finalize */
			(GClassInitFunc) tny_gnome_keyring_password_getter_class_init,   /* class_init */
			NULL,   /* class_finalize */
			NULL,   /* class_data */
			sizeof (TnyGnomeKeyringPasswordGetter),
			0,      /* n_preallocs */
			tny_gnome_keyring_password_getter_instance_init,    /* instance_init */
			NULL
		};


	static const GInterfaceInfo tny_password_getter_info = 
		{
			(GInterfaceInitFunc) tny_password_getter_init, /* interface_init */
			NULL,         /* interface_finalize */
			NULL          /* interface_data */
		};

	type = g_type_register_static (G_TYPE_OBJECT,
				       "TnyGnomeKeyringPasswordGetter",
				       &info, 0);

	g_type_add_interface_static (type, TNY_TYPE_PASSWORD_GETTER,
				     &tny_password_getter_info);

	return GSIZE_TO_POINTER (type);
}
开发者ID:Codeminded,项目名称:tinymail,代码行数:35,代码来源:tny-gnome-keyring-password-getter.c


示例16: ensure_module_ifaces

static void
ensure_module_ifaces (StoragedLinuxDriveObject *object,
                      StoragedModuleManager    *module_manager)
{
    GList *l;
    ModuleInterfaceEntry *entry;
    StoragedModuleInterfaceInfo *ii;

    /* Assume all modules are either unloaded or loaded at the same time, so don't regenerate entries */
    if (object->module_ifaces == NULL)
    {
        object->module_ifaces = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) free_module_interface_entry);

        l = storaged_module_manager_get_drive_object_iface_infos (module_manager);
        for (; l; l = l->next)
        {
            ii = l->data;
            entry = g_new0 (ModuleInterfaceEntry, 1);
            entry->has_func = ii->has_func;
            entry->connect_func = ii->connect_func;
            entry->update_func = ii->update_func;
            g_hash_table_replace (object->module_ifaces, GSIZE_TO_POINTER (ii->skeleton_type), entry);
        }
    }
}
开发者ID:frankzhao,项目名称:storaged,代码行数:25,代码来源:storagedlinuxdriveobject.c


示例17: gom_repository_find_async

void
gom_repository_find_async (GomRepository       *repository,
                           GType                resource_type,
                           GomFilter           *filter,
                           GAsyncReadyCallback  callback,
                           gpointer             user_data)
{
   GomRepositoryPrivate *priv;
   GSimpleAsyncResult *simple;

   g_return_if_fail(GOM_IS_REPOSITORY(repository));
   g_return_if_fail(g_type_is_a(resource_type, GOM_TYPE_RESOURCE));
   g_return_if_fail(resource_type != GOM_TYPE_RESOURCE);
   g_return_if_fail(!filter || GOM_IS_FILTER(filter));
   g_return_if_fail(callback != NULL);

   priv = repository->priv;

   simple = g_simple_async_result_new(G_OBJECT(repository), callback, user_data,
                                      gom_repository_find_async);
   g_object_set_data(G_OBJECT(simple), "resource-type",
                     GSIZE_TO_POINTER(resource_type));

   g_object_set_data_full(G_OBJECT(simple), "filter",
                          filter ? g_object_ref(filter) : NULL,
                          filter ? g_object_unref : NULL);
   gom_adapter_queue_read(priv->adapter, gom_repository_find_cb, simple);
}
开发者ID:zyh329,项目名称:ipcam_thirdparties,代码行数:28,代码来源:gom-repository.c


示例18: gjs_gtype_create_gtype_wrapper

JSObject *
gjs_gtype_create_gtype_wrapper (JSContext *context,
                                GType      gtype)
{
    JSObject *object;
    JSObject *global;

    JS_BeginRequest(context);

    /* put constructor for GIRepositoryGType() in the global namespace */
    global = gjs_get_import_global(context);
    gjs_gtype_create_proto(context, global, "GIRepositoryGType", NULL);

    object = g_type_get_qdata(gtype, gjs_get_gtype_wrapper_quark());
    if (object != NULL)
        goto out;

    object = JS_NewObject(context, &gjs_gtype_class, NULL, NULL);
    if (object == NULL)
        goto out;

    JS_SetPrivate(context, object, GSIZE_TO_POINTER(gtype));
    g_type_set_qdata(gtype, gjs_get_gtype_wrapper_quark(), object);

 out:
    JS_EndRequest(context);
    return object;
}
开发者ID:Cobinja,项目名称:cjs,代码行数:28,代码来源:gtype.c


示例19: on_end_element

static void
on_end_element (G_GNUC_UNUSED GMarkupParseContext *context,
                const gchar                       *el_name,
                gpointer                           user_data,
                G_GNUC_UNUSED GError             **error)
{
  CdkStyleScheme *self = CDK_STYLE_SCHEME (user_data);

  if (g_strcmp0 (el_name, "scheme") == 0)
    {
      self->priv->in_scheme_tag = FALSE;
      return;
    }
  else if (self->priv->in_scheme_tag &&
           self->priv->style_id >= 0 &&
           g_strcmp0 (el_name, "style") == 0)
    {
      CdkStyle *style = cdk_style_new ();
      style->fore = self->priv->fore_color;
      style->back = self->priv->back_color;
      style->bold = self->priv->bold;
      style->italic = self->priv->italic;
      style->font = self->priv->font;
      style->size = self->priv->size;

      g_hash_table_insert (self->priv->style_map,
                           GSIZE_TO_POINTER (self->priv->style_id),
                           style);
      //g_debug ("added style '%u'", (guint) self->priv->style_id);
      self->priv->style_id = -1;
    }
}
开发者ID:codebrainz,项目名称:cdk-plugin,代码行数:32,代码来源:cdkstylescheme.c


示例20: cdk_style_id_for_cursor_kind

CdkStyleID
cdk_style_id_for_cursor_kind (guint cursor_kind)
{
  if (G_UNLIKELY (cursor_map == NULL))
    return CDK_STYLE_DEFAULT;
  return GPOINTER_TO_SIZE (g_hash_table_lookup (cursor_map, GSIZE_TO_POINTER (cursor_kind)));
}
开发者ID:codebrainz,项目名称:cdk-plugin,代码行数:7,代码来源:cdkstylescheme.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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