]> git.evergreen-ils.org Git - OpenSRF.git/commit
Tinkering with macros.
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 6 Jan 2009 16:01:41 +0000 (16:01 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 6 Jan 2009 16:01:41 +0000 (16:01 +0000)
commitd4548cfb987a8846d0d5ddb99a99a9dc840ea90e
tree269c2003fc6246b89b940fdbec00a43f5155f902
parent49c7c159456fd6ed23278ea0fb0461aac4b38941
Tinkering with macros.

1. In OSRF_BUFFER_ADD, OSRF_BUFFER_ADD_CHAR, and OSRF_BUFFER_RESET:
eliminated multiple evaluations of macro arguments.

2. In OSRF_BUFFER_ADD: renamed local variable __tl to _tl, since
identifiers beginning with two underscores are reserved.

3. In OSRF_BUFFER_RESET: applied the do/while(0) trick so that the
macro will be work as intended when subject to an "if".

4. Added new macro OSRF_BUFFER_C_STR to return a const pointer to
the internal buffer of a growing_buffer.  This new macro will enable
safe and direct access to the buffer contents without violating
encapsulation and without incurring a malloc and free.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1572 9efc2488-bf62-4759-914b-345cdb29e865
include/opensrf/utils.h