aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-07-08 15:06:49 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-07-08 15:06:49 +0300
commit2377ea235bd13f0327bdd4b2195958ce504dbd19 (patch)
tree65de18f4f36ab573c32f07b912c703a7907e8551
parentb9a7f4a3512f770fe86be8f32d32642b6ff95bb3 (diff)
parent9ff2ae36ec0633b8017612b13224447c716bbcc2 (diff)
downloadegawk-2377ea235bd13f0327bdd4b2195958ce504dbd19.tar.gz
egawk-2377ea235bd13f0327bdd4b2195958ce504dbd19.tar.bz2
egawk-2377ea235bd13f0327bdd4b2195958ce504dbd19.zip
Merge branch 'gawk-4.1-stable'
-rw-r--r--ChangeLog5
-rw-r--r--TODO2
-rw-r--r--io.c10
3 files changed, 10 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 750b7f06..74c7a139 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (get_a_record): Change `min' to `MIN' for consistency with
+ other files and general practice.
+
2013-07-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
* gawkapi.h (awk_element_t): Add comment indicating that the array
diff --git a/TODO b/TODO
index 8e98c70c..4bd39fd8 100644
--- a/TODO
+++ b/TODO
@@ -15,8 +15,6 @@ TODO
Minor Cleanups and Code Improvements
------------------------------------
- Rationalize use of min/max/MIN/MAX in gawk code.
-
API:
??? #if !defined(GAWK) && !defined(GAWK_OMIT_CONVENIENCE_MACROS)
diff --git a/io.c b/io.c
index dc41aea3..a1c902ba 100644
--- a/io.c
+++ b/io.c
@@ -3500,12 +3500,12 @@ get_a_record(char **out, /* pointer to pointer to data */
recm.rt_start = iop->off + recm.len;
/* read more data, break if EOF */
-#ifndef min
-#define min(x, y) (x < y ? x : y)
+#ifndef MIN
+#define MIN(x, y) (x < y ? x : y)
#endif
/* subtract one in read count to leave room for sentinel */
room_left = iop->end - iop->dataend - 1;
- amt_to_read = min(iop->readsize, room_left);
+ amt_to_read = MIN(iop->readsize, room_left);
if (amt_to_read < iop->readsize) {
grow_iop_buffer(iop);
@@ -3516,7 +3516,7 @@ get_a_record(char **out, /* pointer to pointer to data */
/* recalculate amt_to_read */
room_left = iop->end - iop->dataend - 1;
- amt_to_read = min(iop->readsize, room_left);
+ amt_to_read = MIN(iop->readsize, room_left);
}
while (amt_to_read + iop->readsize < room_left)
amt_to_read += iop->readsize;
@@ -3526,7 +3526,7 @@ get_a_record(char **out, /* pointer to pointer to data */
* POSIX limits read to SSIZE_MAX. There are (bizarre)
* systems where this amount is small.
*/
- amt_to_read = min(amt_to_read, SSIZE_MAX);
+ amt_to_read = MIN(amt_to_read, SSIZE_MAX);
#endif
iop->count = iop->public.read_func(iop->public.fd, iop->dataend, amt_to_read);