Fixup C++ build.

This commit is contained in:
Themaister 2012-04-09 22:30:29 +02:00
parent 0dff4dad52
commit 9f0211d9d7
6 changed files with 11 additions and 11 deletions

View File

@ -63,7 +63,7 @@ static ssize_t ra_write(void *data, const void *buf, size_t size)
while (written < size)
{
size_t write_amt = size - written;
if ((rc = roar_vs_write(roar->vss, (const char*)buf + written, write_amt, &err)) < write_amt)
if ((rc = roar_vs_write(roar->vss, (const char*)buf + written, write_amt, &err)) < (ssize_t)write_amt)
{
if (roar->nonblocking)
return rc;

4
file.c
View File

@ -496,7 +496,7 @@ bool load_state(const char *path)
void load_ram_file(const char *path, int type)
{
size_t size = pretro_get_memory_size(type);
uint8_t *data = pretro_get_memory_data(type);
void *data = pretro_get_memory_data(type);
if (size == 0 || !data)
return;
@ -512,7 +512,7 @@ void load_ram_file(const char *path, int type)
void save_ram_file(const char *path, int type)
{
size_t size = pretro_get_memory_size(type);
uint8_t *data = pretro_get_memory_data(type);
void *data = pretro_get_memory_data(type);
if (data && size > 0)
{

View File

@ -695,7 +695,7 @@ static bool load_imports(const char *dir_path, config_file_t *conf)
id = strtok(NULL, ";");
}
tracker_info.wram = pretro_get_memory_data(RETRO_MEMORY_SYSTEM_RAM);
tracker_info.wram = (uint8_t*)pretro_get_memory_data(RETRO_MEMORY_SYSTEM_RAM);
tracker_info.info = info;
tracker_info.info_elem = info_cnt;

View File

@ -959,7 +959,7 @@ bool gl_glsl_init(const char *path)
if (gl_tracker_info_cnt > 0)
{
struct state_tracker_info info = {0};
info.wram = pretro_get_memory_data(RETRO_MEMORY_SYSTEM_RAM);
info.wram = (uint8_t*)pretro_get_memory_data(RETRO_MEMORY_SYSTEM_RAM);
info.info = gl_tracker_info;
info.info_elem = gl_tracker_info_cnt;

View File

@ -412,6 +412,7 @@ static void *xv_init(const video_info_t *video, const input_driver_t **input, vo
void *xinput = NULL;
XVisualInfo *visualinfo = NULL;
XVisualInfo visualtemplate = {0};
const struct retro_game_geometry *geom = &g_extern.system.av_info.geometry;
if (!XShmQueryExtension(xv->display))
{
@ -465,7 +466,6 @@ static void *xv_init(const video_info_t *video, const input_driver_t **input, vo
attributes.border_pixel = 0;
attributes.event_mask = StructureNotifyMask | DestroyNotify | ClientMessage;
const struct retro_game_geometry *geom = &g_extern.system.av_info.geometry;
width = video->fullscreen ? ((video->width == 0) ? geom->base_width : video->width) : video->width;
height = video->fullscreen ? ((video->height == 0) ? geom->base_height : video->height) : video->height;
xv->window = XCreateWindow(xv->display, DefaultRootWindow(xv->display),
@ -650,7 +650,7 @@ static void xv_render_msg(xv_t *xv, const char *msg, unsigned width, unsigned he
int base_y = _base_y - head->off_y;
if (base_y >= 0)
{
for (int y = 0; y < (int)head->height && (base_y + y) < height; y++)
for (int y = 0; y < (int)head->height && (base_y + y) < (int)height; y++)
{
if (base_x < 0)
continue;
@ -658,12 +658,12 @@ static void xv_render_msg(xv_t *xv, const char *msg, unsigned width, unsigned he
const uint8_t *a = head->output + head->pitch * y;
uint8_t *out = (uint8_t*)xv->image->data + (base_y - head->height + y) * pitch + base_x;
for (int x = 0; x < (head->width << 1) && (base_x + x) < pitch; x += 4)
for (int x = 0; x < (int)(head->width << 1) && (base_x + x) < (int)pitch; x += 4)
{
unsigned alpha[2];
alpha[0] = a[(x >> 1) + 0];
if (((x >> 1) + 1) == head->width) // We reached the end, uhoh. Branching like a BOSS. :D
if (((x >> 1) + 1) == (int)head->width) // We reached the end, uhoh. Branching like a BOSS. :D
alpha[1] = 0;
else
alpha[1] = a[(x >> 1) + 1];

View File

@ -95,7 +95,7 @@ static void take_screenshot(void)
bool ret = false;
if (g_extern.frame_cache.data)
{
const uint16_t *data = g_extern.frame_cache.data;
const uint16_t *data = (const uint16_t*)g_extern.frame_cache.data;
unsigned width = g_extern.frame_cache.width;
unsigned height = g_extern.frame_cache.height;
size_t pitch = g_extern.frame_cache.pitch;
@ -182,7 +182,7 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
unsigned oheight = height;
g_extern.filter.psize(&owidth, &oheight);
g_extern.filter.prender(g_extern.filter.colormap, g_extern.filter.buffer,
g_extern.filter.pitch, data, pitch, width, height);
g_extern.filter.pitch, (const uint16_t*)data, pitch, width, height);
#ifdef HAVE_FFMPEG
if (g_extern.recording && g_settings.video.post_filter_record)