L
loudking
Hello, all.
I am not good at bitwise operation, so I wonder if some experts could
do me a help.
In a.c, somebody defined
================================================
# define u_int64 unsigned long long
# define u_short unsigned short
# define u_int unsigned int
u_short txid_slt;
u_int txid_sqn;
u_int64 tx_id= ((u_int64)txid_slt << 32) | (u_int64)txid_sqn;
Later, in b.c, I have to reassemble tx_id into "slt" and "sqn".
=================================================
struct redo_xid {
u_int sqn;
u_short slot;
};
Can I use the following expression to achieve this goal?
==================================================
struct redo_xid xid = (struct redo_xid)tx_id;
Many many thanks!
I am not good at bitwise operation, so I wonder if some experts could
do me a help.
In a.c, somebody defined
================================================
# define u_int64 unsigned long long
# define u_short unsigned short
# define u_int unsigned int
u_short txid_slt;
u_int txid_sqn;
u_int64 tx_id= ((u_int64)txid_slt << 32) | (u_int64)txid_sqn;
Later, in b.c, I have to reassemble tx_id into "slt" and "sqn".
=================================================
struct redo_xid {
u_int sqn;
u_short slot;
};
Can I use the following expression to achieve this goal?
==================================================
struct redo_xid xid = (struct redo_xid)tx_id;
Many many thanks!