lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Using Visual Studio 10 to build 5.3 work 3.  The file(line number) and following line (or lines before a blank line) are the location and subject line of a compiler warning.  The following is modified to make the warning go away.  These may or may not be the “right” thing to do, they only clean up the warnings.

 

liolib.c(657)

  int res = setvbuf(f, NULL, mode[op], sz);

 

  int res = setvbuf(f, NULL, mode[op], (size_t)sz);

 

loadlib.c(276)

  int n = luaL_len(L, 1);

 

  lua_Integer n = luaL_len(L, 1);

 

lstrlib.c(62)

    lua_pushlstring(L, s + start - 1, end - start + 1);

 

    lua_pushlstring(L, s + start - 1, (size_t)(end - start + 1));

 

lstrlib.c(122)

    size_t totallen = n * l + (n - 1) * lsep;

   

    size_t totallen = (size_t)(n * l + (n - 1) * lsep);

 

lstrlib.c(597)

    const char *s2 = lmemfind(s + init - 1, ls - init + 1, p, lp);

 

    const char *s2 = lmemfind(s + (size_t)init - 1, ls - (size_t)init + 1, p, lp);

 

lstrlib.c(747)

  size_t max_s = luaL_optinteger(L, 4, srcl+1);

  ...

  size_t n = 0;

 

  lua_Integer max_s = luaL_optinteger(L, 4, srcl+1);

  ...

  lua_Integer n = 0;

 

ltablib.c(133)

  if (n >= (lua_Unsigned)INT_MAX  || !lua_checkstack(L, ++n))

 

  if ( n >= (lua_Unsigned)INT_MAX || !lua_checkstack(L, (int)(++n)) )

 

ltablib.c(147)

  return n;

 

  return (int)n;

 

ltablib.c(247)

  int n = aux_getn(L, 1);

  ...

  auxsort(L, 1, n);

 

  lua_Integer n = aux_getn(L, 1);

  ...

  auxsort(L, 1, (int)n);

 

 

Allan Pfalzgraf
EATON

W126N7250 Flint Drive

Menomonee Falls, WI   53051

tel: 414 449-6872
fax: 414 449-6616
AllanPfalzgraf@eaton.com
www.Eaton.com <http://www.eaton.com/>