projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename: type_class, type -> type, declaration
[babeltrace.git]
/
formats
/
ctf
/
types
/
integer.c
diff --git
a/formats/ctf/types/integer.c
b/formats/ctf/types/integer.c
index 127b8062bf6901240ad3c38d9f6082cae2cbdb71..66e2a321eaf4bf6b12cbc37f3d5a1d091b3d8f27 100644
(file)
--- a/
formats/ctf/types/integer.c
+++ b/
formats/ctf/types/integer.c
@@
-24,19
+24,19
@@
static
uint64_t _aligned_uint_read(struct stream_pos *pos,
static
uint64_t _aligned_uint_read(struct stream_pos *pos,
- const struct type_
class_integer *int_class
)
+ const struct type_
integer *integer_type
)
{
{
- int rbo = (int
_class->byte_order != BYTE_ORDER);
/* reverse byte order */
+ int rbo = (int
eger_type->byte_order != BYTE_ORDER);
/* reverse byte order */
- align_pos(pos, int
_class
->p.alignment);
+ align_pos(pos, int
eger_type
->p.alignment);
assert(!(pos->offset % CHAR_BIT));
assert(!(pos->offset % CHAR_BIT));
- switch (int
_class
->len) {
+ switch (int
eger_type
->len) {
case 8:
{
uint8_t v;
v = *(const uint8_t *)pos->base;
case 8:
{
uint8_t v;
v = *(const uint8_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return v;
}
case 16:
return v;
}
case 16:
@@
-44,7
+44,7
@@
uint64_t _aligned_uint_read(struct stream_pos *pos,
uint16_t v;
v = *(const uint16_t *)pos->base;
uint16_t v;
v = *(const uint16_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return rbo ? GUINT16_SWAP_LE_BE(v) : v;
}
case 32:
return rbo ? GUINT16_SWAP_LE_BE(v) : v;
}
case 32:
@@
-52,7
+52,7
@@
uint64_t _aligned_uint_read(struct stream_pos *pos,
uint32_t v;
v = *(const uint32_t *)pos->base;
uint32_t v;
v = *(const uint32_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return rbo ? GUINT32_SWAP_LE_BE(v) : v;
}
case 64:
return rbo ? GUINT32_SWAP_LE_BE(v) : v;
}
case 64:
@@
-60,7
+60,7
@@
uint64_t _aligned_uint_read(struct stream_pos *pos,
uint64_t v;
v = *(const uint64_t *)pos->base;
uint64_t v;
v = *(const uint64_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return rbo ? GUINT64_SWAP_LE_BE(v) : v;
}
default:
return rbo ? GUINT64_SWAP_LE_BE(v) : v;
}
default:
@@
-70,19
+70,19
@@
uint64_t _aligned_uint_read(struct stream_pos *pos,
static
int64_t _aligned_int_read(struct stream_pos *pos,
static
int64_t _aligned_int_read(struct stream_pos *pos,
- const struct type_
class_integer *int_class
)
+ const struct type_
integer *integer_type
)
{
{
- int rbo = (int
_class->byte_order != BYTE_ORDER);
/* reverse byte order */
+ int rbo = (int
eger_type->byte_order != BYTE_ORDER);
/* reverse byte order */
- align_pos(pos, int
_class
->p.alignment);
+ align_pos(pos, int
eger_type
->p.alignment);
assert(!(pos->offset % CHAR_BIT));
assert(!(pos->offset % CHAR_BIT));
- switch (int
_class
->len) {
+ switch (int
eger_type
->len) {
case 8:
{
int8_t v;
v = *(const int8_t *)pos->base;
case 8:
{
int8_t v;
v = *(const int8_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return v;
}
case 16:
return v;
}
case 16:
@@
-90,7
+90,7
@@
int64_t _aligned_int_read(struct stream_pos *pos,
int16_t v;
v = *(const int16_t *)pos->base;
int16_t v;
v = *(const int16_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return rbo ? GUINT16_SWAP_LE_BE(v) : v;
}
case 32:
return rbo ? GUINT16_SWAP_LE_BE(v) : v;
}
case 32:
@@
-98,7
+98,7
@@
int64_t _aligned_int_read(struct stream_pos *pos,
int32_t v;
v = *(const int32_t *)pos->base;
int32_t v;
v = *(const int32_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return rbo ? GUINT32_SWAP_LE_BE(v) : v;
}
case 64:
return rbo ? GUINT32_SWAP_LE_BE(v) : v;
}
case 64:
@@
-106,7
+106,7
@@
int64_t _aligned_int_read(struct stream_pos *pos,
int64_t v;
v = *(const int64_t *)pos->base;
int64_t v;
v = *(const int64_t *)pos->base;
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return rbo ? GUINT64_SWAP_LE_BE(v) : v;
}
default:
return rbo ? GUINT64_SWAP_LE_BE(v) : v;
}
default:
@@
-116,17
+116,17
@@
int64_t _aligned_int_read(struct stream_pos *pos,
static
void _aligned_uint_write(struct stream_pos *pos,
static
void _aligned_uint_write(struct stream_pos *pos,
- const struct type_
class_integer *int_class
,
+ const struct type_
integer *integer_type
,
uint64_t v)
{
uint64_t v)
{
- int rbo = (int
_class->byte_order != BYTE_ORDER);
/* reverse byte order */
+ int rbo = (int
eger_type->byte_order != BYTE_ORDER);
/* reverse byte order */
- align_pos(pos, int
_class
->p.alignment);
+ align_pos(pos, int
eger_type
->p.alignment);
assert(!(pos->offset % CHAR_BIT));
if (pos->dummy)
goto end;
assert(!(pos->offset % CHAR_BIT));
if (pos->dummy)
goto end;
- switch (int
_class
->len) {
+ switch (int
eger_type
->len) {
case 8: *(uint8_t *) get_pos_addr(pos) = (uint8_t) v;
break;
case 16:
case 8: *(uint8_t *) get_pos_addr(pos) = (uint8_t) v;
break;
case 16:
@@
-147,22
+147,22
@@
void _aligned_uint_write(struct stream_pos *pos,
assert(0);
}
end:
assert(0);
}
end:
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
}
static
void _aligned_int_write(struct stream_pos *pos,
}
static
void _aligned_int_write(struct stream_pos *pos,
- const struct type_
class_integer *int_class
,
+ const struct type_
integer *integer_type
,
int64_t v)
{
int64_t v)
{
- int rbo = (int
_class->byte_order != BYTE_ORDER);
/* reverse byte order */
+ int rbo = (int
eger_type->byte_order != BYTE_ORDER);
/* reverse byte order */
- align_pos(pos, int
_class
->p.alignment);
+ align_pos(pos, int
eger_type
->p.alignment);
assert(!(pos->offset % CHAR_BIT));
if (pos->dummy)
goto end;
assert(!(pos->offset % CHAR_BIT));
if (pos->dummy)
goto end;
- switch (int
_class
->len) {
+ switch (int
eger_type
->len) {
case 8: *(int8_t *) get_pos_addr(pos) = (int8_t) v;
break;
case 16:
case 8: *(int8_t *) get_pos_addr(pos) = (int8_t) v;
break;
case 16:
@@
-183,72
+183,72
@@
void _aligned_int_write(struct stream_pos *pos,
assert(0);
}
end:
assert(0);
}
end:
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
return;
}
uint64_t ctf_uint_read(struct stream_pos *pos,
return;
}
uint64_t ctf_uint_read(struct stream_pos *pos,
- const struct type_
class_integer *int_class
)
+ const struct type_
integer *integer_type
)
{
uint64_t v = 0;
{
uint64_t v = 0;
- align_pos(pos, int
_class
->p.alignment);
- if (int
_class
->byte_order == LITTLE_ENDIAN)
+ align_pos(pos, int
eger_type
->p.alignment);
+ if (int
eger_type
->byte_order == LITTLE_ENDIAN)
bt_bitfield_read_le(pos->base, unsigned long, pos->offset,
bt_bitfield_read_le(pos->base, unsigned long, pos->offset,
- int
_class
->len, &v);
+ int
eger_type
->len, &v);
else
bt_bitfield_read_be(pos->base, unsigned long, pos->offset,
else
bt_bitfield_read_be(pos->base, unsigned long, pos->offset,
- int
_class
->len, &v);
- move_pos(pos, int
_class
->len);
+ int
eger_type
->len, &v);
+ move_pos(pos, int
eger_type
->len);
return v;
}
int64_t ctf_int_read(struct stream_pos *pos,
return v;
}
int64_t ctf_int_read(struct stream_pos *pos,
- const struct type_
class_integer *int_class
)
+ const struct type_
integer *integer_type
)
{
int64_t v = 0;
{
int64_t v = 0;
- align_pos(pos, int
_class
->p.alignment);
- if (int
_class
->byte_order == LITTLE_ENDIAN)
+ align_pos(pos, int
eger_type
->p.alignment);
+ if (int
eger_type
->byte_order == LITTLE_ENDIAN)
bt_bitfield_read_le(pos->base, unsigned long, pos->offset,
bt_bitfield_read_le(pos->base, unsigned long, pos->offset,
- int
_class
->len, &v);
+ int
eger_type
->len, &v);
else
bt_bitfield_read_be(pos->base, unsigned long, pos->offset,
else
bt_bitfield_read_be(pos->base, unsigned long, pos->offset,
- int
_class
->len, &v);
- move_pos(pos, int
_class
->len);
+ int
eger_type
->len, &v);
+ move_pos(pos, int
eger_type
->len);
return v;
}
void ctf_uint_write(struct stream_pos *pos,
return v;
}
void ctf_uint_write(struct stream_pos *pos,
- const struct type_
class_integer *int_class
,
+ const struct type_
integer *integer_type
,
uint64_t v)
{
uint64_t v)
{
- align_pos(pos, int
_class
->p.alignment);
+ align_pos(pos, int
eger_type
->p.alignment);
if (pos->dummy)
goto end;
if (pos->dummy)
goto end;
- if (int
_class
->byte_order == LITTLE_ENDIAN)
+ if (int
eger_type
->byte_order == LITTLE_ENDIAN)
bt_bitfield_write_le(pos->base, unsigned long, pos->offset,
bt_bitfield_write_le(pos->base, unsigned long, pos->offset,
- int
_class
->len, v);
+ int
eger_type
->len, v);
else
bt_bitfield_write_be(pos->base, unsigned long, pos->offset,
else
bt_bitfield_write_be(pos->base, unsigned long, pos->offset,
- int
_class
->len, v);
+ int
eger_type
->len, v);
end:
end:
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
}
void ctf_int_write(struct stream_pos *pos,
}
void ctf_int_write(struct stream_pos *pos,
- const struct type_
class_integer *int_class
,
+ const struct type_
integer *integer_type
,
int64_t v)
{
int64_t v)
{
- align_pos(pos, int
_class
->p.alignment);
+ align_pos(pos, int
eger_type
->p.alignment);
if (pos->dummy)
goto end;
if (pos->dummy)
goto end;
- if (int
_class
->byte_order == LITTLE_ENDIAN)
+ if (int
eger_type
->byte_order == LITTLE_ENDIAN)
bt_bitfield_write_le(pos->base, unsigned long, pos->offset,
bt_bitfield_write_le(pos->base, unsigned long, pos->offset,
- int
_class
->len, v);
+ int
eger_type
->len, v);
else
bt_bitfield_write_be(pos->base, unsigned long, pos->offset,
else
bt_bitfield_write_be(pos->base, unsigned long, pos->offset,
- int
_class
->len, v);
+ int
eger_type
->len, v);
end:
end:
- move_pos(pos, int
_class
->len);
+ move_pos(pos, int
eger_type
->len);
}
}
This page took
0.028551 seconds
and
4
git commands to generate.