mirror of https://github.com/lua/lua
missplelling in comments/function names (endianess -> endianness)
This commit is contained in:
parent
1a3ebc203a
commit
420cc62fac
4
ldump.c
4
ldump.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: ldump.c,v 2.26 2014/03/11 18:05:46 roberto Exp roberto $
|
||||
** $Id: ldump.c,v 2.27 2014/03/11 18:56:27 roberto Exp roberto $
|
||||
** save precompiled Lua chunks
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ typedef struct {
|
|||
|
||||
/*
|
||||
** All high-level dumps go through DumpVector; you can change it to
|
||||
** change the endianess of the result
|
||||
** change the endianness of the result
|
||||
*/
|
||||
#define DumpVector(v,n,D) DumpBlock(v,(n)*sizeof((v)[0]),D)
|
||||
|
||||
|
|
16
lstrlib.c
16
lstrlib.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lstrlib.c,v 1.188 2014/03/21 13:52:33 roberto Exp roberto $
|
||||
** $Id: lstrlib.c,v 1.189 2014/03/21 14:26:44 roberto Exp roberto $
|
||||
** Standard library for string operations and pattern-matching
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -975,7 +975,7 @@ static int getendian (lua_State *L, int arg) {
|
|||
if (*endian == 'n') /* native? */
|
||||
return nativeendian.little;
|
||||
luaL_argcheck(L, *endian == 'l' || *endian == 'b', arg,
|
||||
"endianess must be 'l'/'b'/'n'");
|
||||
"endianness must be 'l'/'b'/'n'");
|
||||
return (*endian == 'l');
|
||||
}
|
||||
|
||||
|
@ -1075,9 +1075,9 @@ static int unpackint_l (lua_State *L) {
|
|||
}
|
||||
|
||||
|
||||
static void correctendianess (lua_State *L, char *b, int size, int endianarg) {
|
||||
static void correctendianness (lua_State *L, char *b, int size, int endianarg) {
|
||||
int endian = getendian(L, endianarg);
|
||||
if (endian != nativeendian.little) { /* not native endianess? */
|
||||
if (endian != nativeendian.little) { /* not native endianness? */
|
||||
int i = 0;
|
||||
while (i < --size) {
|
||||
char temp = b[i];
|
||||
|
@ -1113,7 +1113,7 @@ static int packfloat_l (lua_State *L) {
|
|||
d = (double)n;
|
||||
pn = (char*)&d;
|
||||
}
|
||||
correctendianess(L, pn, size, 3);
|
||||
correctendianness(L, pn, size, 3);
|
||||
lua_pushlstring(L, pn, size);
|
||||
return 1;
|
||||
}
|
||||
|
@ -1129,19 +1129,19 @@ static int unpackfloat_l (lua_State *L) {
|
|||
"string too short");
|
||||
if (size == sizeof(lua_Number)) {
|
||||
memcpy(&res, s + pos - 1, size);
|
||||
correctendianess(L, (char*)&res, size, 4);
|
||||
correctendianness(L, (char*)&res, size, 4);
|
||||
}
|
||||
else if (size == sizeof(float)) {
|
||||
float f;
|
||||
memcpy(&f, s + pos - 1, size);
|
||||
correctendianess(L, (char*)&f, size, 4);
|
||||
correctendianness(L, (char*)&f, size, 4);
|
||||
res = (lua_Number)f;
|
||||
}
|
||||
else { /* native lua_Number may be neither float nor double */
|
||||
double d;
|
||||
lua_assert(size == sizeof(double));
|
||||
memcpy(&d, s + pos - 1, size);
|
||||
correctendianess(L, (char*)&d, size, 4);
|
||||
correctendianness(L, (char*)&d, size, 4);
|
||||
res = (lua_Number)d;
|
||||
}
|
||||
lua_pushnumber(L, res);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lundump.c,v 2.33 2014/03/11 18:05:46 roberto Exp roberto $
|
||||
** $Id: lundump.c,v 2.34 2014/03/11 18:56:27 roberto Exp roberto $
|
||||
** load precompiled Lua chunks
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ static l_noret error(LoadState *S, const char *why) {
|
|||
|
||||
/*
|
||||
** All high-level loads go through LoadVector; you can change it to
|
||||
** adapt to the endianess of the input
|
||||
** adapt to the endianness of the input
|
||||
*/
|
||||
#define LoadVector(S,b,n) LoadBlock(S,b,(n)*sizeof((b)[0]))
|
||||
|
||||
|
@ -231,7 +231,7 @@ static void checkHeader (LoadState *S) {
|
|||
checksize(S, lua_Integer);
|
||||
checksize(S, lua_Number);
|
||||
if (LoadInteger(S) != LUAC_INT)
|
||||
error(S, "endianess mismatch in");
|
||||
error(S, "endianness mismatch in");
|
||||
if (LoadNumber(S) != LUAC_NUM)
|
||||
error(S, "float format mismatch in");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue