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

C++ LL2NUM函数代码示例

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

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



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

示例1: Init_limits

void
Init_limits(void)
{
	VALUE mLimits;
	mLimits = rb_define_module("Limits");

	rb_define_const(mLimits, "CHAR_BIT", INT2FIX(CHAR_BIT));
	rb_define_const(mLimits, "MB_LEN_MAX", INT2FIX(MB_LEN_MAX));

	rb_define_const(mLimits, "CHAR_MAX", INT2FIX(CHAR_MAX));
	rb_define_const(mLimits, "CHAR_MIN", INT2FIX(CHAR_MIN));
	rb_define_const(mLimits, "UCHAR_MAX", INT2FIX(UCHAR_MAX));

	rb_define_const(mLimits, "SHRT_MAX", INT2FIX(SHRT_MAX));
	rb_define_const(mLimits, "SHRT_MIN", INT2FIX(SHRT_MIN));
	rb_define_const(mLimits, "USHRT_MAX", INT2FIX(USHRT_MAX));

	rb_define_const(mLimits, "INT_MAX", INT2FIX(INT_MAX));
	rb_define_const(mLimits, "INT_MIN", INT2FIX(INT_MIN));
	rb_define_const(mLimits, "UINT_MAX", INT2FIX(UINT_MAX));

	rb_define_const(mLimits, "LONG_MAX", LL2NUM(LONG_MAX));
	rb_define_const(mLimits, "LONG_MIN", LL2NUM(LONG_MIN));
	rb_define_const(mLimits, "ULONG_MAX", ULL2NUM(ULONG_MAX));

	rb_define_const(mLimits, "LLONG_MAX", LL2NUM(LLONG_MAX));
	rb_define_const(mLimits, "LLONG_MIN", LL2NUM(LLONG_MIN));
	rb_define_const(mLimits, "ULLONG_MAX", ULL2NUM(ULLONG_MAX));
}
开发者ID:ksss,项目名称:limits,代码行数:29,代码来源:limits.c


示例2: rd_die_new

static VALUE rd_die_new(rd_shared_data_t *sd, VALUE top, VALUE cu, Dwarf_Die die)
{
    rd_die_t *rd_die;
    Dwarf_Off off;
    Dwarf_Half tag;
    Dwarf_Error err;
    VALUE obj;
    VALUE klass;

    chkerr1(dwarf_dieoffset(die, &off, &err), &err, Qnil);
    obj = rb_hash_aref(sd->off2die, LL2NUM(off));
    if (!NIL_P(obj)) {
        return obj;
    }

    chkerr1(dwarf_tag(die, &tag, &err), &err, Qnil);
    klass = rb_hash_aref(rdwarf_tag2class, INT2FIX(tag));
    if (NIL_P(klass)) {
        rb_raise(rb_eRuntimeError, "unknown tag %d\n", tag);
    }
    obj = rd_die_s_alloc(klass);
    rd_die = GetDie(obj);
    rd_die->shared_data = rd_shared_data_ref(sd);
    rd_die->die = die;
    rb_ivar_set(obj, id_at_top, top);
    rb_ivar_set(obj, id_at_cu, NIL_P(cu) ? obj : cu);
    rb_hash_aset(sd->off2die, LL2NUM(off), obj);
    return obj;
}
开发者ID:kubo,项目名称:rdwarf,代码行数:29,代码来源:rdwarf.c


示例3: array_from_stat

static VALUE array_from_stat(const struct Stat* stat) {
  return rb_ary_new3(8,
		     LL2NUM(stat->czxid),
		     LL2NUM(stat->mzxid),
		     LL2NUM(stat->ctime),
		     LL2NUM(stat->mtime),
		     INT2NUM(stat->version),
		     INT2NUM(stat->cversion),
		     INT2NUM(stat->aversion),
		     LL2NUM(stat->ephemeralOwner));
}
开发者ID:shafferj,项目名称:zookeeper_client,代码行数:11,代码来源:zookeeper_ruby.c


示例4: rb_grn_bulk_to_ruby_object_by_range_id

static VALUE
rb_grn_bulk_to_ruby_object_by_range_id (grn_ctx *context, grn_obj *bulk,
					grn_id range_id,
					VALUE related_object, VALUE *rb_value)
{
    grn_bool success = GRN_TRUE;

    switch (range_id) {
      case GRN_DB_VOID:
	*rb_value = rb_str_new(GRN_TEXT_VALUE(bulk), GRN_TEXT_LEN(bulk));
	break;
      case GRN_DB_BOOL:
	*rb_value = GRN_BOOL_VALUE(bulk) ? Qtrue : Qfalse;
	break;
      case GRN_DB_INT32:
	*rb_value = INT2NUM(GRN_INT32_VALUE(bulk));
	break;
      case GRN_DB_UINT32:
	*rb_value = UINT2NUM(GRN_UINT32_VALUE(bulk));
	break;
      case GRN_DB_INT64:
	*rb_value = LL2NUM(GRN_INT64_VALUE(bulk));
	break;
      case GRN_DB_UINT64:
	*rb_value = ULL2NUM(GRN_UINT64_VALUE(bulk));
	break;
      case GRN_DB_FLOAT:
	*rb_value = rb_float_new(GRN_FLOAT_VALUE(bulk));
	break;
      case GRN_DB_TIME:
	{
	    int64_t time_value, sec, usec;

	    time_value = GRN_TIME_VALUE(bulk);
	    GRN_TIME_UNPACK(time_value, sec, usec);
	    *rb_value = rb_funcall(rb_cTime, rb_intern("at"), 2,
				   LL2NUM(sec), LL2NUM(usec));
	}
	break;
      case GRN_DB_SHORT_TEXT:
      case GRN_DB_TEXT:
      case GRN_DB_LONG_TEXT:
	*rb_value = rb_grn_context_rb_string_new(context,
						 GRN_TEXT_VALUE(bulk),
						 GRN_TEXT_LEN(bulk));
	break;
      default:
	success = GRN_FALSE;
	break;
    }

    return success;
}
开发者ID:ryoqun,项目名称:rroonga,代码行数:53,代码来源:rb-grn-utils.c


示例5: convert_parse

static VALUE
convert_parse(VALUE self)
{
    GstFormat src_format, dest_format;
    gint64 src_value, dest_value;

    gst_query_parse_convert(RVAL2GST_QUERY(self), &src_format, &src_value,
                            &dest_format, &dest_value);

    return rb_ary_new3(4, GST_FORMAT2RVAL(src_format), LL2NUM(src_value),
                       RVAL2GST_FORMAT(dest_format), LL2NUM(dest_value));
}
开发者ID:Mazwak,项目名称:ruby-gnome2,代码行数:12,代码来源:rbgst-query.c


示例6: rdo_mysql_result_info_new

/** Extract result information from the given result */
static VALUE rdo_mysql_result_info_new(MYSQL * conn, MYSQL_RES * res) {
  unsigned long long count = (res == NULL) ? 0 : mysql_num_rows(res);

  VALUE info = rb_hash_new();
  rb_hash_aset(info, ID2SYM(rb_intern("count")), LL2NUM(count));
  rb_hash_aset(info, ID2SYM(rb_intern("insert_id")),
      LL2NUM(mysql_insert_id(conn)));
  rb_hash_aset(info, ID2SYM(rb_intern("affected_rows")),
      LL2NUM(mysql_affected_rows(conn)));

  return info;
}
开发者ID:d11wtq,项目名称:rdo-mysql,代码行数:13,代码来源:driver.c


示例7: seeking_parse

static VALUE
seeking_parse(VALUE self)
{
    GstFormat format;
    gboolean seekable;
    gint64 segment_start, segment_end;

    gst_query_parse_seeking(RVAL2GST_QUERY(self), &format, &seekable,
                            &segment_start, &segment_end);

    return rb_ary_new3(4, GST_FORMAT2RVAL(format), CBOOL2RVAL(seekable),
                       LL2NUM(segment_start), LL2NUM(segment_end));
}
开发者ID:Mazwak,项目名称:ruby-gnome2,代码行数:13,代码来源:rbgst-query.c


示例8: segment_parse

static VALUE
segment_parse(VALUE self)
{
    GstFormat format;
    gdouble rate;
    gint64 start_value, stop_value;

    gst_query_parse_segment(RVAL2GST_QUERY(self), &rate, &format,
                            &start_value, &stop_value);

    return rb_ary_new3(4, rb_dbl2big(rate), GST_FORMAT2RVAL(format),
                        LL2NUM(start_value), LL2NUM(stop_value));
}
开发者ID:Mazwak,项目名称:ruby-gnome2,代码行数:13,代码来源:rbgst-query.c


示例9: buffersize_parse

static VALUE
buffersize_parse(VALUE self)
{
    GstFormat format;
    gint64 minsize;
    gint64 maxsize;
    gboolean async;

    gst_event_parse_buffer_size(RGST_EVENT(self), &format, &minsize,
                                &maxsize, &async);

    return rb_ary_new3(4, GST_FORMAT2RVAL(format), LL2NUM(minsize),
                       LL2NUM(maxsize), CBOOL2RVAL(async));
}
开发者ID:masaakiaoyagi,项目名称:ruby-gnome2,代码行数:14,代码来源:rbgst-event.c


示例10: Data_Get_Struct

		VALUE FileWrapper::rb_get_size(VALUE self)
		{
			File *fl;
			Data_Get_Struct(self, File, fl);

			return LL2NUM(fl->get_size());
		}
开发者ID:ArekX,项目名称:RAGE,代码行数:7,代码来源:File_Wrapper.cpp


示例11: newsegment_parse

static VALUE
newsegment_parse(VALUE self)
{
    gboolean update;
    gdouble rate, applied_rate;
    GstFormat format;
    gint64 start, stop, position;

    gst_event_parse_new_segment_full(RGST_EVENT(self), &update, &rate,
                                     &applied_rate, &format, &start, &stop,
                                     &position);

    return rb_ary_new3(7, CBOOL2RVAL(update), DBL2NUM(update), DBL2NUM(rate),
                       GST_FORMAT2RVAL(format), LL2NUM(start), LL2NUM(stop),
                       LL2NUM(position));
}
开发者ID:masaakiaoyagi,项目名称:ruby-gnome2,代码行数:16,代码来源:rbgst-event.c


示例12: buffered_file_pos

/* Get the current file position */
static VALUE buffered_file_pos(VALUE self) {
  VALUE parent_pos = rb_call_super(0, NULL);
  long long ll_pos = NUM2LL(parent_pos);
  long buffer_length = RSTRING_LEN(rb_ivar_get(self, id_ivar_buffer));
  long buffer_index = FIX2INT(rb_ivar_get(self, id_ivar_buffer_index));
  return LL2NUM(ll_pos - (long long)(buffer_length - buffer_index));
}
开发者ID:WEST3357,项目名称:COSMOS,代码行数:8,代码来源:buffered_file.c


示例13: value_from_default

static VALUE value_from_default(const upb_fielddef *field) {
  switch (upb_fielddef_type(field)) {
    case UPB_TYPE_FLOAT:   return DBL2NUM(upb_fielddef_defaultfloat(field));
    case UPB_TYPE_DOUBLE:  return DBL2NUM(upb_fielddef_defaultdouble(field));
    case UPB_TYPE_BOOL:
      return upb_fielddef_defaultbool(field) ? Qtrue : Qfalse;
    case UPB_TYPE_MESSAGE: return Qnil;
    case UPB_TYPE_ENUM: {
      const upb_enumdef *enumdef = upb_fielddef_enumsubdef(field);
      int32_t num = upb_fielddef_defaultint32(field);
      const char *label = upb_enumdef_iton(enumdef, num);
      if (label) {
        return ID2SYM(rb_intern(label));
      } else {
        return INT2NUM(num);
      }
    }
    case UPB_TYPE_INT32:   return INT2NUM(upb_fielddef_defaultint32(field));
    case UPB_TYPE_INT64:   return LL2NUM(upb_fielddef_defaultint64(field));;
    case UPB_TYPE_UINT32:  return UINT2NUM(upb_fielddef_defaultuint32(field));
    case UPB_TYPE_UINT64:  return ULL2NUM(upb_fielddef_defaultuint64(field));
    case UPB_TYPE_STRING:
    case UPB_TYPE_BYTES: {
      size_t size;
      const char *str = upb_fielddef_defaultstr(field, &size);
      return rb_str_new(str, size);
    }
    default: return Qnil;
  }
}
开发者ID:Falco20019,项目名称:protobuf,代码行数:30,代码来源:storage.c


示例14: ruby_libvirt_typed_params_to_hash

void ruby_libvirt_typed_params_to_hash(void *voidparams, int i, VALUE hash)
{
    virTypedParameterPtr params = (virTypedParameterPtr)voidparams;
    VALUE val;

    switch (params[i].type) {
    case VIR_TYPED_PARAM_INT:
        val = INT2NUM(params[i].value.i);
        break;
    case VIR_TYPED_PARAM_UINT:
        val = UINT2NUM(params[i].value.ui);
        break;
    case VIR_TYPED_PARAM_LLONG:
        val = LL2NUM(params[i].value.l);
        break;
    case VIR_TYPED_PARAM_ULLONG:
        val = ULL2NUM(params[i].value.ul);
        break;
    case VIR_TYPED_PARAM_DOUBLE:
        val = rb_float_new(params[i].value.d);
        break;
    case VIR_TYPED_PARAM_BOOLEAN:
        val = (params[i].value.b == 0) ? Qfalse : Qtrue;
        break;
    case VIR_TYPED_PARAM_STRING:
        val = rb_str_new2(params[i].value.s);
        break;
    default:
        rb_raise(rb_eArgError, "Invalid parameter type");
    }

    rb_hash_aset(hash, rb_str_new2(params[i].field), val);
}
开发者ID:agx,项目名称:ruby-libvirt,代码行数:33,代码来源:common.c


示例15: cQuery_searchcount

static VALUE cQuery_searchcount(VALUE vself){
  VALUE vqry;
  RDBQRY *qry;
  vqry = rb_iv_get(vself, RDBQRYVNDATA);
  Data_Get_Struct(vqry, RDBQRY, qry);
  return LL2NUM(tcrdbqrysearchcount(qry));
}
开发者ID:bcg,项目名称:ruby-tokyotyrant,代码行数:7,代码来源:tokyo_tyrant_query.c


示例16: layout_get_default

VALUE layout_get_default(const upb_fielddef *field) {
  switch (upb_fielddef_type(field)) {
    case UPB_TYPE_FLOAT:   return DBL2NUM(upb_fielddef_defaultfloat(field));
    case UPB_TYPE_DOUBLE:  return DBL2NUM(upb_fielddef_defaultdouble(field));
    case UPB_TYPE_BOOL:
      return upb_fielddef_defaultbool(field) ? Qtrue : Qfalse;
    case UPB_TYPE_MESSAGE: return Qnil;
    case UPB_TYPE_ENUM: {
      const upb_enumdef *enumdef = upb_fielddef_enumsubdef(field);
      int32_t num = upb_fielddef_defaultint32(field);
      const char *label = upb_enumdef_iton(enumdef, num);
      if (label) {
        return ID2SYM(rb_intern(label));
      } else {
        return INT2NUM(num);
      }
    }
    case UPB_TYPE_INT32:   return INT2NUM(upb_fielddef_defaultint32(field));
    case UPB_TYPE_INT64:   return LL2NUM(upb_fielddef_defaultint64(field));;
    case UPB_TYPE_UINT32:  return UINT2NUM(upb_fielddef_defaultuint32(field));
    case UPB_TYPE_UINT64:  return ULL2NUM(upb_fielddef_defaultuint64(field));
    case UPB_TYPE_STRING:
    case UPB_TYPE_BYTES: {
      size_t size;
      const char *str = upb_fielddef_defaultstr(field, &size);
      VALUE str_rb = rb_str_new(str, size);

      rb_enc_associate(str_rb, (upb_fielddef_type(field) == UPB_TYPE_BYTES) ?
                 kRubyString8bitEncoding : kRubyStringUtf8Encoding);
      rb_obj_freeze(str_rb);
      return str_rb;
    }
    default: return Qnil;
  }
}
开发者ID:acozzette,项目名称:protobuf,代码行数:35,代码来源:storage.c


示例17: native_slot_get

VALUE native_slot_get(upb_fieldtype_t type,
                      VALUE type_class,
                      const void* memory) {
  switch (type) {
    case UPB_TYPE_FLOAT:
      return DBL2NUM(DEREF(memory, float));
    case UPB_TYPE_DOUBLE:
      return DBL2NUM(DEREF(memory, double));
    case UPB_TYPE_BOOL:
      return DEREF(memory, int8_t) ? Qtrue : Qfalse;
    case UPB_TYPE_STRING:
    case UPB_TYPE_BYTES:
    case UPB_TYPE_MESSAGE:
      return DEREF(memory, VALUE);
    case UPB_TYPE_ENUM: {
      int32_t val = DEREF(memory, int32_t);
      VALUE symbol = enum_lookup(type_class, INT2NUM(val));
      if (symbol == Qnil) {
        return INT2NUM(val);
      } else {
        return symbol;
      }
    }
    case UPB_TYPE_INT32:
      return INT2NUM(DEREF(memory, int32_t));
    case UPB_TYPE_INT64:
      return LL2NUM(DEREF(memory, int64_t));
    case UPB_TYPE_UINT32:
      return UINT2NUM(DEREF(memory, uint32_t));
    case UPB_TYPE_UINT64:
      return ULL2NUM(DEREF(memory, uint64_t));
    default:
      return Qnil;
  }
}
开发者ID:acozzette,项目名称:protobuf,代码行数:35,代码来源:storage.c


示例18: process_ways

static void process_ways(VALUE out, OSMPBF__PrimitiveGroup *group, OSMPBF__StringTable *string_table, int32_t ts_granularity)
{
  unsigned j, k;
  size_t i = 0;

  for(i = 0; i < group->n_ways; i++)
  {
    OSMPBF__Way *way = group->ways[i];
    int64_t delta_refs = 0;

    VALUE way_out = rb_hash_new();

    rb_hash_aset(way_out, STR2SYM("id"), LL2NUM(way->id));

    // Extract tags
    VALUE tags = rb_hash_new();

    for(j = 0; j < way->n_keys; j++)
    {
      char *key   = parse_binary_str(string_table->s[way->keys[j]]);
      char *value = parse_binary_str(string_table->s[way->vals[j]]);

      rb_hash_aset(tags, str_new(key), str_new(value));

      free(key);
      free(value);
    }

    // Extract refs
    VALUE refs = rb_ary_new();

    for(k = 0; k < way->n_refs; k++)
    {
      delta_refs += way->refs[k];
      rb_ary_push(refs, LL2NUM(delta_refs));
    }

    // Extract info
    if(way->info)
      add_info(way_out, way->info, string_table, ts_granularity);

    rb_hash_aset(way_out, STR2SYM("tags"), tags);
    rb_hash_aset(way_out, STR2SYM("refs"), refs);
    rb_ary_push(out, way_out);
  }
}
开发者ID:playtimestudios,项目名称:admin_bounds,代码行数:46,代码来源:pbf_parser.c


示例19: last_insert_row_id

/* call-seq: last_insert_row_id
 *
 * Obtains the unique row ID of the last row to be inserted by this Database
 * instance.
 */
static VALUE last_insert_row_id(VALUE self)
{
  sqlite3RubyPtr ctx;
  Data_Get_Struct(self, sqlite3Ruby, ctx);
  REQUIRE_OPEN_DB(ctx);

  return LL2NUM(sqlite3_last_insert_rowid(ctx->db));
}
开发者ID:kashif,项目名称:sqlite3-ruby,代码行数:13,代码来源:database.c


示例20: pointer

/*
 * Returns the array's pointer
 */
static VALUE pointer (VALUE self)
{
#if __x86_64__
  return LL2NUM((long long) RARRAY_PTR(self));
#else
  return LONG2NUM((long) RARRAY_PTR(self));
#endif
}
开发者ID:WEST3357,项目名称:COSMOS,代码行数:11,代码来源:low_fragmentation_array.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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