diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-10 20:40:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-10 20:40:15 (GMT) |
commit | 4a38609129a5103a58655c4f4789012c1144f5c7 (patch) | |
tree | c97e8c3d9fb1063f46c7fb501e8847936112d026 /win | |
parent | ea55b6cb74c6189bf0a9ce55a94e14c59875af91 (diff) | |
download | tcl-4a38609129a5103a58655c4f4789012c1144f5c7.zip tcl-4a38609129a5103a58655c4f4789012c1144f5c7.tar.gz tcl-4a38609129a5103a58655c4f4789012c1144f5c7.tar.bz2 |
Minor simplification: Use RingBufferHasFreeSpace() instead of RingBufferFreeSpace
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinConsole.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 114b302..4a9a2df 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -97,7 +97,7 @@ typedef struct RingBuffer { RingSizeT length; /* Number of RingBufferChar*/ } RingBuffer; #define RingBufferLength(ringPtr_) ((ringPtr_)->length) -#define RingBufferFreeSpace(ringPtr_) ((ringPtr_)->capacity - (ringPtr_)->length) +#define RingBufferHasFreeSpace(ringPtr_) ((ringPtr_)->length < (ringPtr_)->capacity) #define RINGBUFFER_ASSERT(ringPtr_) assert(RingBufferCheck(ringPtr_)) /* @@ -795,7 +795,7 @@ ConsoleSetupProc( } } else if (chanInfoPtr->watchMask & TCL_WRITABLE) { - if (RingBufferFreeSpace(&handleInfoPtr->buffer) > 0) { + if (RingBufferHasFreeSpace(&handleInfoPtr->buffer)) { /* TCL_WRITABLE */ block = 0; /* Output space available */ } @@ -878,7 +878,7 @@ ConsoleCheckProc( } } else if (chanInfoPtr->watchMask & TCL_WRITABLE) { - if (RingBufferFreeSpace(&handleInfoPtr->buffer) > 0) { + if (RingBufferHasFreeSpace(&handleInfoPtr->buffer)) { needEvent = 1; /* Output space available */ } } @@ -1429,7 +1429,7 @@ ConsoleEventProc( mask = TCL_READABLE; } else if ((chanInfoPtr->watchMask & TCL_WRITABLE) - && RingBufferFreeSpace(&handleInfoPtr->buffer) > 0) { + && RingBufferHasFreeSpace(&handleInfoPtr->buffer)) { /* Generate write event space available */ mask = TCL_WRITABLE; } |