fork download
  1. #include <stdlib.h>
  2. #include <stddef.h>
  3. #include <stdint.h>
  4.  
  5. struct Command_Type {
  6. uint8_t A,B,Command;
  7. }; // struct Command_Type
  8.  
  9.  
  10.  
  11. #define _HeartBeat ((struct Command_Type) {0x10,0x01,0})
  12.  
  13. #define int_of_Command_Type(X) ((unsigned int) (((int) ((X).A)) << 16) |\
  14.   (unsigned int) (((int) ((X).B)) << 8) | \
  15.   (unsigned int) (((int) ((X).Command))))
  16.  
  17.  
  18. int main() {
  19. struct Command_Type Command_type_var=_HeartBeat;
  20.  
  21. switch(int_of_Command_Type(Command_type_var))
  22. {
  23. case int_of_Command_Type(_HeartBeat):
  24. break;
  25. default:
  26. break;
  27. };
  28. return 0;
  29. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty