aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Gatzka <stephan.gatzka@gmail.com>2014-12-21 06:57:10 +0100
committerStephan Gatzka <stephan.gatzka@gmail.com>2014-12-21 06:57:10 +0100
commit41692dfb4bfb87f6f841f1124483d88a95d9df22 (patch)
tree23a410c4251354719e9e4522627b91382811b3c6
parent5edf093643cceb329392aec9606ab3988579b821 (diff)
downloadluasocket-41692dfb4bfb87f6f841f1124483d88a95d9df22.tar.gz
luasocket-41692dfb4bfb87f6f841f1124483d88a95d9df22.tar.bz2
luasocket-41692dfb4bfb87f6f841f1124483d88a95d9df22.zip
Make casts const correct.
-rw-r--r--src/mime.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mime.c b/src/mime.c
index dd37dcf..a35a2c3 100644
--- a/src/mime.c
+++ b/src/mime.c
@@ -111,7 +111,7 @@ static int mime_global_wrp(lua_State *L)
111{ 111{
112 size_t size = 0; 112 size_t size = 0;
113 int left = (int) luaL_checknumber(L, 1); 113 int left = (int) luaL_checknumber(L, 1);
114 const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size); 114 const UC *input = (const UC *) luaL_optlstring(L, 2, NULL, &size);
115 const UC *last = input + size; 115 const UC *last = input + size;
116 int length = (int) luaL_optnumber(L, 3, 76); 116 int length = (int) luaL_optnumber(L, 3, 76);
117 luaL_Buffer buffer; 117 luaL_Buffer buffer;
@@ -259,7 +259,7 @@ static int mime_global_b64(lua_State *L)
259{ 259{
260 UC atom[3]; 260 UC atom[3];
261 size_t isize = 0, asize = 0; 261 size_t isize = 0, asize = 0;
262 const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); 262 const UC *input = (const UC *) luaL_optlstring(L, 1, NULL, &isize);
263 const UC *last = input + isize; 263 const UC *last = input + isize;
264 luaL_Buffer buffer; 264 luaL_Buffer buffer;
265 /* end-of-input blackhole */ 265 /* end-of-input blackhole */
@@ -274,7 +274,7 @@ static int mime_global_b64(lua_State *L)
274 luaL_buffinit(L, &buffer); 274 luaL_buffinit(L, &buffer);
275 while (input < last) 275 while (input < last)
276 asize = b64encode(*input++, atom, asize, &buffer); 276 asize = b64encode(*input++, atom, asize, &buffer);
277 input = (UC *) luaL_optlstring(L, 2, NULL, &isize); 277 input = (const UC *) luaL_optlstring(L, 2, NULL, &isize);
278 /* if second part is nil, we are done */ 278 /* if second part is nil, we are done */
279 if (!input) { 279 if (!input) {
280 size_t osize = 0; 280 size_t osize = 0;
@@ -305,7 +305,7 @@ static int mime_global_unb64(lua_State *L)
305{ 305{
306 UC atom[4]; 306 UC atom[4];
307 size_t isize = 0, asize = 0; 307 size_t isize = 0, asize = 0;
308 const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); 308 const UC *input = (const UC *) luaL_optlstring(L, 1, NULL, &isize);
309 const UC *last = input + isize; 309 const UC *last = input + isize;
310 luaL_Buffer buffer; 310 luaL_Buffer buffer;
311 /* end-of-input blackhole */ 311 /* end-of-input blackhole */
@@ -320,7 +320,7 @@ static int mime_global_unb64(lua_State *L)
320 luaL_buffinit(L, &buffer); 320 luaL_buffinit(L, &buffer);
321 while (input < last) 321 while (input < last)
322 asize = b64decode(*input++, atom, asize, &buffer); 322 asize = b64decode(*input++, atom, asize, &buffer);
323 input = (UC *) luaL_optlstring(L, 2, NULL, &isize); 323 input = (const UC *) luaL_optlstring(L, 2, NULL, &isize);
324 /* if second is nil, we are done */ 324 /* if second is nil, we are done */
325 if (!input) { 325 if (!input) {
326 size_t osize = 0; 326 size_t osize = 0;
@@ -457,7 +457,7 @@ static int mime_global_qp(lua_State *L)
457 457
458 size_t asize = 0, isize = 0; 458 size_t asize = 0, isize = 0;
459 UC atom[3]; 459 UC atom[3];
460 const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); 460 const UC *input = (const UC *) luaL_optlstring(L, 1, NULL, &isize);
461 const UC *last = input + isize; 461 const UC *last = input + isize;
462 const char *marker = luaL_optstring(L, 3, CRLF); 462 const char *marker = luaL_optstring(L, 3, CRLF);
463 luaL_Buffer buffer; 463 luaL_Buffer buffer;
@@ -473,7 +473,7 @@ static int mime_global_qp(lua_State *L)
473 luaL_buffinit(L, &buffer); 473 luaL_buffinit(L, &buffer);
474 while (input < last) 474 while (input < last)
475 asize = qpencode(*input++, atom, asize, marker, &buffer); 475 asize = qpencode(*input++, atom, asize, marker, &buffer);
476 input = (UC *) luaL_optlstring(L, 2, NULL, &isize); 476 input = (const UC *) luaL_optlstring(L, 2, NULL, &isize);
477 /* if second part is nil, we are done */ 477 /* if second part is nil, we are done */
478 if (!input) { 478 if (!input) {
479 asize = qppad(atom, asize, &buffer); 479 asize = qppad(atom, asize, &buffer);
@@ -533,7 +533,7 @@ static int mime_global_unqp(lua_State *L)
533{ 533{
534 size_t asize = 0, isize = 0; 534 size_t asize = 0, isize = 0;
535 UC atom[3]; 535 UC atom[3];
536 const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize); 536 const UC *input = (const UC *) luaL_optlstring(L, 1, NULL, &isize);
537 const UC *last = input + isize; 537 const UC *last = input + isize;
538 luaL_Buffer buffer; 538 luaL_Buffer buffer;
539 /* end-of-input blackhole */ 539 /* end-of-input blackhole */
@@ -548,7 +548,7 @@ static int mime_global_unqp(lua_State *L)
548 luaL_buffinit(L, &buffer); 548 luaL_buffinit(L, &buffer);
549 while (input < last) 549 while (input < last)
550 asize = qpdecode(*input++, atom, asize, &buffer); 550 asize = qpdecode(*input++, atom, asize, &buffer);
551 input = (UC *) luaL_optlstring(L, 2, NULL, &isize); 551 input = (const UC *) luaL_optlstring(L, 2, NULL, &isize);
552 /* if second part is nil, we are done */ 552 /* if second part is nil, we are done */
553 if (!input) { 553 if (!input) {
554 luaL_pushresult(&buffer); 554 luaL_pushresult(&buffer);
@@ -578,7 +578,7 @@ static int mime_global_qpwrp(lua_State *L)
578{ 578{
579 size_t size = 0; 579 size_t size = 0;
580 int left = (int) luaL_checknumber(L, 1); 580 int left = (int) luaL_checknumber(L, 1);
581 const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size); 581 const UC *input = (const UC *) luaL_optlstring(L, 2, NULL, &size);
582 const UC *last = input + size; 582 const UC *last = input + size;
583 int length = (int) luaL_optnumber(L, 3, 76); 583 int length = (int) luaL_optnumber(L, 3, 76);
584 luaL_Buffer buffer; 584 luaL_Buffer buffer;