Standardize on uintptr_t (fixes issue on Android)
This commit is contained in:
@@ -210,7 +210,7 @@ namespace lime {
|
||||
|
||||
value lime_bytes_from_data_pointer (double data, int length) {
|
||||
|
||||
intptr_t ptr = (intptr_t)data;
|
||||
uintptr_t ptr = (uintptr_t)data;
|
||||
Bytes bytes (length);
|
||||
|
||||
if (ptr) {
|
||||
@@ -227,7 +227,7 @@ namespace lime {
|
||||
double lime_bytes_get_data_pointer (value bytes) {
|
||||
|
||||
Bytes data = Bytes (bytes);
|
||||
return (intptr_t)data.Data ();
|
||||
return (uintptr_t)data.Data ();
|
||||
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace lime {
|
||||
|
||||
double lime_cffi_get_native_pointer (value handle) {
|
||||
|
||||
return (intptr_t)val_data (handle);
|
||||
return (uintptr_t)val_data (handle);
|
||||
|
||||
}
|
||||
|
||||
@@ -988,7 +988,7 @@ namespace lime {
|
||||
double lime_jni_getenv () {
|
||||
|
||||
#ifdef ANDROID
|
||||
return (intptr_t)JNI::GetEnv ();
|
||||
return (uintptr_t)JNI::GetEnv ();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
@@ -1282,7 +1282,7 @@ namespace lime {
|
||||
double lime_renderer_get_context (value renderer) {
|
||||
|
||||
Renderer* targetRenderer = (Renderer*)val_data (renderer);
|
||||
return (intptr_t)targetRenderer->GetContext ();
|
||||
return (uintptr_t)targetRenderer->GetContext ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace lime {
|
||||
|
||||
alloc_field (result, val_id ("width"), alloc_int (width));
|
||||
alloc_field (result, val_id ("height"), alloc_int (height));
|
||||
alloc_field (result, val_id ("pixels"), alloc_float ((intptr_t)pixels));
|
||||
alloc_field (result, val_id ("pixels"), alloc_float ((uintptr_t)pixels));
|
||||
alloc_field (result, val_id ("pitch"), alloc_int (pitch));
|
||||
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ namespace lime {
|
||||
{
|
||||
/*#ifdef HX_WINDOWS
|
||||
printf("SDKFLJDSLFKJ\n");
|
||||
int fd = _open_osfhandle ((intptr_t)((SDL_RWops*)handle)->hidden.windowsio.h, _O_RDONLY);
|
||||
int fd = _open_osfhandle ((uintptr_t)((SDL_RWops*)handle)->hidden.windowsio.h, _O_RDONLY);
|
||||
|
||||
if (fd != -1) {
|
||||
printf("SDKFLJDSLFKJ\n");
|
||||
|
||||
@@ -440,7 +440,7 @@ namespace lime {
|
||||
|
||||
double lime_cairo_image_surface_get_data (value handle) {
|
||||
|
||||
return (intptr_t)cairo_image_surface_get_data ((cairo_surface_t*)val_data (handle));
|
||||
return (uintptr_t)cairo_image_surface_get_data ((cairo_surface_t*)val_data (handle));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -622,7 +622,7 @@ namespace lime {
|
||||
|
||||
double lime_al_get_proc_address (HxString fname) {
|
||||
|
||||
return (intptr_t)alGetProcAddress (fname.__s);
|
||||
return (uintptr_t)alGetProcAddress (fname.__s);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,21 +9,21 @@ namespace lime {
|
||||
|
||||
void lime_curl_easy_cleanup (double handle) {
|
||||
|
||||
curl_easy_cleanup ((CURL*)(intptr_t)handle);
|
||||
curl_easy_cleanup ((CURL*)(uintptr_t)handle);
|
||||
|
||||
}
|
||||
|
||||
|
||||
double lime_curl_easy_duphandle (double handle) {
|
||||
|
||||
return (intptr_t)curl_easy_duphandle ((CURL*)(intptr_t)handle);
|
||||
return (uintptr_t)curl_easy_duphandle ((CURL*)(uintptr_t)handle);
|
||||
|
||||
}
|
||||
|
||||
|
||||
value lime_curl_easy_escape (double curl, HxString url, int length) {
|
||||
|
||||
char* result = curl_easy_escape ((CURL*)(intptr_t)curl, url.__s, length);
|
||||
char* result = curl_easy_escape ((CURL*)(uintptr_t)curl, url.__s, length);
|
||||
return result ? alloc_string (result) : alloc_null ();
|
||||
|
||||
}
|
||||
@@ -32,7 +32,7 @@ namespace lime {
|
||||
value lime_curl_easy_getinfo (double curl, int info) {
|
||||
|
||||
CURLcode code = CURLE_OK;
|
||||
CURL* handle = (CURL*)(intptr_t)curl;
|
||||
CURL* handle = (CURL*)(uintptr_t)curl;
|
||||
CURLINFO type = (CURLINFO)info;
|
||||
|
||||
switch (type) {
|
||||
@@ -120,21 +120,21 @@ namespace lime {
|
||||
|
||||
double lime_curl_easy_init () {
|
||||
|
||||
return (intptr_t)curl_easy_init ();
|
||||
return (uintptr_t)curl_easy_init ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
int lime_curl_easy_pause (double handle, int bitmask) {
|
||||
|
||||
return curl_easy_pause ((CURL*)(intptr_t)handle, bitmask);
|
||||
return curl_easy_pause ((CURL*)(uintptr_t)handle, bitmask);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int lime_curl_easy_perform (double easy_handle) {
|
||||
|
||||
return curl_easy_perform ((CURL*)(intptr_t)easy_handle);
|
||||
return curl_easy_perform ((CURL*)(uintptr_t)easy_handle);
|
||||
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace lime {
|
||||
|
||||
void lime_curl_easy_reset (double curl) {
|
||||
|
||||
curl_easy_reset ((CURL*)(intptr_t)curl);
|
||||
curl_easy_reset ((CURL*)(uintptr_t)curl);
|
||||
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace lime {
|
||||
int lime_curl_easy_setopt (double handle, int option, value parameter) {
|
||||
|
||||
CURLcode code = CURLE_OK;
|
||||
CURL* curl = (CURL*)(intptr_t)handle;
|
||||
CURL* curl = (CURL*)(uintptr_t)handle;
|
||||
CURLoption type = (CURLoption)option;
|
||||
|
||||
switch (type) {
|
||||
@@ -513,7 +513,7 @@ namespace lime {
|
||||
|
||||
value lime_curl_easy_unescape (double curl, HxString url, int inlength, int outlength) {
|
||||
|
||||
char* result = curl_easy_unescape ((CURL*)(intptr_t)curl, url.__s, inlength, &outlength);
|
||||
char* result = curl_easy_unescape ((CURL*)(uintptr_t)curl, url.__s, inlength, &outlength);
|
||||
return result ? alloc_string (result) : alloc_null ();
|
||||
|
||||
}
|
||||
|
||||
@@ -1959,7 +1959,7 @@ namespace lime {
|
||||
double lime_jni_get_env () {
|
||||
|
||||
JNIEnv *env = (JNIEnv*)JNI::GetEnv ();
|
||||
return (intptr_t)env;
|
||||
return (uintptr_t)env;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user