aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@impa.br>2012-12-11 17:43:49 -0200
committerDiego Nehab <diego@impa.br>2012-12-11 17:43:49 -0200
commit72a5347f97b3f158431d4181109db3086a8a2953 (patch)
tree530f7ab086627154fc8693c939145c6d815de6df /src/select.c
parent618ce43ee3950b80aca1fde0a5b12e6e13627f1b (diff)
downloadluasocket-72a5347f97b3f158431d4181109db3086a8a2953.tar.gz
luasocket-72a5347f97b3f158431d4181109db3086a8a2953.tar.bz2
luasocket-72a5347f97b3f158431d4181109db3086a8a2953.zip
Remove warnings and fix makefile for Win32.
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/select.c b/src/select.c
index b870545..51fb198 100644
--- a/src/select.c
+++ b/src/select.c
@@ -122,7 +122,7 @@ static void collect_fd(lua_State *L, int tab, int itab,
122 if (lua_isnil(L, tab)) return; 122 if (lua_isnil(L, tab)) return;
123 /* otherwise we need it to be a table */ 123 /* otherwise we need it to be a table */
124 luaL_checktype(L, tab, LUA_TTABLE); 124 luaL_checktype(L, tab, LUA_TTABLE);
125 while (1) { 125 for ( ;; ) {
126 t_socket fd; 126 t_socket fd;
127 lua_pushnumber(L, i); 127 lua_pushnumber(L, i);
128 lua_gettable(L, tab); 128 lua_gettable(L, tab);
@@ -147,7 +147,7 @@ static void collect_fd(lua_State *L, int tab, int itab,
147 if (*max_fd == SOCKET_INVALID || *max_fd < fd) 147 if (*max_fd == SOCKET_INVALID || *max_fd < fd)
148 *max_fd = fd; 148 *max_fd = fd;
149 /* make sure we can map back from descriptor to the object */ 149 /* make sure we can map back from descriptor to the object */
150 lua_pushnumber(L, fd); 150 lua_pushnumber(L, (lua_Number) fd);
151 lua_pushvalue(L, -2); 151 lua_pushvalue(L, -2);
152 lua_settable(L, itab); 152 lua_settable(L, itab);
153 } 153 }
@@ -160,7 +160,7 @@ static int check_dirty(lua_State *L, int tab, int dtab, fd_set *set) {
160 int ndirty = 0, i = 1; 160 int ndirty = 0, i = 1;
161 if (lua_isnil(L, tab)) 161 if (lua_isnil(L, tab))
162 return 0; 162 return 0;
163 while (1) { 163 for ( ;; ) {
164 t_socket fd; 164 t_socket fd;
165 lua_pushnumber(L, i); 165 lua_pushnumber(L, i);
166 lua_gettable(L, tab); 166 lua_gettable(L, tab);
@@ -187,7 +187,7 @@ static void return_fd(lua_State *L, fd_set *set, t_socket max_fd,
187 for (fd = 0; fd < max_fd; fd++) { 187 for (fd = 0; fd < max_fd; fd++) {
188 if (FD_ISSET(fd, set)) { 188 if (FD_ISSET(fd, set)) {
189 lua_pushnumber(L, ++start); 189 lua_pushnumber(L, ++start);
190 lua_pushnumber(L, fd); 190 lua_pushnumber(L, (lua_Number) fd);
191 lua_gettable(L, itab); 191 lua_gettable(L, itab);
192 lua_settable(L, tab); 192 lua_settable(L, tab);
193 } 193 }
@@ -197,7 +197,7 @@ static void return_fd(lua_State *L, fd_set *set, t_socket max_fd,
197static void make_assoc(lua_State *L, int tab) { 197static void make_assoc(lua_State *L, int tab) {
198 int i = 1, atab; 198 int i = 1, atab;
199 lua_newtable(L); atab = lua_gettop(L); 199 lua_newtable(L); atab = lua_gettop(L);
200 while (1) { 200 for ( ;; ) {
201 lua_pushnumber(L, i); 201 lua_pushnumber(L, i);
202 lua_gettable(L, tab); 202 lua_gettable(L, tab);
203 if (!lua_isnil(L, -1)) { 203 if (!lua_isnil(L, -1)) {