qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject qpid-proton git commit: modify PN_CLASSDEF macro to provide accessor for the pn_class_t
Date Tue, 12 May 2015 14:56:49 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 1fe0aa244 -> 0e155e292


modify PN_CLASSDEF macro to provide accessor for the pn_class_t


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/0e155e29
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/0e155e29
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/0e155e29

Branch: refs/heads/master
Commit: 0e155e292ffbb2e3b6c054e47cad29ff3fc2aef5
Parents: 1fe0aa2
Author: Rafael Schloming <rhs@alum.mit.edu>
Authored: Tue May 12 10:56:39 2015 -0400
Committer: Rafael Schloming <rhs@alum.mit.edu>
Committed: Tue May 12 10:56:39 2015 -0400

----------------------------------------------------------------------
 proton-c/include/proton/object.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0e155e29/proton-c/include/proton/object.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/object.h b/proton-c/include/proton/object.h
index 48d2872..83c3cba 100644
--- a/proton-c/include/proton/object.h
+++ b/proton-c/include/proton/object.h
@@ -101,7 +101,7 @@ static int PREFIX ## _inspect_cast(void *object, pn_string_t *str) { 
    \
   }                                                                       \
 }                                                                         \
                                                                           \
-PREFIX ## _t *PREFIX ## _new(void) {                                      \
+const pn_class_t *PREFIX ## __class(void) {                               \
   static const pn_class_t clazz = {                                       \
     #PREFIX,                                                              \
     CID_ ## PREFIX,                                                       \
@@ -117,7 +117,12 @@ PREFIX ## _t *PREFIX ## _new(void) {                                
     \
     PREFIX ## _compare_cast,                                              \
     PREFIX ## _inspect_cast                                               \
   };                                                                      \
-  return (PREFIX ## _t *) pn_class_new(&clazz, sizeof(PREFIX ## _t));     \
+  return &clazz;                                                          \
+}                                                                         \
+                                                                          \
+PREFIX ## _t *PREFIX ## _new(void) {                                      \
+  return (PREFIX ## _t *) pn_class_new(PREFIX ## __class(),               \
+                                       sizeof(PREFIX ## _t));             \
 }
 
 #define PN_CLASS(PREFIX) {                      \


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message