You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2014/12/12 21:54:39 UTC
[1/2] qpid-proton git commit: PROTON-772: Avoid use of GNU extension
## command deletion.
Repository: qpid-proton
Updated Branches:
refs/heads/master d042c4ed0 -> c0abbe528
PROTON-772: Avoid use of GNU extension ## command deletion.
The following idiom is GNU C specific:
-#define pn_logf(fmt, ...)
- pn_logf_impl(fmt , ##__VA_ARGS__);
The use of ## after a comma deletes the comma if __VA_ARGS__ is empty, so the above works
even if there is no argument after fmt.
The following is more portable:
+#define pn_logf(...)
+ pn_logf_impl(__VA_ARGS__);
Now fmt is included in the variadic argument list so it is never empty. This is
slightly less self-descriptive since it doesn't correspond as well to the
signature of pn_logf_impl(fmt, ...), but it is standard C99.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c0abbe52
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c0abbe52
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c0abbe52
Branch: refs/heads/master
Commit: c0abbe5289e555bbea5ca3ddf6e0ec7244b1ffdb
Parents: f22fa7f
Author: Alan Conway <ac...@redhat.com>
Authored: Fri Dec 12 15:46:10 2014 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Fri Dec 12 15:48:03 2014 -0500
----------------------------------------------------------------------
proton-c/include/proton/log.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c0abbe52/proton-c/include/proton/log.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/log.h b/proton-c/include/proton/log.h
index 5fb8e91..73b9b6d 100644
--- a/proton-c/include/proton/log.h
+++ b/proton-c/include/proton/log.h
@@ -51,10 +51,10 @@ PN_EXTERN void pn_log_enable(bool enabled);
PN_EXTERN bool pn_log_enabled(void);
/** Log a printf style message */
-#define pn_logf(fmt, ...) \
+#define pn_logf(...) \
do { \
if (pn_log_enabled()) \
- pn_logf_impl(fmt , ##__VA_ARGS__); \
+ pn_logf_impl(__VA_ARGS__); \
} while(0)
/** va_list version of pn_logf */
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/2] qpid-proton git commit: NO-JIRA: Fix ignored python exceptions
"Selectable' object has no attribute '_impl"
Posted by ac...@apache.org.
NO-JIRA: Fix ignored python exceptions "Selectable' object has no attribute '_impl"
Fix errors introduced by:
e769ad5 NO-JIRA: Fix core dumps and memory management errors in python binding, engine.py.
Deleted attribute _impl was later being checked for None.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f22fa7fc
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f22fa7fc
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f22fa7fc
Branch: refs/heads/master
Commit: f22fa7fc4391db3929fe83760d213fd139a4338e
Parents: d042c4e
Author: Alan Conway <ac...@redhat.com>
Authored: Fri Dec 12 15:32:22 2014 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Fri Dec 12 15:48:03 2014 -0500
----------------------------------------------------------------------
proton-c/bindings/python/proton/__init__.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f22fa7fc/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py
index 543f3da..b54b445 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -1220,7 +1220,7 @@ indicate whether the fd has been registered or not.
if self._impl:
del self.messenger._selectables[self.fileno()]
pn_selectable_free(self._impl)
- del self._impl
+ self._impl = None
def __del__(self):
self.free()
@@ -3465,7 +3465,7 @@ class Connector(object):
def _release(self):
"""Release the underlying C Engine resource."""
- if self._cxtr:
+ if hasattr(self, '_cxtr'):
pn_connector_set_context(self._cxtr, pn_py2void(None))
pn_connector_free(self._cxtr)
del self._cxtr
@@ -3549,7 +3549,7 @@ class Listener(object):
def _release(self):
"""Release the underlying C Engine resource."""
- if self._lsnr:
+ if hasattr(self, '_lsnr'):
pn_listener_set_context(self._lsnr, pn_py2void(None));
pn_listener_free(self._lsnr)
del self._lsnr
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org