当前位置: 首页>>代码示例>>C++>>正文


C++ CHECK_ARG_COUNT函数代码示例

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


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

示例1: seed_mpfr_nexttoward

SeedValue seed_mpfr_nexttoward (SeedContext ctx,
                                SeedObject function,
                                SeedObject this_object,
                                gsize argument_count,
                                const SeedValue args[],
                                SeedException *exception)
{
    mpfr_ptr rop, op;

    CHECK_ARG_COUNT("mpfr.nexttoward", 1);

    rop = seed_object_get_private(this_object);

    if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) )
    {
        op = seed_object_get_private(args[0]);
    }
    else
    {
        TYPE_EXCEPTION("mpfr.nexttoward", "mpfr_t");
    }

    mpfr_nexttoward(rop, op);

    return seed_make_null(ctx);
}
开发者ID:iRi-E,项目名称:GNOME-Seed,代码行数:26,代码来源:seed-mpfr-arithmetic.c

示例2: seed_mpfr_remainder

SeedValue seed_mpfr_remainder (SeedContext ctx,
                               SeedObject function,
                               SeedObject this_object,
                               gsize argument_count,
                               const SeedValue args[],
                               SeedException *exception)
{
    mpfr_rnd_t rnd;
    mpfr_ptr rop, op1, op2;
    gint ret;

    CHECK_ARG_COUNT("mpfr.remainder", 3);

    rop = seed_object_get_private(this_object);
    rnd = seed_value_to_mpfr_rnd_t(ctx, args[2], exception);

    if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) &&
         seed_value_is_object_of_class(ctx, args[1], mpfr_class))
    {
        op1 = seed_object_get_private(args[0]);
        op2 = seed_object_get_private(args[1]);
    }
    else
    {
        TYPE_EXCEPTION("mpfr.remainder", "mpfr_t");
    }

    ret = mpfr_remainder(rop, op1, op2, rnd);

    return seed_value_from_int(ctx, ret, exception);
}
开发者ID:iRi-E,项目名称:GNOME-Seed,代码行数:31,代码来源:seed-mpfr-arithmetic.c

示例3: py_glIsProgram

static PyObject* py_glIsProgram(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 1);
  Uint prg(PyTuple_GetItem(args, 0));
  PyObject *rv = (glIsProgram(prg) == GL_TRUE ? Py_True : Py_False);
  Py_INCREF(rv);
  return rv;
}
开发者ID:gatgui,项目名称:pygl,代码行数:7,代码来源:gl_2_0.cpp

示例4: seed_mpfr_sub

SeedValue seed_mpfr_sub (SeedContext ctx,
                         SeedObject function,
                         SeedObject this_object,
                         gsize argument_count,
                         const SeedValue args[],
                         SeedException *exception)
{
    mpfr_rnd_t rnd;
    mpfr_ptr rop, op1, op2;
    gdouble dop1, dop2;
    gint ret;
    seed_mpfr_t argt1, argt2;
    /* only want 1 double argument. alternatively, could accept 2,
       add those, and set from the result*/

    CHECK_ARG_COUNT("mpfr.sub", 3);

    rop = seed_object_get_private(this_object);
    rnd = seed_value_to_mpfr_rnd_t(ctx, args[2], exception);

    argt1 = seed_mpfr_arg_type(ctx, args[0], exception);
    argt2 = seed_mpfr_arg_type(ctx, args[1], exception);

    if ( (argt1 & argt2) == SEED_MPFR_MPFR )
    {
        /* both mpfr_t */
        op1 = seed_object_get_private(args[0]);
        op2 = seed_object_get_private(args[1]);
        ret = mpfr_sub(rop, op1, op2, rnd);
    }
    else if ( (argt1 | argt2) == (SEED_MPFR_MPFR | SEED_MPFR_DOUBLE) )
    {
        /* a double and an mpfr_t. Figure out the order */
        if ( argt1 == SEED_MPFR_MPFR )
        {
            op1 = seed_object_get_private(args[0]);
            dop2 = seed_value_to_double(ctx, args[1], exception);
            mpfr_sub_d(rop, op1, dop2, rnd);
        }
        else
        {
            dop1 = seed_value_to_double(ctx, args[0], exception);
            op2 = seed_object_get_private(args[1]);
            mpfr_d_sub(rop, dop1, op2, rnd);
        }
    }
    else if ( (argt1 & argt2) == SEED_MPFR_DOUBLE )
    {
        /* 2 doubles. hopefully doesn't happen */
        dop1 = seed_value_to_double(ctx, args[0], exception);
        dop2 = seed_value_to_double(ctx, args[1], exception);
        ret = mpfr_set_d(rop, dop1 - dop2, rnd);
    }
    else
    {
        TYPE_EXCEPTION("mpfr.sub", "double or mpfr_t");
    }

    return seed_value_from_int(ctx, ret, exception);
}
开发者ID:iRi-E,项目名称:GNOME-Seed,代码行数:60,代码来源:seed-mpfr-arithmetic.c

示例5: seed_mpfr_cmpabs

SeedValue seed_mpfr_cmpabs (SeedContext ctx,
                            SeedObject function,
                            SeedObject this_object,
                            gsize argument_count,
                            const SeedValue args[],
                            SeedException *exception)
{
    mpfr_ptr rop, op;
    gint ret;

    CHECK_ARG_COUNT("mpfr.cmpabs", 1);

    rop = seed_object_get_private(this_object);

    if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) )
    {
        op = seed_object_get_private(args[0]);
    }
    else
    {
        TYPE_EXCEPTION("mpfr.cmpabs", "mpfr_t");
    }

    ret = mpfr_cmpabs(rop, op);

    return seed_value_from_int(ctx, ret, exception);
}
开发者ID:iRi-E,项目名称:GNOME-Seed,代码行数:27,代码来源:seed-mpfr-cmp.c

示例6: py_glGetVertexAttrib

static PyObject* py_glGetVertexAttrib(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 2);
  PyObject *rv = 0;
  Uint attrib(PyTuple_GetItem(args, 0));
  Enum pname(PyTuple_GetItem(args, 1));
  switch (pname) {
    case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
    case GL_VERTEX_ATTRIB_ARRAY_ENABLED:
    case GL_VERTEX_ATTRIB_ARRAY_SIZE:
    case GL_VERTEX_ATTRIB_ARRAY_STRIDE:
    case GL_VERTEX_ATTRIB_ARRAY_TYPE:
    case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: {
      GLint value;
      glGetVertexAttribiv(attrib, pname, &value);
      rv = PyInt_FromLong(value);
      break;
    }
    case GL_CURRENT_VERTEX_ATTRIB: {
      Array1D<Float> values(4);
      glGetVertexAttribfv(attrib, pname, values);
      rv = values.toPy();
      break;
    }
    default:
      PyErr_SetString(PyExc_RuntimeError, "gl.GetVertexAttrib: invalid parameter name");
  }
  return rv;
}
开发者ID:gatgui,项目名称:pygl,代码行数:28,代码来源:gl_2_0.cpp

示例7: seed_gettext_dcngettext

static SeedValue
seed_gettext_dcngettext (SeedContext ctx,
                         SeedObject function,
                         SeedObject this_object,
                         gsize argument_count,
                         const SeedValue args[],
                         SeedException * exception)
{
	gchar * domainname, * msgid, * msgid_plural;
	guint n;
	gint category;
	SeedValue ret;

	CHECK_ARG_COUNT("gettext.dcngettext", 5);

	domainname = seed_value_to_string (ctx, args[0], exception);
	msgid = seed_value_to_string (ctx, args[1], exception);
	msgid_plural = seed_value_to_string (ctx, args[2], exception);
	n = seed_value_to_uint (ctx, args[3], exception);
	category = seed_value_to_int (ctx, args[4], exception);

	ret = seed_value_from_string (ctx,
	                              dcngettext(domainname, msgid, msgid_plural, n, category),
	                              exception);
	g_free(domainname);
	g_free(msgid);
	g_free(msgid_plural);

	return ret;
}
开发者ID:iRi-E,项目名称:GNOME-Seed,代码行数:30,代码来源:seed-gettext.c

示例8: py_glIsShader

static PyObject* py_glIsShader(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 1);
  Uint shader(PyTuple_GetItem(args, 0));
  PyObject *rv = (glIsShader(shader) == GL_TRUE ? Py_True : Py_False);
  Py_INCREF(rv);
  return rv;
}
开发者ID:gatgui,项目名称:pygl,代码行数:7,代码来源:gl_2_0.cpp

示例9: seed_gtk_builder_connect_signals

SeedValue
seed_gtk_builder_connect_signals(SeedContext ctx,
				 SeedObject function,
				 SeedObject this_object,
				 gsize argument_count,
				 const SeedValue arguments[],
				 SeedException *exception)
{
  builder_ud ud;
  GtkBuilder *b;
  
  CHECK_ARG_COUNT("GtkBuilder.connect_signals", 1);

  if (!seed_value_is_object (ctx, arguments[0]))
    {
      seed_make_exception (ctx, exception, "TypeError",
			   "connect_signals expects one object as the first argument");
      return seed_make_undefined (ctx);
    }

  b = GTK_BUILDER (seed_value_to_object (ctx, this_object, exception));
  ud.ctx = ctx;
  ud.obj = arguments[0];
  if (argument_count == 2)
    ud.user_data = arguments[1];
  else
    ud.user_data = NULL;
  gtk_builder_connect_signals_full(b, seed_builder_connect_func, &ud);

  return seed_make_undefined (ctx);
}
开发者ID:dannote,项目名称:seed,代码行数:31,代码来源:seed-gtkbuilder.c

示例10: py_glDrawBuffers

static PyObject* py_glDrawBuffers(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 1);
  Array1D<Enum> buffers;
  if (buffers.fromPy(PyTuple_GetItem(args, 0))) {
    glDrawBuffers(buffers.size(), buffers);
  }
  Py_RETURN_NONE;
}
开发者ID:gatgui,项目名称:pygl,代码行数:8,代码来源:gl_2_0.cpp

示例11: py_glGetVertexAttribPointer

static PyObject* py_glGetVertexAttribPointer(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 2);
  Uint prg(PyTuple_GetItem(args, 0));
  Enum param(PyTuple_GetItem(args, 1));
  GLvoid *ptr = 0;
  glGetVertexAttribPointerv(prg, param, &ptr);
  return PyCObject_FromVoidPtr(ptr, NULL);
}
开发者ID:gatgui,项目名称:pygl,代码行数:8,代码来源:gl_2_0.cpp

示例12: py_glShaderSource

static PyObject* py_glShaderSource(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 2);
  Uint shader(PyTuple_GetItem(args, 0));
  Array1D<String> strings;
  if (strings.fromPy(PyTuple_GetItem(args, 1))) {
    glShaderSource(shader, strings.size(), strings, 0);
  }
  Py_RETURN_NONE;
}
开发者ID:gatgui,项目名称:pygl,代码行数:9,代码来源:gl_2_0.cpp

示例13: lua_glLoadTransposeMatrixf

static int lua_glLoadTransposeMatrixf(lua_State *L) {
  CHECK_ARG_COUNT(L, 1);
  Array1D<Float> m(L, 1);
  if (m.size() != 16) {
    luaL_error(L, "gl.LoadTransposeMatrixf: invalid matrix data");
  }
  glLoadTransposeMatrixf(m);
  return 0;
}
开发者ID:humbletim,项目名称:luagl,代码行数:9,代码来源:gl_1_3.cpp

示例14: lua_glMultTransposeMatrixd

static int lua_glMultTransposeMatrixd(lua_State *L) {
  CHECK_ARG_COUNT(L, 1);
  Array1D<Double> m(L, 1);
  if (m.size() != 16) {
    luaL_error(L, "gl.MultTransposeMatrixd: invalid matrix data");
  }
  glMultTransposeMatrixd(m);
  return 0;
}
开发者ID:humbletim,项目名称:luagl,代码行数:9,代码来源:gl_1_3.cpp

示例15: py_glGetShaderSource

static PyObject* py_glGetShaderSource(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 1);
  Uint shader(PyTuple_GetItem(args, 0));
  GLint len=0;
  glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &len);
  //GLchar *src = new GLchar[len+1];
  Array1D<Char> src(len+1);
  glGetShaderSource(shader, len, NULL, src);
  return PyString_FromString(src);
  //delete[] src;
}
开发者ID:gatgui,项目名称:pygl,代码行数:11,代码来源:gl_2_0.cpp


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