From: Michael Meffie Date: Mon, 19 Mar 2012 23:27:33 +0000 (-0400) Subject: build on solaris 10 again X-Git-Tag: upstream/1.8.0_pre1^2~2695 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=640fe82315838f60cce5789ad7d9965db3dabe0a;p=packages%2Fo%2Fopenafs.git build on solaris 10 again Use min and max instead of the non-standard MIN and MAX macros. Commit 64b00c3a1a87739621f58c777fc3cc54fb15a0af removed inclusion of rx_packet.h, which included definitions of MIN and MAX on various platforms. Change-Id: I3d3c75af375704b8baddd72aec3aecf3c4fd43d7 Reviewed-on: http://gerrit.openafs.org/6924 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear --- diff --git a/src/bucoord/ubik_db_if.c b/src/bucoord/ubik_db_if.c index 22b0e6a7e..b4df0ea4f 100644 --- a/src/bucoord/ubik_db_if.c +++ b/src/bucoord/ubik_db_if.c @@ -585,7 +585,7 @@ bcdb_SaveTextFile(udbClientTextP ctPtr) offset = 0; while (fileSize != 0) { - chunkSize = MIN(fileSize, bufferSize); + chunkSize = min(fileSize, bufferSize); code = fread(charList.charListT_val, sizeof(char), chunkSize, ctPtr->textStream); diff --git a/src/budb/db_dump.c b/src/budb/db_dump.c index a1510ac55..93e45e6d8 100644 --- a/src/budb/db_dump.c +++ b/src/budb/db_dump.c @@ -494,7 +494,7 @@ writeText(struct ubik_trans *ut, int fid, int textType) if (code) ERROR(code); - writeSize = MIN(textSize, BLOCK_DATA_SIZE); + writeSize = min(textSize, BLOCK_DATA_SIZE); if (!writeSize) break; diff --git a/src/budb/db_text.c b/src/budb/db_text.c index ee76d9794..2bee3f5dc 100644 --- a/src/budb/db_text.c +++ b/src/budb/db_text.c @@ -110,7 +110,7 @@ GetText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType, /* compute minimum of remaining text or user buffer */ textRemaining = ntohl(tbPtr->size) - offset; - transferSize = MIN(textRemaining, maxLength); + transferSize = min(textRemaining, maxLength); /* allocate the transfer storage */ if (transferSize <= 0) { @@ -365,7 +365,7 @@ SaveText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType, while (textLength) { /* compute the transfer size */ remainingInBlock = (BLOCK_DATA_SIZE - (offset % BLOCK_DATA_SIZE)); - chunkSize = MIN(remainingInBlock, textLength); + chunkSize = min(remainingInBlock, textLength); /* copy in the data */ memcpy(&diskBlock.a[offset % BLOCK_DATA_SIZE], textptr, chunkSize); @@ -466,7 +466,7 @@ saveTextToFile(struct ubik_trans *ut, struct textBlock *tbPtr) size = ntohl(tbPtr->size); blockAddr = ntohl(tbPtr->textAddr); while (size) { - chunkSize = MIN(BLOCK_DATA_SIZE, size); + chunkSize = min(BLOCK_DATA_SIZE, size); dbread(ut, blockAddr, (char *)&block, sizeof(block)); write(fid, &block.a[0], chunkSize); blockAddr = ntohl(block.h.next); diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index 789ec3940..58cd546aa 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -139,7 +139,7 @@ ih_Initialize(void) */ fdMaxCacheSize /= 4; #endif - fdMaxCacheSize = MIN(fdMaxCacheSize, vol_io_params.fd_max_cachesize); + fdMaxCacheSize = min(fdMaxCacheSize, vol_io_params.fd_max_cachesize); osi_Assert(fdMaxCacheSize > 0); } #elif defined(AFS_HPUX_ENV) @@ -147,12 +147,12 @@ ih_Initialize(void) fdMaxCacheSize = 0; #else { - long fdMax = MAX(sysconf(_SC_OPEN_MAX) - vol_io_params.fd_handle_setaside, + long fdMax = max(sysconf(_SC_OPEN_MAX) - vol_io_params.fd_handle_setaside, 0); - fdMaxCacheSize = (int)MIN(fdMax, vol_io_params.fd_max_cachesize); + fdMaxCacheSize = (int)min(fdMax, vol_io_params.fd_max_cachesize); } #endif - fdCacheSize = MIN(fdMaxCacheSize, vol_io_params.fd_initial_cachesize); + fdCacheSize = min(fdMaxCacheSize, vol_io_params.fd_initial_cachesize); { #ifdef AFS_PTHREAD_ENV diff --git a/src/vol/salvaged.c b/src/vol/salvaged.c index 31d5bc892..cd89a0d9a 100644 --- a/src/vol/salvaged.c +++ b/src/vol/salvaged.c @@ -210,7 +210,7 @@ handleit(struct cmd_syndesc *as, void *arock) } } } else { - Parallel = MIN(DEFAULT_PARALLELISM, MAXPARALLEL); + Parallel = min(DEFAULT_PARALLELISM, MAXPARALLEL); } if ((ti = as->parms[10].items)) { /* -tmpdir */ DIR *dirp; diff --git a/src/vol/volume.c b/src/vol/volume.c index 4a07e07e9..5a1d5e1b9 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -717,7 +717,7 @@ VInitAttachVolumes(ProgramType pt) queue_Append(¶ms,dpq); } - threads = MIN(parts, vol_attach_threads); + threads = min(parts, vol_attach_threads); if (threads > 1) { /* spawn off a bunch of initialization threads */ @@ -840,7 +840,7 @@ VInitAttachVolumes(ProgramType pt) } /* number of worker threads; at least one, not to exceed the number of partitions */ - threads = MIN(parts, vol_attach_threads); + threads = min(parts, vol_attach_threads); /* create volume work queue */ queue_Init(&vq);