[git] GPG-ERROR - branch, master, updated. libgpg-error-1.16-13-g12b5188

by Werner Koch cvs at cvs.gnupg.org
Fri Oct 3 08:25:14 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Error codes used by GnuPG et al.".

The branch, master has been updated
       via  12b5188bd495e45775c34c8e6263e6be177c03da (commit)
      from  e8b04bed1093a9f1d87c150326e79adfeb02e2b4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 12b5188bd495e45775c34c8e6263e6be177c03da
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Oct 3 08:22:53 2014 +0200

    Change gpgrt_pending{,_unlocked} to macros.
    
    * src/gpg-error.h.in (gpgrt_pending): Change to a macro.
    (gpgrt_pending_unlocked): Change to a macro.
    (_gpgrt_pending, _gpgrt_pending_unlocked): New private functions.
    * src/visibility.c, src/visibility.h: Change accordingly.
    * src/gpg-error.vers, src/gpg-error.def.in: Ditto.
    * src/estream.c (_gpgrt_pending_unlocked): Rename to
    _gpgrt__pending_unlocked.
    (_gpgrt_pending): Rename to _gpgrt__pending.
    --
    
    The function are supposed to be used with gprt_getc and thus we need
    to avoid the function call overhead.  We may want to change them to
    inline functions, though.
    
    gpgrt_pending is changed to a macro with the idea that we eventually
    can export the samestream flags and thus avoid the function call
    overhead in the samethread case too.

diff --git a/src/estream.c b/src/estream.c
index a17950e..42609ee 100644
--- a/src/estream.c
+++ b/src/estream.c
@@ -3471,7 +3471,7 @@ _gpgrt_syshd (estream_t stream, es_syshd_t *syshd)
 
 
 int
-_gpgrt_pending_unlocked (estream_t stream)
+_gpgrt__pending_unlocked (estream_t stream)
 {
   return check_pending (stream);
 }
@@ -3486,12 +3486,12 @@ _gpgrt_pending_unlocked (estream_t stream)
    are pending the function is expected to return -1 in this case and
    thus deviates from the standard behavior of read(2).   */
 int
-_gpgrt_pending (estream_t stream)
+_gpgrt__pending (estream_t stream)
 {
   int ret;
 
   lock_stream (stream);
-  ret = _gpgrt_pending_unlocked (stream);
+  ret = _gpgrt__pending_unlocked (stream);
   unlock_stream (stream);
 
   return ret;
diff --git a/src/gpg-error.def.in b/src/gpg-error.def.in
index f17522e..cba973d 100644
--- a/src/gpg-error.def.in
+++ b/src/gpg-error.def.in
@@ -137,7 +137,7 @@ EXPORTS
  gpg_err_deinit               @102
  gpgrt_set_alloc_func         @103
 
- gpgrt_pending                @104
- gpgrt_pending_unlocked       @105
+ _gpgrt_pending               @104
+ _gpgrt_pending_unlocked      @105
 
 ;; end of file with public symbols for Windows.
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index 6ac6e0a..7099b43 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -496,8 +496,17 @@ int gpgrt_ferror (gpgrt_stream_t stream);
 int gpgrt_ferror_unlocked (gpgrt_stream_t stream);
 void gpgrt_clearerr (gpgrt_stream_t stream);
 void gpgrt_clearerr_unlocked (gpgrt_stream_t stream);
-int gpgrt_pending (gpgrt_stream_t stream);
-int gpgrt_pending_unlocked (gpgrt_stream_t stream);
+
+int _gpgrt_pending (gpgrt_stream_t stream);          /* (private) */
+int _gpgrt_pending_unlocked (gpgrt_stream_t stream); /* (private) */
+
+#define gpgrt_pending(stream) _gpgrt_pending (stream)
+
+#define gpgrt_pending_unlocked(stream)				\
+  (((!(stream)->flags.writing)					\
+    && (((stream)->data_offset < (stream)->data_len)		\
+        || ((stream)->unread_data_len)))                        \
+   ? 1 : _gpgrt_pending_unlocked ((stream)))
 
 int gpgrt_fflush (gpgrt_stream_t stream);
 int gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence);
@@ -509,8 +518,8 @@ void gpgrt_rewind (gpgrt_stream_t stream);
 int gpgrt_fgetc (gpgrt_stream_t stream);
 int gpgrt_fputc (int c, gpgrt_stream_t stream);
 
-int _gpgrt_getc_underflow (gpgrt_stream_t stream);
-int _gpgrt_putc_overflow (int c, gpgrt_stream_t stream);
+int _gpgrt_getc_underflow (gpgrt_stream_t stream);       /* (private) */
+int _gpgrt_putc_overflow (int c, gpgrt_stream_t stream); /* (private) */
 
 #define gpgrt_getc_unlocked(stream)				\
   (((!(stream)->flags.writing)					\
diff --git a/src/gpg-error.vers b/src/gpg-error.vers
index c0e599a..758e549 100644
--- a/src/gpg-error.vers
+++ b/src/gpg-error.vers
@@ -64,8 +64,8 @@ GPG_ERROR_1.0 {
     gpgrt_flockfile;
     gpgrt_ftrylockfile;
     gpgrt_funlockfile;
-    gpgrt_pending;
-    gpgrt_pending_unlocked;
+    _gpgrt_pending;
+    _gpgrt_pending_unlocked;
     gpgrt_feof;
     gpgrt_feof_unlocked;
     gpgrt_ferror;
diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h
index 8907835..bc2db8b 100644
--- a/src/gpgrt-int.h
+++ b/src/gpgrt-int.h
@@ -102,8 +102,8 @@ int _gpgrt_ferror (gpgrt_stream_t stream);
 int _gpgrt_ferror_unlocked (gpgrt_stream_t stream);
 void _gpgrt_clearerr (gpgrt_stream_t stream);
 void _gpgrt_clearerr_unlocked (gpgrt_stream_t stream);
-int _gpgrt_pending (gpgrt_stream_t stream);
-int _gpgrt_pending_unlocked (gpgrt_stream_t stream);
+int _gpgrt__pending (gpgrt_stream_t stream);
+int _gpgrt__pending_unlocked (gpgrt_stream_t stream);
 
 int _gpgrt_fflush (gpgrt_stream_t stream);
 int _gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence);
diff --git a/src/visibility.c b/src/visibility.c
index f26f58c..9213ce9 100644
--- a/src/visibility.c
+++ b/src/visibility.c
@@ -298,15 +298,15 @@ gpgrt_funlockfile (estream_t stream)
 }
 
 int
-gpgrt_pending (estream_t stream)
+_gpgrt_pending (estream_t stream)
 {
-  return _gpgrt_pending (stream);
+  return _gpgrt__pending (stream);
 }
 
 int
-gpgrt_pending_unlocked (estream_t stream)
+_gpgrt_pending_unlocked (estream_t stream)
 {
-  return _gpgrt_pending_unlocked (stream);
+  return _gpgrt__pending_unlocked (stream);
 }
 
 int
diff --git a/src/visibility.h b/src/visibility.h
index 35878d7..6f7de84 100644
--- a/src/visibility.h
+++ b/src/visibility.h
@@ -87,8 +87,8 @@ MARK_VISIBLE (_gpgrt_get_std_stream)
 MARK_VISIBLE (gpgrt_flockfile)
 MARK_VISIBLE (gpgrt_ftrylockfile)
 MARK_VISIBLE (gpgrt_funlockfile)
-MARK_VISIBLE (gpgrt_pending)
-MARK_VISIBLE (gpgrt_pending_unlocked)
+MARK_VISIBLE (_gpgrt_pending)
+MARK_VISIBLE (_gpgrt_pending_unlocked)
 MARK_VISIBLE (gpgrt_feof)
 MARK_VISIBLE (gpgrt_feof_unlocked)
 MARK_VISIBLE (gpgrt_ferror)
@@ -192,8 +192,8 @@ MARK_VISIBLE (gpgrt_set_alloc_func)
 #define gpgrt_flockfile             _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_ftrylockfile          _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_funlockfile           _gpgrt_USE_UNDERSCORED_FUNCTION
-#define gpgrt_pending               _gpgrt_USE_UNDERSCORED_FUNCTION
-#define gpgrt_pending_unlocked      _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_pending              _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_pending_unlocked     _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_feof                  _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_feof_unlocked         _gpgrt_USE_UNDERSCORED_FUNCTION
 #define gpgrt_ferror                _gpgrt_USE_UNDERSCORED_FUNCTION

-----------------------------------------------------------------------

Summary of changes:
 src/estream.c        |    6 +++---
 src/gpg-error.def.in |    4 ++--
 src/gpg-error.h.in   |   17 +++++++++++++----
 src/gpg-error.vers   |    4 ++--
 src/gpgrt-int.h      |    4 ++--
 src/visibility.c     |    8 ++++----
 src/visibility.h     |    8 ++++----
 7 files changed, 30 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
Error codes used by GnuPG et al.
http://git.gnupg.org




More information about the Gnupg-commits mailing list