Skip to content

Commit f2d037a

Browse files
committed
min macro renamed to MIN
1 parent 4093b71 commit f2d037a

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

src/Encoder.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ void XWRT_Encoder::write_dict(int comprLevel)
23782378
{
23792379
cmn=0;
23802380
if (i>0)
2381-
cmn=common(sortedDict[i-1].c_str(),sortedDict[i].c_str(),min(sortedDict[i].size(),sortedDict[i-1].size()));
2381+
cmn=common(sortedDict[i-1].c_str(),sortedDict[i].c_str(),MIN(sortedDict[i].size(),sortedDict[i-1].size()));
23822382

23832383
if ((preprocType!=LZ77) && (cmn>0 || (unsigned char)(sortedDict[i][0])>=128))
23842384
bufferData+=sprintf((char*)bufferData,"%c%s\n",128+cmn,sortedDict[i].c_str()+cmn);
@@ -2810,7 +2810,7 @@ int compare_str_rev( const void *arg1, const void *arg2 )
28102810
int a=*(int*)arg1;
28112811
int b=*(int*)arg2;
28122812

2813-
int minv=min(dictlen[a],dictlen[b]);
2813+
int minv=MIN(dictlen[a],dictlen[b]);
28142814

28152815
for (int i=1; i<=minv; i++)
28162816
{
@@ -2870,13 +2870,13 @@ void XWRT_Encoder::sortDict(int size)
28702870

28712871
if (preprocType!=LZ77)
28722872
{
2873-
qsort(&inttable[0],min(size,dict1size),sizeof(inttable[0]),compare_str);
2873+
qsort(&inttable[0],MIN(size,dict1size),sizeof(inttable[0]),compare_str);
28742874

28752875
if (size>dict1size)
2876-
qsort(&inttable[dict1size],min(size,bound3)-dict1size,sizeof(inttable[0]),compare_str);
2876+
qsort(&inttable[dict1size],MIN(size,bound3)-dict1size,sizeof(inttable[0]),compare_str);
28772877

28782878
if (size>bound3)
2879-
qsort(&inttable[bound3],min(size,bound4)-bound3,sizeof(inttable[0]),compare_str);
2879+
qsort(&inttable[bound3],MIN(size,bound4)-bound3,sizeof(inttable[0]),compare_str);
28802880

28812881
if (size>bound4)
28822882
qsort(&inttable[bound4],size-bound4,sizeof(inttable[0]),compare_str);

src/MemBuffer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ inline void CMemoryBuffer::ReallocTgtBuf(unsigned int len)
9999
OUT_OF_MEMORY();
100100

101101
NewTargetBuf += 3;
102-
memcpy(NewTargetBuf,TargetBuf,min(TgtPtr,len));
102+
memcpy(NewTargetBuf,TargetBuf,MIN(TgtPtr,len));
103103
TgtLen = len;
104104
delete(TargetBuf-3);
105105
TargetBuf=NewTargetBuf;

src/XWRT.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include "XWRT.h"
21
#include <time.h>
32
#include <vector>
3+
#include "XWRT.h"
44
#include "Encoder.h"
55
#include "Decoder.h"
66

src/XWRT.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ class Encoder;
110110
#define OPTION_UNICODE_BE 524288
111111

112112

113-
#if !defined min
114-
#define min(a,b) (((a)>(b))?(b):(a))
113+
#if !defined MIN
114+
#define MIN(a,b) (((a)>(b))?(b):(a))
115115
#endif
116116
#define IF_OPTION(option) (preprocFlag & option)
117117
#define OPTION(option) (xml_wrt.preprocFlag & option)

src/lpaq6.h

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ typedef unsigned char U8;
1212
typedef unsigned short U16;
1313
typedef unsigned int U32;
1414

15-
// min, max functions
16-
#ifndef min
17-
inline int min(int a, int b) {return a<b?a:b;}
18-
inline int max(int a, int b) {return a<b?b:a;}
19-
#endif
2015

2116
template <int B>
2217
class HashTable {

0 commit comments

Comments
 (0)