From 89da4168df5c8f6199504fed6e25fc5326c14fd2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 16 Mar 2018 11:18:18 -0300 Subject: avoid functions named 'pack' (name too common, may collide when doing 'onelua.c') --- lmathlib.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lmathlib.c') diff --git a/lmathlib.c b/lmathlib.c index c5c3c541..aa9ef51a 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.124 2018/03/11 14:48:09 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.125 2018/03/12 12:39:03 roberto Exp roberto $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -321,7 +321,7 @@ typedef struct I { ** basic operations on 'I' values */ -static I pack (lu_int32 h, lu_int32 l) { +static I packI (lu_int32 h, lu_int32 l) { I result; result.h = h; result.l = l; @@ -330,20 +330,20 @@ static I pack (lu_int32 h, lu_int32 l) { /* i ^ (i << n) */ static I Ixorshl (I i, int n) { - return pack(i.h ^ ((i.h << n) | (i.l >> (32 - n))), i.l ^ (i.l << n)); + return packI(i.h ^ ((i.h << n) | (i.l >> (32 - n))), i.l ^ (i.l << n)); } /* i ^ (i >> n) */ static I Ixorshr (I i, int n) { - return pack(i.h ^ (i.h >> n), i.l ^ ((i.l >> n) | (i.h << (32 - n)))); + return packI(i.h ^ (i.h >> n), i.l ^ ((i.l >> n) | (i.h << (32 - n)))); } static I Ixor (I i1, I i2) { - return pack(i1.h ^ i2.h, i1.l ^ i2.l); + return packI(i1.h ^ i2.h, i1.l ^ i2.l); } static I Iadd (I i1, I i2) { - I result = pack(i1.h + i2.h, i1.l + i2.l); + I result = packI(i1.h + i2.h, i1.l + i2.l); if (result.l < i1.l) /* carry? */ result.h++; return result; @@ -406,7 +406,7 @@ static lua_Unsigned I2UInt (I x) { static I Int2I (lua_Integer n) { lua_Unsigned un = n; - return pack((lu_int32)un, (lu_int32)(un >> 31 >> 1)); + return packI((lu_int32)un, (lu_int32)(un >> 31 >> 1)); } #endif /* } */ -- cgit v1.2.3-55-g6feb