From 3b355fec9ac5825ccd5b241aa3e4fbdbbfb989a9 Mon Sep 17 00:00:00 2001 From: Gonzalo Diethelm Date: Thu, 20 Jun 2013 12:43:32 -0400 Subject: [PATCH] Introduced private constants for the context sanity tag values. Ignored more MSVC intermmediate files. --- .gitignore | 2 +- src/ctx.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ce586a13..49960289 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ bin/ lib/ obj/ builds/msvc/*.suo +builds/msvc/*.sdf builds/msvc/*/*.user builds/msvc/*/*Debug builds/msvc/*/*Release @@ -78,4 +79,3 @@ foreign/openpgm/* zeromq-*.tar.gz zeromq-*.zip core - diff --git a/src/ctx.cpp b/src/ctx.cpp index 16a9d8ae..fdf319ee 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -35,8 +35,11 @@ #include "err.hpp" #include "msg.hpp" +#define ZMQ_CTX_TAG_VALUE_GOOD 0xabadcafe +#define ZMQ_CTX_TAG_VALUE_BAD 0xdeadbeef + zmq::ctx_t::ctx_t () : - tag (0xabadcafe), + tag (ZMQ_CTX_TAG_VALUE_GOOD), starting (true), terminating (false), reaper (NULL), @@ -50,7 +53,7 @@ zmq::ctx_t::ctx_t () : bool zmq::ctx_t::check_tag () { - return tag == 0xabadcafe; + return tag == ZMQ_CTX_TAG_VALUE_GOOD; } zmq::ctx_t::~ctx_t () @@ -78,7 +81,7 @@ zmq::ctx_t::~ctx_t () free (slots); // Remove the tag, so that the object is considered dead. - tag = 0xdeadbeef; + tag = ZMQ_CTX_TAG_VALUE_BAD; } int zmq::ctx_t::terminate ()