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

C++ Int64_val函数代码示例

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

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



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

示例1: netsys_fallocate

CAMLprim value netsys_fallocate(value fd, value start, value len) {
#ifdef HAVE_POSIX_FALLOCATE
    int r;
    int64 start_int, len_int;
    off_t start_off, len_off;
    /* Att: off_t might be 64 bit even on 32 bit systems! */

    start_int = Int64_val(start);
    len_int = Int64_val(len);

    if ( ((int64) ((off_t) start_int)) != start_int )
	failwith("Netsys.fadvise: large files not supported on this OS");
    if ( ((int64) ((off_t) len_int)) != len_int )
	failwith("Netsys.fadvise: large files not supported on this OS");

    start_off = start_int;
    len_off = len_int;

    r = posix_fallocate(Int_val(fd), start_off, len_off);
    /* does not set errno! */
    if (r != 0) 
	unix_error(r, "posix_fallocate64", Nothing);
    return Val_unit;
#else
    invalid_argument("Netsys.fallocate not available");
#endif
}
开发者ID:iSCGroup,项目名称:libres3,代码行数:27,代码来源:netsys_c_fallocate.c


示例2: domain_build_info_val

static int domain_build_info_val (caml_gc *gc, libxl_domain_build_info *c_val, value v)
{
	CAMLparam1(v);
	CAMLlocal1(infopriv);

	c_val->max_vcpus = Int_val(Field(v, 0));
	c_val->cur_vcpus = Int_val(Field(v, 1));
	c_val->max_memkb = Int64_val(Field(v, 2));
	c_val->target_memkb = Int64_val(Field(v, 3));
	c_val->video_memkb = Int64_val(Field(v, 4));
	c_val->shadow_memkb = Int64_val(Field(v, 5));
	c_val->kernel.path = dup_String_val(gc, Field(v, 6));
	c_val->is_hvm = Tag_val(Field(v, 7)) == 0;
	infopriv = Field(Field(v, 7), 0);
	if (c_val->hvm) {
		c_val->u.hvm.pae = Bool_val(Field(infopriv, 0));
		c_val->u.hvm.apic = Bool_val(Field(infopriv, 1));
		c_val->u.hvm.acpi = Bool_val(Field(infopriv, 2));
		c_val->u.hvm.nx = Bool_val(Field(infopriv, 3));
		c_val->u.hvm.viridian = Bool_val(Field(infopriv, 4));
		c_val->u.hvm.timeoffset = dup_String_val(gc, Field(infopriv, 5));
		c_val->u.hvm.timer_mode = Int_val(Field(infopriv, 6));
		c_val->u.hvm.hpet = Int_val(Field(infopriv, 7));
		c_val->u.hvm.vpt_align = Int_val(Field(infopriv, 8));
	} else {
		c_val->u.pv.slack_memkb = Int64_val(Field(infopriv, 0));
		c_val->u.pv.cmdline = dup_String_val(gc, Field(infopriv, 1));
		c_val->u.pv.ramdisk.path = dup_String_val(gc, Field(infopriv, 2));
		c_val->u.pv.features = dup_String_val(gc, Field(infopriv, 3));
	}

	CAMLreturn(0);
}
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:33,代码来源:xl_stubs.c


示例3: caml_int64_div

CAMLprim value caml_int64_div(value v1, value v2)
{
  int64 dividend = Int64_val(v1);
  int64 divisor = Int64_val(v2);
  if (I64_is_zero(divisor)) caml_raise_zero_divide();
  /* PR#4740: on some processors, division crashes on overflow.
     Implement the same behavior as for type "int". */
  if (I64_is_min_int(dividend) && I64_is_minus_one(divisor)) return v1;
  return caml_copy_int64(I64_div(Int64_val(v1), divisor));
}
开发者ID:dirkdokter,项目名称:pprz-installer-fedora,代码行数:10,代码来源:ints.c


示例4: domain_build_state_val

static int domain_build_state_val(caml_gc *gc, libxl_domain_build_state *c_val, value v)
{
	CAMLparam1(v);

	c_val->store_port = Int_val(Field(v, 0));
	c_val->store_mfn = Int64_val(Field(v, 1));
	c_val->console_port = Int_val(Field(v, 2));
	c_val->console_mfn = Int64_val(Field(v, 3));
	
	CAMLreturn(0);
}
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:11,代码来源:xl_stubs.c


示例5: guestfs_int_mllib_progress_bar_set

/* NB: "noalloc" function. */
value
guestfs_int_mllib_progress_bar_set (value barv,
                                    value positionv, value totalv)
{
  struct progress_bar *bar = Bar_val (barv);
  uint64_t position = Int64_val (positionv);
  uint64_t total = Int64_val (totalv);

  progress_bar_set (bar, position, total);

  return Val_unit;
}
开发者ID:noxdafox,项目名称:libguestfs,代码行数:13,代码来源:progress-c.c


示例6: brlapiml_acceptKeyRanges

CAMLprim value brlapiml_acceptKeyRanges(value handle, value camlRanges)
{
  CAMLparam2(handle, camlRanges);
  CAMLlocal1(r);
  unsigned int i, size = Wosize_val(camlRanges);
  brlapi_range_t ranges[size];
  for (i=0; i<size; i++) {
    r = Field(camlRanges, i);
    ranges[i].first = Int64_val(Field(r, 0));
    ranges[i].last = Int64_val(Field(r, 1));
  }
  brlapiCheckError(acceptKeyRanges, ranges, size);
  CAMLreturn(Val_unit);
}
开发者ID:Feechka,项目名称:UOBP,代码行数:14,代码来源:brlapi_stubs.c


示例7: tigertree_unsafe64_fd

value tigertree_unsafe64_fd (value digest_v, value fd_v, value pos_v, value len_v)
{
  OS_FD fd = Fd_val(fd_v);
  OFF_T pos = Int64_val(pos_v);
  OFF_T len = Int64_val(len_v);
  unsigned char *digest = String_val(digest_v);
/*  int nread; */

  os_lseek(fd, pos, SEEK_SET);

  tiger_tree_fd(fd, len, 0, tiger_block_size(len), digest);

  return Val_unit;
}
开发者ID:LuoZijun,项目名称:mldonkey,代码行数:14,代码来源:stubs_c.c


示例8: stub_blk_read

CAMLprim value stub_blk_read(value sector, value buffer, value num) {
    CAMLparam3(sector, buffer, num);
    uint64_t sec = Int64_val(sector);
    uint8_t *data = Caml_ba_data_val(buffer);
    int n = Int_val(num);
    int ret = 0;

    assert(Caml_ba_array_val(buffer)->num_dims == 1);

    //printf("Solo5 blk read: sec=%d num=%d\n", sec, n);

    ret = solo5_blk_read_sync(sec, data, &n);
    if ( ret )
        printf("virtio read failed... %d from sector=%d\n", n, sec);

#if 0
    {
        int i;
        for (i = 0; i < n; i++) {
            printf("%02x ", (uint8_t) data[i]);
            if ( i % 16 == 15 )
                printf("\n");
        }
        printf("\n");
    }
#endif

    CAMLreturn(Val_bool(!ret));
}
开发者ID:hannesm,项目名称:mirage-solo5,代码行数:29,代码来源:solo5_block_stubs.c


示例9: stub_sendfile64

CAMLprim value stub_sendfile64(value in_fd, value out_fd, value len){
  CAMLparam3(in_fd, out_fd, len);
  CAMLlocal1(result);
  size_t c_len = Int64_val(len);
  size_t bytes;
  int c_in_fd = Int_val(in_fd);
  int c_out_fd = Int_val(out_fd);

  int rc = NOT_IMPLEMENTED;

  enter_blocking_section();

#ifdef __linux__
  rc = TRIED_AND_FAILED;
  bytes = sendfile(c_out_fd, c_in_fd, NULL, c_len);
  if (bytes != -1) rc = OK;
#endif

  leave_blocking_section();

  switch (rc) {
    case NOT_IMPLEMENTED:
      caml_failwith("This platform does not support sendfile()");
      break;
    case TRIED_AND_FAILED:
      uerror("sendfile", Nothing);
      break;
    default: break;
  }
  result = caml_copy_int64(bytes);
  CAMLreturn(result);
}
开发者ID:djs55,项目名称:vhd-tool,代码行数:32,代码来源:sendfile64_stubs.c


示例10: c_sprint_int64

value
c_sprint_int64(value s, value index, value x) {
  CAMLparam3 (s, index, x);
  int64_t *p = (int64_t*) (String_val(s) + Int_val(index));
  *p = (int64_t)Int64_val(x);
  CAMLreturn (Val_unit);
}
开发者ID:AE4317group07,项目名称:paparazzi,代码行数:7,代码来源:convert.c


示例11: uwt_lseek

/*
  lseek is used inside Uwt_io. Therefore, I can't be seperated like the other
  unix functions
*/
CAMLprim value
uwt_lseek(value o_fd, value o_pos, value o_mode, value o_loop, value o_cb)
{
  CAMLparam1(o_cb);
  int erg;
  uv_loop_t * loop = Uv_loop_val(o_loop);
  const int fd = FD_VAL(o_fd);
  const int64_t offset = Int64_val(o_pos);
  const int whence = seek_command_table[ Long_val(o_mode) ];

  GR_ROOT_ENLARGE();
  value o_ret;
  struct req * req = uwt__req_create_res(UV_WORK, &o_ret);
  req->buf.len = (size_t)fd;
  req->offset = whence;
  req->c_cb = lseek_cb;
  int64_t_to_voids(offset,&req->c);
  erg = uv_queue_work(loop, (uv_work_t*)req->req, lseek_work_cb, uwork_cb);
  if ( erg >= 0 ){
    uwt__gr_register(&req->cb,o_cb);
  }
  else {
    uwt__req_free(req);
    Field(o_ret,0) = Val_uwt_error(erg);
    Tag_val(o_ret) = Error_tag;
  }
  CAMLreturn(o_ret);
}
开发者ID:djs55,项目名称:uwt,代码行数:32,代码来源:uwt_stubs_worker.c


示例12: unix_lseek_64

CAMLprim value unix_lseek_64(value fd, value ofs, value cmd)
{
  __int64 ret;

  ret = caml_set_file_pointer(Handle_val(fd), Int64_val(ofs),
                              seek_command_table[Int_val(cmd)]);
  return copy_int64(ret);
}
开发者ID:OCamlPro,项目名称:OCamlPro-OCaml-Branch,代码行数:8,代码来源:lseek.c


示例13: caml_int64_float_of_bits

CAMLprim value caml_int64_float_of_bits(value vi)
{
  union { double d; int64 i; int32 h[2]; } u;
  u.i = Int64_val(vi);
#if defined(__arm__) && !defined(__ARM_EABI__)
  { int32 t = u.h[0]; u.h[0] = u.h[1]; u.h[1] = t; }
#endif
  return caml_copy_double(u.d);
}
开发者ID:dirkdokter,项目名称:pprz-installer-fedora,代码行数:9,代码来源:ints.c


示例14: brlapiml_acceptKeys

CAMLprim value brlapiml_acceptKeys(value handle, value rt, value camlKeys)
{
  CAMLparam3(handle, rt, camlKeys);
  unsigned int i, size = Wosize_val(camlKeys);
  brlapi_keyCode_t keys[size];
  for (i=0; i<size; i++) keys[i] = Int64_val(Field(camlKeys, i)); 
  brlapiCheckError(acceptKeys, Int_val(rt), keys, size);
  CAMLreturn(Val_unit);
}
开发者ID:Feechka,项目名称:UOBP,代码行数:9,代码来源:brlapi_stubs.c


示例15: ocaml_gstreamer_buffer_set_presentation_time

CAMLprim value ocaml_gstreamer_buffer_set_presentation_time(value _buf, value _t)
{
  CAMLparam2(_buf, _t);
  GstBuffer *b = Buffer_val(_buf);
  GstClockTime t = Int64_val(_t);

  b->pts = t;

  CAMLreturn(Val_unit);
}
开发者ID:gndl,项目名称:ocaml-gstreamer,代码行数:10,代码来源:gstreamer_stubs.c


示例16: mld_ftruncate_64

value mld_ftruncate_64(value fd_v, value len_v, value sparse)
{
  OFF_T len = Int64_val(len_v);
  OS_FD fd = Fd_val(fd_v);  
	 int use_sparse = Bool_val(sparse);

  os_ftruncate(fd, len, use_sparse);
    
  return Val_unit;
}
开发者ID:LuoZijun,项目名称:mldonkey,代码行数:10,代码来源:stubs_c.c


示例17: ocaml_gstreamer_buffer_set_duration

CAMLprim value ocaml_gstreamer_buffer_set_duration(value _buf, value _t)
{
  CAMLparam2(_buf, _t);
  GstBuffer *b = Buffer_val(_buf);
  GstClockTime t = Int64_val(_t);

  b->duration = t;

  CAMLreturn(Val_unit);
}
开发者ID:gndl,项目名称:ocaml-gstreamer,代码行数:10,代码来源:gstreamer_stubs.c


示例18: caml_ba_set_aux

static value caml_ba_set_aux(value vb, value * vind, intnat nind, value newval)
{
  struct caml_ba_array * b = Caml_ba_array_val(vb);
  intnat index[CAML_BA_MAX_NUM_DIMS];
  int i;
  intnat offset;

  /* Check number of indices = number of dimensions of array
     (maybe not necessary if ML typing guarantees this) */
  if (nind != b->num_dims)
    caml_invalid_argument("Bigarray.set: wrong number of indices");
  /* Compute offset and check bounds */
  for (i = 0; i < b->num_dims; i++) index[i] = Long_val(vind[i]);
  offset = caml_ba_offset(b, index);
  /* Perform write */
  switch (b->flags & CAML_BA_KIND_MASK) {
  default:
    Assert(0);
#ifdef _KERNEL
#else
  case CAML_BA_FLOAT32:
    ((float *) b->data)[offset] = Double_val(newval); break;
  case CAML_BA_FLOAT64:
    ((double *) b->data)[offset] = Double_val(newval); break;
#endif
  case CAML_BA_SINT8:
  case CAML_BA_UINT8:
    ((int8 *) b->data)[offset] = Int_val(newval); break;
  case CAML_BA_SINT16:
  case CAML_BA_UINT16:
    ((int16 *) b->data)[offset] = Int_val(newval); break;
  case CAML_BA_INT32:
    ((int32 *) b->data)[offset] = Int32_val(newval); break;
  case CAML_BA_INT64:
    ((int64 *) b->data)[offset] = Int64_val(newval); break;
  case CAML_BA_NATIVE_INT:
    ((intnat *) b->data)[offset] = Nativeint_val(newval); break;
  case CAML_BA_CAML_INT:
    ((intnat *) b->data)[offset] = Long_val(newval); break;
#ifdef _KERNEL
#else
  case CAML_BA_COMPLEX32:
    { float * p = ((float *) b->data) + offset * 2;
      p[0] = Double_field(newval, 0);
      p[1] = Double_field(newval, 1);
      break; }
  case CAML_BA_COMPLEX64:
    { double * p = ((double *) b->data) + offset * 2;
      p[0] = Double_field(newval, 0);
      p[1] = Double_field(newval, 1);
      break; }
#endif
  }
  return Val_unit;
}
开发者ID:avsm,项目名称:mirage-kfreebsd,代码行数:55,代码来源:bigarray_stubs.c


示例19: bap_disasm_set_memory_stub

/* noalloc */
value bap_disasm_set_memory_stub(value d,
                                 value base,
                                 value data,
                                 value off,
                                 value len) {
    bap_disasm_set_memory(Int_val(d),
                          Int64_val(base),
                          (const char *)Caml_ba_data_val(data),
                          Int_val(off),
                          Int_val(len));
    return Val_unit;
}
开发者ID:BinaryAnalysisPlatform,项目名称:bap,代码行数:13,代码来源:disasm_stubs.c


示例20: caml_poll

CAMLprim value
caml_poll(value v_until)
{
    CAMLparam1(v_until);
    CAMLlocal1(work_to_do);

    uint64_t until = (Int64_val(v_until));
    int rc = solo5_poll(until);

    work_to_do = Val_bool(rc);
    CAMLreturn(work_to_do);
}
开发者ID:hannesm,项目名称:mirage-solo5,代码行数:12,代码来源:main.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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