[PATCH v2 0/2] Optimize magic constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Magic constants in Spice headers are defines as string dereference.
This cause possible warnings and sub-optimization while a simple
constant can be used.
Compute a constant at compile time using some helper macro.

Changes from v1:
- check compiler in macros.h, do not add an extra file;
- use << and | to compute constant.

Frediano Ziglio (2):
  Detects processor endianess using preprocessor
  Define and use new SPICE_MAGIC_CONST macro

 spice/controller_prot.h   |  2 +-
 spice/foreign_menu_prot.h |  2 +-
 spice/macros.h            | 63 +++++++++++++++++++++++++++++++++++++++++++++++
 spice/protocol.h          |  2 +-
 spice/qxl_dev.h           |  4 +--
 spice/stats.h             |  2 +-
 spice/vdi_dev.h           |  2 +-
 7 files changed, 70 insertions(+), 7 deletions(-)

-- 
2.1.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]