summaryrefslogtreecommitdiff
path: root/src/FYBA/FYLU.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FYBA/FYLU.cpp')
-rw-r--r--src/FYBA/FYLU.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/FYBA/FYLU.cpp b/src/FYBA/FYLU.cpp
index d14fa7a..f6ab917 100644
--- a/src/FYBA/FYLU.cpp
+++ b/src/FYBA/FYLU.cpp
@@ -8,12 +8,16 @@
#include <ctype.h>
#include <math.h>
-#include <locale>
+
+#define fymin(a,b) (((a)<(b))?(a):(b))
+#define fymax(a,b) (((a)>(b))?(a):(b))
+
using namespace std;
#define U_PARA_LEN 128 /* Max lengde av parameterstreng */
+#include <locale>
/* Felles variabler for hele FYBA */
extern LC_SYSTEMADM Sys;
@@ -1232,7 +1236,7 @@ static short LU_PiTestLinje(LC_UTVALG_ELEMENT * pUE,long lPnr)
} else if (metode == LC_U_IKKEFLERE) { /* Metode "!FL" */
/* Teller opp antall av dette SOSI-navnet */
- lMaxAntall = max(atol(pUE->min),1l);
+ lMaxAntall = fymax(atol(pUE->min),1l);
tilslag = 0;
while (LC_GetPiVerdi(pUE->sosi,lPnr,&sSett) != NULL) {
@@ -1831,7 +1835,7 @@ static short LU_GiTestLinje(LC_UT_ADM * pUtAdm,LC_UTVALG_ELEMENT * pUE,
/* Metode "!FL" */
} else if (metode == LC_U_IKKEFLERE) {
/* Teller opp antall av dette SOSI-navnet */
- lMaxAntall = max(atol(pUE->min),1l);
+ lMaxAntall = fymax(atol(pUE->min),1l);
tilslag = 0;
while ((*apara = LC_GetGP(pUE->sosi,gilin,9999)) != NULL) {
tilslag++;
@@ -2097,10 +2101,10 @@ static void LU_JustPara(char *para,short ledd,short start,short slutt,
if (cp != NULL){
if (start != 0){
if (slutt != 0){
- slutt = min(slutt,((short)strlen(cp)));
+ slutt = fymin(slutt,((short)strlen(cp)));
*(cp+slutt) = '\0';
}
- start = min(start,((short)strlen(cp)));
+ start = fymin(start,((short)strlen(cp)));
cp += (start-1);
}
UT_StrCopy(akt_para,cp,max_len);