1010#include <string.h>
1111
1212#if LIBCURL_VERSION_NUM >= 0x072000
13- int curlProgressCallback (curl_state * state , curl_off_t dltotal , curl_off_t dlnow , curl_off_t ultotal , curl_off_t ulnow )
13+ int curlProgressCallback (void * stateptr , curl_off_t dltotal , curl_off_t dlnow , curl_off_t ultotal , curl_off_t ulnow )
1414#else
1515int curlProgressCallback (curl_state * state , double dltotal , double dlnow , double ultotal , double ulnow )
1616#endif
1717{
18+ curl_state * state = ((curl_state * )stateptr );
1819 lua_State * L = state -> L ;
1920
2021 (void )ultotal ;
@@ -90,9 +91,9 @@ CURL* curlRequest(lua_State* L, curl_state* state, int optionsIndex, int progres
9091 strcat (agent , PREMAKE_VERSION );
9192
9293 curl_easy_setopt (curl , CURLOPT_URL , luaL_checkstring (L , 1 ));
93- curl_easy_setopt (curl , CURLOPT_FOLLOWLOCATION , 1 );
94- curl_easy_setopt (curl , CURLOPT_NOPROGRESS , 1 );
95- curl_easy_setopt (curl , CURLOPT_FAILONERROR , 1 );
94+ curl_easy_setopt (curl , CURLOPT_FOLLOWLOCATION , 1L );
95+ curl_easy_setopt (curl , CURLOPT_NOPROGRESS , 1L );
96+ curl_easy_setopt (curl , CURLOPT_FAILONERROR , 1L );
9697 curl_easy_setopt (curl , CURLOPT_ERRORBUFFER , state -> errorBuffer );
9798 curl_easy_setopt (curl , CURLOPT_USERAGENT , agent );
9899
@@ -102,8 +103,8 @@ CURL* curlRequest(lua_State* L, curl_state* state, int optionsIndex, int progres
102103 lua_gettable (L , -2 );
103104 if (!lua_isnil (L , -1 ))
104105 {
105- curl_easy_setopt (curl , CURLOPT_SSL_VERIFYHOST , 0 );
106- curl_easy_setopt (curl , CURLOPT_SSL_VERIFYPEER , 0 );
106+ curl_easy_setopt (curl , CURLOPT_SSL_VERIFYHOST , 0L );
107+ curl_easy_setopt (curl , CURLOPT_SSL_VERIFYPEER , 0L );
107108 }
108109 lua_pop (L , 2 );
109110
@@ -184,7 +185,7 @@ CURL* curlRequest(lua_State* L, curl_state* state, int optionsIndex, int progres
184185
185186 if (state -> L != 0 )
186187 {
187- curl_easy_setopt (curl , CURLOPT_NOPROGRESS , 0 );
188+ curl_easy_setopt (curl , CURLOPT_NOPROGRESS , 0L );
188189 curl_easy_setopt (curl , CURLOPT_PROGRESSDATA , state );
189190#if LIBCURL_VERSION_NUM >= 0x072000
190191 curl_easy_setopt (curl , CURLOPT_XFERINFOFUNCTION , curlProgressCallback );
0 commit comments