鸿 网 互 联 www.68idc.cn

当前位置 : 服务器租用 > 编程语言开发 > c++ > >

1

来源:互联网 作者:佚名 时间:2016-07-01 16:52
结构体 无 struct { unsigned id:4; signed y:12; signed p:12; signed r:12; signed gx:12; signed gy:12; signed gz:12; signed ax:12; signed ay:12; signed az:12; uint8_t trigger; uint8_t iokeys; struct{ unsigned x:12; unsigned y:12; }gamepad; }t
结构体 <无>
            struct 
            {
                unsigned id:4;
                signed y:12;
                signed p:12;
                signed r:12;
                signed gx:12;
                signed gy:12;
                signed gz:12;
                
                signed ax:12;
                signed ay:12;
                signed az:12;
                
                uint8_t trigger;
                uint8_t iokeys;
                struct{
                    unsigned x:12;
                    unsigned y:12;
                }gamepad;

                
            }t_0x20;
            struct 
            {
                struct{
                    unsigned y:12;
                    unsigned x:12;
                }gamepad;

                uint8_t iokeys;
                uint8_t trigger;
                
                signed gz:12;
                signed gy:12;
                signed gx:12;
                
                signed az:12;
                signed ay:12;
                signed ax:12;
                
                signed r:12;
                signed p:12;
                signed y:12;
                unsigned id:4;
            }t_0x20_revert;
static void swap_byte(uint8_t* p_b1, uint8_t* p_b2)
{
    register uint8_t buffer = *p_b1;
    *p_b1 = *p_b2;
    *p_b2 = buffer;
}
static void revert_byte_19(uint8_t* p_byte_20)
{
    for(int i = 0;i<9;i++)
    {        
        swap_byte(p_byte_20+i, p_byte_20+18-i);
    }
}
上一篇:用两个栈模拟队列
下一篇:图形绘制
网友评论
<