本文整理汇总了C++中register_type函数的典型用法代码示例。如果您正苦于以下问题:C++ register_type函数的具体用法?C++ register_type怎么用?C++ register_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了register_type函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CUT_MODULE_IMPL_INIT
G_MODULE_EXPORT GList *
CUT_MODULE_IMPL_INIT (GTypeModule *type_module)
{
GList *registered_types = NULL;
register_type(type_module);
if (cut_type_console_ui_factory)
registered_types =
g_list_prepend(registered_types,
(gchar *)g_type_name(cut_type_console_ui_factory));
return registered_types;
}
开发者ID:andrewdavis12,项目名称:cutter,代码行数:13,代码来源:cut-console-ui-factory.c
示例2: CUT_MODULE_IMPL_INIT
G_MODULE_EXPORT GList *
CUT_MODULE_IMPL_INIT (GTypeModule *type_module)
{
GList *registered_types = NULL;
register_type(type_module);
if (CUT_TYPE_PDF_REPORT)
registered_types =
g_list_prepend(registered_types,
(gchar *)g_type_name(CUT_TYPE_PDF_REPORT));
return registered_types;
}
开发者ID:andrewdavis12,项目名称:cutter,代码行数:13,代码来源:cut-pdf-report.c
示例3: get_register
/* Output one register's contents in the desired format. */
static int
get_register (int regnum, int format)
{
gdb_byte buffer[MAX_REGISTER_SIZE];
int optim;
int realnum;
CORE_ADDR addr;
enum lval_type lval;
static struct ui_stream *stb = NULL;
stb = ui_out_stream_new (uiout);
if (format == 'N')
format = 0;
frame_register (get_selected_frame (NULL), regnum, &optim, &lval, &addr,
&realnum, buffer);
if (optim)
{
mi_error_message = xstrprintf ("Optimized out");
return -1;
}
if (format == 'r')
{
int j;
char *ptr, buf[1024];
strcpy (buf, "0x");
ptr = buf + 2;
for (j = 0; j < register_size (current_gdbarch, regnum); j++)
{
int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
: register_size (current_gdbarch, regnum) - 1 - j;
sprintf (ptr, "%02x", (unsigned char) buffer[idx]);
ptr += 2;
}
ui_out_field_string (uiout, "value", buf);
/*fputs_filtered (buf, gdb_stdout); */
}
else
{
val_print (register_type (current_gdbarch, regnum), buffer, 0, 0,
stb->stream, format, 1, 0, Val_pretty_default);
ui_out_field_stream (uiout, "value", stb);
ui_out_stream_delete (stb);
}
return 1;
}
开发者ID:debrouxl,项目名称:tiemu,代码行数:51,代码来源:mi-main.c
示例4: CUT_MODULE_IMPL_INIT
G_MODULE_EXPORT GList *
CUT_MODULE_IMPL_INIT (GTypeModule *type_module)
{
GList *registered_types = NULL;
register_type(type_module);
if (cut_type_cpp_integration_loader_customizer_factory) {
registered_types =
g_list_prepend(registered_types,
(gchar *)g_type_name(cut_type_cpp_integration_loader_customizer_factory));
}
return registered_types;
}
开发者ID:bynnchapu,项目名称:cutter,代码行数:14,代码来源:cut-cpp-integration-loader-customizer-factory.c
示例5: qpyqml_register_singleton_type
// Register a singleton Python type.
int qpyqml_register_singleton_type(PyTypeObject *py_type, const char *uri,
int major, int minor, const char *type_name, PyObject *factory)
{
// Initialise the registration data structure.
QQmlPrivate::RegisterSingletonType *rt = init_type(py_type, factory);
if (!rt)
return -1;
rt->uri = uri;
rt->versionMajor = major;
rt->versionMinor = minor;
rt->typeName = type_name;
return register_type(rt);
}
开发者ID:njsfzj,项目名称:pyqt5,代码行数:17,代码来源:qpyqml_register_singleton_type.cpp
示例6: register_type
/**
* \brief Initializes the item features provided to Lua.
*/
void LuaContext::register_item_module() {
static const luaL_Reg methods[] = {
{ "get_name", item_api_get_name },
{ "get_game", item_api_get_game },
{ "get_map", item_api_get_map },
{ "get_savegame_variable", item_api_get_savegame_variable },
{ "set_savegame_variable", item_api_set_savegame_variable },
{ "get_amount_savegame_variable", item_api_get_amount_savegame_variable },
{ "set_amount_savegame_variable", item_api_set_amount_savegame_variable },
{ "is_obtainable", item_api_is_obtainable },
{ "set_obtainable", item_api_set_obtainable },
{ "is_assignable", item_api_is_assignable },
{ "set_assignable", item_api_set_assignable },
{ "get_can_disappear", item_api_get_can_disappear },
{ "set_can_disappear", item_api_set_can_disappear },
{ "get_brandish_when_picked", item_api_get_brandish_when_picked },
{ "set_brandish_when_picked", item_api_set_brandish_when_picked },
{ "get_shadow", item_api_get_shadow },
{ "set_shadow", item_api_set_shadow },
{ "get_sound_when_picked", item_api_get_sound_when_picked },
{ "set_sound_when_picked", item_api_set_sound_when_picked },
{ "get_sound_when_brandished", item_api_get_sound_when_brandished },
{ "set_sound_when_brandished", item_api_set_sound_when_brandished },
{ "has_variant", item_api_has_variant },
{ "get_variant", item_api_get_variant },
{ "set_variant", item_api_set_variant },
{ "has_amount", item_api_has_amount },
{ "get_amount", item_api_get_amount },
{ "set_amount", item_api_set_amount },
{ "add_amount", item_api_add_amount },
{ "remove_amount", item_api_remove_amount },
{ "get_max_amount", item_api_get_max_amount },
{ "set_max_amount", item_api_set_max_amount },
{ "set_finished", item_api_set_finished },
{ NULL, NULL }
};
static const luaL_Reg metamethods[] = {
{ "__gc", userdata_meta_gc },
{ "__newindex", userdata_meta_newindex_as_table },
{ "__index", userdata_meta_index_as_table },
{ NULL, NULL }
};
register_type(item_module_name, NULL, methods, metamethods);
}
开发者ID:Umigatsu,项目名称:solarus,代码行数:50,代码来源:ItemApi.cpp
示例7: ss_is_pointer
inline void
basic_iarchive_impl::load_object(
basic_iarchive & ar,
void * t,
const basic_iserializer & bis
){
m_moveable_objects.is_pointer = false;
serialization::state_saver<bool> ss_is_pointer(m_moveable_objects.is_pointer);
// if its been serialized through a pointer and the preamble's been done
if(t == m_pending.object && & bis == m_pending.bis){
// read data
(bis.load_object_data)(ar, t, m_pending.version);
return;
}
const class_id_type cid = register_type(bis);
const int i = cid;
cobject_id & co = cobject_id_vector[i];
load_preamble(ar, co);
// save the current move stack position in case we want to truncate it
boost::serialization::state_saver<object_id_type> ss_start(m_moveable_objects.start);
// note: extra line used to evade borland issue
const bool tracking = co.tracking_level;
object_id_type this_id;
m_moveable_objects.start =
this_id = object_id_type(object_id_vector.size());
// if we tracked this object when the archive was saved
if(tracking){
// if it was already read
if(!track(ar, t))
// we're done
return;
// add a new enty into the tracking list
object_id_vector.push_back(aobject(t, cid));
// and add an entry for this object
m_moveable_objects.end = object_id_type(object_id_vector.size());
}
// read data
(bis.load_object_data)(ar, t, co.file_version);
m_moveable_objects.recent = this_id;
}
开发者ID:HIT-SCIR,项目名称:pyltp,代码行数:46,代码来源:basic_iarchive.cpp
示例8: register_type
/**
* \brief Initializes the text surface features provided to Lua.
*/
void LuaContext::register_text_surface_module() {
// Functions of sol.surface.
static const luaL_Reg functions[] = {
{ "create", text_surface_api_create },
{ nullptr, nullptr },
};
// Methods of the text_surface type.
static const luaL_Reg methods[] = {
{ "get_horizontal_alignment", text_surface_api_get_horizontal_alignment },
{ "set_horizontal_alignment", text_surface_api_set_horizontal_alignment },
{ "get_vertical_alignment", text_surface_api_get_vertical_alignment },
{ "set_vertical_alignment", text_surface_api_set_vertical_alignment },
{ "get_font", text_surface_api_get_font },
{ "set_font", text_surface_api_set_font },
{ "get_rendering_mode", text_surface_api_get_rendering_mode },
{ "set_rendering_mode", text_surface_api_set_rendering_mode },
{ "get_color", text_surface_api_get_color },
{ "set_color", text_surface_api_set_color },
{ "get_font_size", text_surface_api_get_font_size },
{ "set_font_size", text_surface_api_set_font_size },
{ "get_text", text_surface_api_get_text },
{ "set_text", text_surface_api_set_text },
{ "set_text_key", text_surface_api_set_text_key },
{ "get_size", text_surface_api_get_size },
{ "draw", drawable_api_draw },
{ "draw_region", drawable_api_draw_region },
{ "get_blend_mode", drawable_api_get_blend_mode },
{ "set_blend_mode", drawable_api_set_blend_mode },
{ "fade_in", drawable_api_fade_in },
{ "fade_out", drawable_api_fade_out },
{ "get_xy", drawable_api_get_xy },
{ "set_xy", drawable_api_set_xy },
{ "get_movement", drawable_api_get_movement },
{ "stop_movement", drawable_api_stop_movement },
{ nullptr, nullptr }
};
static const luaL_Reg metamethods[] = {
{ "__gc", drawable_meta_gc },
{ nullptr, nullptr }
};
register_type(text_surface_module_name, functions, methods, metamethods);
}
开发者ID:christopho,项目名称:solarus,代码行数:49,代码来源:TextSurfaceApi.cpp
示例9: register_alias_types_from_declarator_list
void register_alias_types_from_declarator_list(DeclaratorList * l)
{
DeclaratorList *i;
for (i = l; i != NULL; i = i->next) {
Type *base = l->type;
Type *final;
if (l->nsizes)
final =
(Type *) create_array_type(base, l->nsizes,
l->array_sizes);
else
final = base;
AliasType *alias = create_alias_type(l->name, final);
register_type((Type *) alias);
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:18,代码来源:idlparser_support.c
示例10: lbind_newmetatable
LB_API int lbind_newmetatable(lua_State *L, luaL_Reg *libs, const lbind_Type *t) {
if (type_exists(L, t)) return 0;
lua_createtable(L, 0, 8);
if (libs != NULL)
luaL_setfuncs(L, libs, 0);
/* init type metatable */
lua_pushlightuserdata(L, (void*)t);
lua_setfield(L, -2, "__type");
if (!lbind_hasfield(L, -1, "__gc")) {
lua_pushcfunction(L, Lgc);
lua_setfield(L, -2, "__gc");
}
if (!lbind_hasfield(L, -1, "__tostring")) {
lua_pushcfunction(L, Ltostring);
lua_setfield(L, -2, "__tostring");
}
if (t->bases != NULL && t->bases[0] != NULL) {
int nups = 0;
int freeslots = 0;
lbind_Type **bases = t->bases;
for (; *bases != NULL; ++nups, ++bases) {
if (nups > freeslots) {
luaL_checkstack(L, 10, "no space for base types");
freeslots += 10;
}
if (!lbind_getmetatable(L, *bases))
lua_pushlightuserdata(L, *bases);
}
lbind_setindexf(L, nups);
}
else if (!lbind_hasfield(L, -1, "__index")) {
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
}
register_type(L, t->name, (const void*)t);
return 1;
}
开发者ID:ifzz,项目名称:nui,代码行数:44,代码来源:lbind.c
示例11: m68k_svr4_extract_return_value
static void
m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache,
gdb_byte *valbuf)
{
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (tdep->float_return && TYPE_CODE (type) == TYPE_CODE_FLT)
{
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
regcache_raw_read (regcache, M68K_FP0_REGNUM, buf);
convert_typed_floating (buf, fpreg_type, valbuf, type);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf);
else
m68k_extract_return_value (type, regcache, valbuf);
}
开发者ID:ChrisG0x20,项目名称:gdb,代码行数:19,代码来源:m68k-tdep.c
示例12: register_type
/**
* \brief Initializes the sprite features provided to Lua.
*/
void LuaContext::register_sprite_module() {
static const luaL_Reg functions[] = {
{ "create", sprite_api_create },
{ nullptr, nullptr }
};
static const luaL_Reg methods[] = {
{ "get_animation_set", sprite_api_get_animation_set },
{ "get_animation", sprite_api_get_animation },
{ "set_animation", sprite_api_set_animation },
{ "has_animation", sprite_api_has_animation },
{ "get_direction", sprite_api_get_direction },
{ "set_direction", sprite_api_set_direction },
{ "get_num_directions", sprite_api_get_num_directions },
{ "get_frame", sprite_api_get_frame },
{ "set_frame", sprite_api_set_frame },
{ "get_frame_delay", sprite_api_get_frame_delay },
{ "set_frame_delay", sprite_api_set_frame_delay },
{ "is_paused", sprite_api_is_paused },
{ "set_paused", sprite_api_set_paused },
{ "set_ignore_suspend", sprite_api_set_ignore_suspend },
{ "synchronize", sprite_api_synchronize },
{ "draw", drawable_api_draw },
{ "draw_region", drawable_api_draw_region },
{ "fade_in", drawable_api_fade_in },
{ "fade_out", drawable_api_fade_out },
{ "get_xy", drawable_api_get_xy },
{ "set_xy", drawable_api_set_xy },
{ "get_movement", drawable_api_get_movement },
{ "stop_movement", drawable_api_stop_movement },
{ nullptr, nullptr }
};
static const luaL_Reg metamethods[] = {
{ "__gc", drawable_meta_gc },
{ "__newindex", userdata_meta_newindex_as_table },
{ "__index", userdata_meta_index_as_table },
{ nullptr, nullptr }
};
register_type(sprite_module_name, functions, methods, metamethods);
}
开发者ID:akimi634,项目名称:solarus,代码行数:45,代码来源:SpriteApi.cpp
示例13: m68k_value_to_register
static void
m68k_value_to_register (struct frame_info *frame, int regnum,
struct type *type, const gdb_byte *from)
{
gdb_byte to[M68K_MAX_REGISTER_SIZE];
struct type *fpreg_type = register_type (get_frame_arch (frame),
M68K_FP0_REGNUM);
/* We only support floating-point values. */
if (TYPE_CODE (type) != TYPE_CODE_FLT)
{
warning (_("Cannot convert non-floating-point type "
"to floating-point register value."));
return;
}
/* Convert from TYPE. */
convert_typed_floating (from, type, to, fpreg_type);
put_frame_register (frame, regnum, to);
}
开发者ID:ChrisG0x20,项目名称:gdb,代码行数:20,代码来源:m68k-tdep.c
示例14: m68k_value_to_register
static void
m68k_value_to_register (struct frame_info *frame, int regnum,
struct type *type, const gdb_byte *from)
{
gdb_byte to[M68K_MAX_REGISTER_SIZE];
struct type *fpreg_type = register_type (current_gdbarch, M68K_FP0_REGNUM);
/* We only support floating-point values. */
if (TYPE_CODE (type) != TYPE_CODE_FLT)
{
warning (_("Cannot convert non-floating-point type "
"to floating-point register value."));
return;
}
/* Convert from TYPE. This should be a no-op if TYPE is equivalent
to the extended floating-point format used by the FPU. */
convert_typed_floating (from, type, to, fpreg_type);
put_frame_register (frame, regnum, to);
}
开发者ID:gygy,项目名称:asuswrt,代码行数:20,代码来源:m68k-tdep.c
示例15: m68k_register_to_value
static int
m68k_register_to_value (struct frame_info *frame, int regnum,
struct type *type, gdb_byte *to,
int *optimizedp, int *unavailablep)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte from[M68K_MAX_REGISTER_SIZE];
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
/* Convert to TYPE. */
if (!get_frame_register_bytes (frame, regnum, 0,
register_size (gdbarch, regnum),
from, optimizedp, unavailablep))
return 0;
target_float_convert (from, fpreg_type, to, type);
*optimizedp = *unavailablep = 0;
return 1;
}
开发者ID:sifive,项目名称:riscv-binutils-gdb,代码行数:21,代码来源:m68k-tdep.c
示例16: m68k_svr4_store_return_value
static void
m68k_svr4_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
struct gdbarch *gdbarch = regcache->arch ();
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (tdep->float_return && TYPE_CODE (type) == TYPE_CODE_FLT)
{
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
target_float_convert (valbuf, type, buf, fpreg_type);
regcache_raw_write (regcache, M68K_FP0_REGNUM, buf);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
{
regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf);
regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf);
}
else
m68k_store_return_value (type, regcache, valbuf);
}
开发者ID:sifive,项目名称:riscv-binutils-gdb,代码行数:22,代码来源:m68k-tdep.c
示例17: register_type
/**
* \brief Initializes the surface features provided to Lua.
*/
void LuaContext::register_surface_module() {
static const luaL_Reg methods[] = {
{ "create", surface_api_create },
{ "get_size", surface_api_get_size },
{ "fill_color", surface_api_fill_color },
{ "set_opacity", surface_api_set_opacity },
{ "draw", drawable_api_draw },
{ "draw_region", drawable_api_draw_region },
{ "fade_in", drawable_api_fade_in },
{ "fade_out", drawable_api_fade_out },
{ "get_xy", drawable_api_get_xy },
{ "set_xy", drawable_api_set_xy },
{ "get_movement", drawable_api_get_movement },
{ "stop_movement", drawable_api_stop_movement },
{ NULL, NULL }
};
static const luaL_Reg metamethods[] = {
{ "__gc", drawable_meta_gc },
{ NULL, NULL }
};
register_type(surface_module_name, methods, metamethods);
}
开发者ID:abenavente406,项目名称:solarus,代码行数:26,代码来源:SurfaceAPI.cpp
示例18: rs6000_lynx178_push_dummy_call
static CORE_ADDR
rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int ii;
int len = 0;
int argno; /* current argument number */
int argbytes; /* current argument byte */
gdb_byte tmp_buffer[50];
int f_argno = 0; /* current floating point argno */
int wordsize = gdbarch_tdep (gdbarch)->wordsize;
CORE_ADDR func_addr = find_function_addr (function, NULL);
struct value *arg = 0;
struct type *type;
ULONGEST saved_sp;
/* The calling convention this function implements assumes the
processor has floating-point registers. We shouldn't be using it
on PPC variants that lack them. */
gdb_assert (ppc_floating_point_unit_p (gdbarch));
/* The first eight words of ther arguments are passed in registers.
Copy them appropriately. */
ii = 0;
/* If the function is returning a `struct', then the first word
(which will be passed in r3) is used for struct return address.
In that case we should advance one word and start from r4
register to copy parameters. */
if (struct_return)
{
regcache_raw_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
struct_addr);
ii++;
}
/* Effectively indirect call... gcc does...
return_val example( float, int);
eabi:
float in fp0, int in r3
offset of stack on overflow 8/16
for varargs, must go by type.
power open:
float in r3&r4, int in r5
offset of stack on overflow different
both:
return in r3 or f0. If no float, must study how gcc emulates floats;
pay attention to arg promotion.
User may have to cast\args to handle promotion correctly
since gdb won't know if prototype supplied or not. */
for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
{
int reg_size = register_size (gdbarch, ii + 3);
arg = args[argno];
type = check_typedef (value_type (arg));
len = TYPE_LENGTH (type);
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
/* Floating point arguments are passed in fpr's, as well as gpr's.
There are 13 fpr's reserved for passing parameters. At this point
there is no way we would run out of them.
Always store the floating point value using the register's
floating-point format. */
const int fp_regnum = tdep->ppc_fp0_regnum + 1 + f_argno;
gdb_byte reg_val[MAX_REGISTER_SIZE];
struct type *reg_type = register_type (gdbarch, fp_regnum);
gdb_assert (len <= 8);
convert_typed_floating (value_contents (arg), type,
reg_val, reg_type);
regcache_cooked_write (regcache, fp_regnum, reg_val);
++f_argno;
}
if (len > reg_size)
{
/* Argument takes more than one register. */
while (argbytes < len)
{
gdb_byte word[MAX_REGISTER_SIZE];
memset (word, 0, reg_size);
memcpy (word,
((char *) value_contents (arg)) + argbytes,
(len - argbytes) > reg_size
//.........这里部分代码省略.........
开发者ID:5kg,项目名称:gdb,代码行数:101,代码来源:rs6000-lynx178-tdep.c
示例19: rs6000_lynx178_return_value
static enum return_value_convention
rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *valtype, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* The calling convention this function implements assumes the
processor has floating-point registers. We shouldn't be using it
on PowerPC variants that lack them. */
gdb_assert (ppc_floating_point_unit_p (gdbarch));
/* AltiVec extension: Functions that declare a vector data type as a
return value place that return value in VR2. */
if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)
&& TYPE_LENGTH (valtype) == 16)
{
if (readbuf)
regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
if (writebuf)
regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
/* If the called subprogram returns an aggregate, there exists an
implicit first argument, whose value is the address of a caller-
allocated buffer into which the callee is assumed to store its
return value. All explicit parameters are appropriately
relabeled. */
if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
|| TYPE_CODE (valtype) == TYPE_CODE_UNION
|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
return RETURN_VALUE_STRUCT_CONVENTION;
/* Scalar floating-point values are returned in FPR1 for float or
double, and in FPR1:FPR2 for quadword precision. Fortran
complex*8 and complex*16 are returned in FPR1:FPR2, and
complex*32 is returned in FPR1:FPR4. */
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
&& (TYPE_LENGTH (valtype) == 4 || TYPE_LENGTH (valtype) == 8))
{
struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
gdb_byte regval[8];
/* FIXME: kettenis/2007-01-01: Add support for quadword
precision and complex. */
if (readbuf)
{
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
convert_typed_floating (regval, regtype, readbuf, valtype);
}
if (writebuf)
{
convert_typed_floating (writebuf, valtype, regval, regtype);
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
/* Values of the types int, long, short, pointer, and char (length
is less than or equal to four bytes), as well as bit values of
lengths less than or equal to 32 bits, must be returned right
justified in GPR3 with signed values sign extended and unsigned
values zero extended, as necessary. */
if (TYPE_LENGTH (valtype) <= tdep->wordsize)
{
if (readbuf)
{
ULONGEST regval;
/* For reading we don't have to worry about sign extension. */
regcache_cooked_read_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
®val);
store_unsigned_integer (readbuf, TYPE_LENGTH (valtype), byte_order,
regval);
}
if (writebuf)
{
/* For writing, use unpack_long since that should handle any
required sign extension. */
regcache_cooked_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
unpack_long (valtype, writebuf));
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
/* Eight-byte non-floating-point scalar values must be returned in
GPR3:GPR4. */
if (TYPE_LENGTH (valtype) == 8)
{
gdb_assert (TYPE_CODE (valtype) != TYPE_CODE_FLT);
gdb_assert (tdep->wordsize == 4);
if (readbuf)
//.........这里部分代码省略.........
开发者ID:5kg,项目名称:gdb,代码行数:101,代码来源:rs6000-lynx178-tdep.c
示例20: initialize_types
void initialize_types()
{
static bool initialized = false;
if(initialized)
return;
register_type(typeid(k3d::angle_axis), "k3d::angle_axis");
register_type(typeid(k3d::bitmap), "k3d::bitmap");
register_type(typeid(k3d::bitmap*), "k3d::bitmap*");
register_type(typeid(k3d::bool_t), "k3d::bool_t");
register_type(typeid(k3d::bounding_box3), "k3d::bounding_box3");
register_type(typeid(k3d::color), "k3d::color");
register_type(typeid(k3d::double_t), "k3d::double_t");
register_type(typeid(k3d::filesystem::path), "k3d::filesystem::path");
register_type(typeid(k3d::float_t), "k3d::float_t");
register_type(typeid(k3d::gl::context), "k3d::gl::context");
register_type(typeid(k3d::gl::context_factory), "k3d::gl::context_factory");
register_type(typeid(k3d::gl::offscreen_context), "k3d::gl::offscreen_context");
register_type(typeid(k3d::gl::offscreen_context_factory), "k3d::gl::offscreen_context_factory");
register_type(typeid(k3d::gl::ilight), "k3d::gl::ilight");
register_type(typeid(k3d::gl::imesh_painter), "k3d::gl::imesh_painter");
register_type(typeid(k3d::gl::imesh_painter*), "k3d::gl::imesh_painter*");
register_type(typeid(k3d::half_t), "k3d::half_t");
register_type(typeid(k3d::i3d_2d_mapping), "k3d::i3d_2d_mapping");
register_type(typeid(k3d::ibitmap_exporter), "k3d::ibitmap_exporter");
register_type(typeid(k3d::ibitmap_importer), "k3d::ibitmap_importer");
register_type(typeid(k3d::ibitmap_sink), "k3d::ibitmap_sink");
register_type(typeid(k3d::ibitmap_source), "k3d::ibitmap_source");
register_type(typeid(k3d::icamera), "k3d::icamera");
register_type(typeid(k3d::icolor_source), "k3d::icolor_source");
register_type(typeid(k3d::idocument_exporter), "k3d::idocument_exporter");
register_type(typeid(k3d::idocument_importer), "k3d::idocument_importer");
register_type(typeid(k3d::idouble_source), "k3d::idouble_source");
register_type(typeid(k3d::ievent_loop), "k3d::ievent_loop");
register_type(typeid(k3d::ifile_change_notifier), "k3d::ifile_change_notifier");
register_type(typeid(k3d::iint32_source), "k3d::iint32_source");
register_type(typeid(k3d::ikeyframer), "k3d::ikeyframer");
register_type(typeid(k3d::imaterial), "k3d::imaterial");
register_type(typeid(k3d::imaterial*), "k3d::imaterial*");
register_type(typeid(k3d::imesh_selection_algorithm), "k3d::imesh_selection_algorithm");
register_type(typeid(k3d::imesh_sink), "k3d::imesh_sink");
register_type(typeid(k3d::imesh_source), "k3d::imesh_source");
register_type(typeid(k3d::imesh_storage), "k3d::imesh_storage");
register_type(typeid(k3d::imime_type_handler), "k3d::imime_type_handler");
register_type(typeid(k3d::imulti_mesh_sink), "k3d::imulti_mesh_sink");
register_type(typeid(k3d::inode), "k3d::inode");
register_type(typeid(k3d::inode*), "k3d::inode*");
register_type(typeid(k3d::inode_selection), "k3d::inode_selection");
register_type(typeid(k3d::inode_selection*), "k3d::inode_selection*");
register_type(typeid(k3d::int16_t), "k3d::int16_t");
register_type(typeid(k3d::int32_t), "k3d::int32_t");
register_type(typeid(k3d::int64_t), "k3d::int64_t");
register_type(typeid(k3d::int8_t), "k3d::int8_t");
register_type(typeid(k3d::irender_animation), "k3d::irender_animation");
register_type(typeid(k3d::irender_camera_animation), "k3d::irender_camera_animation");
register_type(typeid(k3d::irender_camera_frame), "k3d::irender_camera_frame");
register_type(typeid(k3d::irender_camera_preview), "k3d::irender_camera_preview");
register_type(typeid(k3d::irender_frame), "k3d::irender_frame");
register_type(typeid(k3d::irender_preview), "k3d::irender_preview");
register_type(typeid(k3d::iscript_engine), "k3d::iscript_engine");
register_type(typeid(k3d::istring_source), "k3d::istring_source");
register_type(typeid(k3d::itexture), "k3d::itexture");
register_type(typeid(k3d::itexture*), "k3d::itexture*");
register_type(typeid(k3d::itime_sink), "k3d::itime_sink");
register_type(typeid(k3d::itransform_array_1d), "k3d::itransform_array_1d");
register_type(typeid(k3d::itransform_array_2d), "k3d::itransform_array_2d");
register_type(typeid(k3d::itransform_array_3d), "k3d::itransform_array_3d");
register_type(typeid(k3d::imatrix_sink), "k3d::imatrix_sink");
register_type(typeid(k3d::imatrix_source), "k3d::imatrix_source");
register_type(typeid(k3d::iunknown), "k3d::iunknown");
register_type(typeid(k3d::iunknown*), "k3d::iunknown*");
register_type(typeid(k3d::iuri_handler), "k3d::iuri_handler");
register_type(typeid(k3d::ivector3_source), "k3d::ivector3_source");
register_type(typeid(k3d::matrix4), "k3d::matrix4");
register_type(typeid(k3d::mesh), "k3d::mesh");
register_type(typeid(k3d::mesh*), "k3d::mesh*");
register_type(typeid(k3d::normal3), "k3d::normal3");
register_type(typeid(k3d::point2), "k3d::point2");
register_type(typeid(k3d::point3), "k3d::point3");
register_type(typeid(k3d::point4), "k3d::point4");
register_type(typeid(k3d::ri::idisplacement_shader), "k3d::ri::idisplacement_shader");
register_type(typeid(k3d::ri::iimager_shader), "k3d::ri::iimager_shader");
register_type(typeid(k3d::ri::ilight), "k3d::ri::ilight");
register_type(typeid(k3d::ri::ilight_shader), "k3d::ri::ilight_shader");
register_type(typeid(k3d::ri::imaterial), "k3d::ri::imaterial");
register_type(typeid(k3d::ri::imesh_painter), "k3d::ri::imesh_painter");
register_type(typeid(k3d::ri::imesh_painter*), "k3d::ri::imesh_painter*");
register_type(typeid(k3d::ri::irender_engine), "k3d::ri::irender_engine");
register_type(typeid(k3d::ri::irender_engine*), "k3d::ri::irender_engine*");
register_type(typeid(k3d::ri::isurface_shader), "k3d::ri::isurface_shader");
register_type(typeid(k3d::ri::itexture), "k3d::ri::itexture");
register_type(typeid(k3d::ri::itexture*), "k3d::ri::itexture*");
register_type(typeid(k3d::ri::ivolume_shader), "k3d::ri::ivolume_shader");
register_type(typeid(k3d::rectangle), "k3d::rectangle");
register_type(typeid(k3d::selection::set), "k3d::selection::set");
register_type(typeid(k3d::string_t), "k3d::string_t");
register_type(typeid(k3d::texture3), "k3d::texture3");
register_type(typeid(k3d::uint16_t), "k3d::uint16_t");
register_type(typeid(k3d::uint32_t), "k3d::uint32_t");
register_type(typeid(k3d::uint64_t), "k3d::uint64_t");
//.........这里部分代码省略.........
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:101,代码来源:type_registry.cpp
注:本文中的register_type函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论