[Spice-devel] [PATCH v3 0/2] Optimize magic constants

Frediano Ziglio fziglio at redhat.com
Wed Aug 12 03:42:44 PDT 2015


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 v2:
- small syntax fix;
- make header self contained.

Changes from v1:
- check compiler in macros.h, do not add an extra file;
- use << and | to compute constant.
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   |  3 ++-
 spice/foreign_menu_prot.h |  3 ++-
 spice/macros.h            | 63 +++++++++++++++++++++++++++++++++++++++++++++++
 spice/protocol.h          |  3 ++-
 spice/qxl_dev.h           |  5 ++--
 spice/stats.h             |  3 ++-
 spice/vdi_dev.h           |  3 ++-
 7 files changed, 76 insertions(+), 7 deletions(-)

-- 
2.4.3



More information about the Spice-devel mailing list