diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-31 11:25:18 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-31 11:25:18 -0300 |
| commit | 90de38bf1f85714526c30e42b670ca997ec45827 (patch) | |
| tree | c9dbf61d741ddd2ededcba4c1a4da99211c28f7a /lobject.c | |
| parent | e8a7ecb982effdfc1148098b288c6ac7130f756e (diff) | |
| download | lua-90de38bf1f85714526c30e42b670ca997ec45827.tar.gz lua-90de38bf1f85714526c30e42b670ca997ec45827.tar.bz2 lua-90de38bf1f85714526c30e42b670ca997ec45827.zip | |
warnings in VS .Net
Diffstat (limited to 'lobject.c')
| -rw-r--r-- | lobject.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 2.13 2005/05/16 21:19:00 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.14 2005/05/20 15:53:42 roberto Exp roberto $ |
| 3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -159,7 +159,7 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { | |||
| 159 | fmt = e+2; | 159 | fmt = e+2; |
| 160 | } | 160 | } |
| 161 | pushstr(L, fmt); | 161 | pushstr(L, fmt); |
| 162 | luaV_concat(L, n+1, L->top - L->base - 1); | 162 | luaV_concat(L, n+1, cast(int, L->top - L->base) - 1); |
| 163 | L->top -= n; | 163 | L->top -= n; |
| 164 | return svalue(L->top - 1); | 164 | return svalue(L->top - 1); |
| 165 | } | 165 | } |
| @@ -175,26 +175,26 @@ const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { | |||
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | 177 | ||
| 178 | void luaO_chunkid (char *out, const char *source, int bufflen) { | 178 | void luaO_chunkid (char *out, const char *source, size_t bufflen) { |
| 179 | if (*source == '=') { | 179 | if (*source == '=') { |
| 180 | strncpy(out, source+1, bufflen); /* remove first char */ | 180 | strncpy(out, source+1, bufflen); /* remove first char */ |
| 181 | out[bufflen-1] = '\0'; /* ensures null termination */ | 181 | out[bufflen-1] = '\0'; /* ensures null termination */ |
| 182 | } | 182 | } |
| 183 | else { /* out = "source", or "...source" */ | 183 | else { /* out = "source", or "...source" */ |
| 184 | if (*source == '@') { | 184 | if (*source == '@') { |
| 185 | int l; | 185 | size_t l; |
| 186 | source++; /* skip the `@' */ | 186 | source++; /* skip the `@' */ |
| 187 | bufflen -= sizeof(" '...' "); | 187 | bufflen -= sizeof(" '...' "); |
| 188 | l = strlen(source); | 188 | l = strlen(source); |
| 189 | strcpy(out, ""); | 189 | strcpy(out, ""); |
| 190 | if (l>bufflen) { | 190 | if (l > bufflen) { |
| 191 | source += (l-bufflen); /* get last part of file name */ | 191 | source += (l-bufflen); /* get last part of file name */ |
| 192 | strcat(out, "..."); | 192 | strcat(out, "..."); |
| 193 | } | 193 | } |
| 194 | strcat(out, source); | 194 | strcat(out, source); |
| 195 | } | 195 | } |
| 196 | else { /* out = [string "string"] */ | 196 | else { /* out = [string "string"] */ |
| 197 | int len = strcspn(source, "\n\r"); /* stop at first newline */ | 197 | size_t len = strcspn(source, "\n\r"); /* stop at first newline */ |
| 198 | bufflen -= sizeof(" [string \"...\"] "); | 198 | bufflen -= sizeof(" [string \"...\"] "); |
| 199 | if (len > bufflen) len = bufflen; | 199 | if (len > bufflen) len = bufflen; |
| 200 | strcpy(out, "[string \""); | 200 | strcpy(out, "[string \""); |
