Replace fprintfs with RARCH_LOG/RARCH_ERR

This commit is contained in:
twinaphex 2020-05-24 19:29:55 +02:00
parent bcbad532e6
commit e030986837
6 changed files with 19 additions and 15 deletions

View File

@ -105,8 +105,11 @@ static bool ra_alive(void *data)
static void ra_set_nonblock_state(void *data, bool state) static void ra_set_nonblock_state(void *data, bool state)
{ {
roar_t *roar = (roar_t*)data; roar_t *roar = (roar_t*)data;
if (roar_vs_blocking(roar->vss, (state) ? ROAR_VS_FALSE : ROAR_VS_TRUE, NULL) < 0) if (roar_vs_blocking(roar->vss, (state) ? ROAR_VS_FALSE : ROAR_VS_TRUE, NULL) < 0)
fprintf(stderr, "RetroArch [ERROR]: Can't set nonblocking. Will not be able to fast-forward.\n"); {
RARCH_ERR("Can't set nonblocking. Will not be able to fast-forward.\n");
}
roar->nonblocking = state; roar->nonblocking = state;
} }

View File

@ -1538,7 +1538,7 @@ static struct pcm_params *pcm_params_get(unsigned int card, unsigned int device,
param_init(params); param_init(params);
if (ioctl(fd, SNDRV_PCM_IOCTL_HW_REFINE, params)) if (ioctl(fd, SNDRV_PCM_IOCTL_HW_REFINE, params))
{ {
fprintf(stderr, "SNDRV_PCM_IOCTL_HW_REFINE error (%d)\n", errno); RARCH_ERR("[TINYALSA] SNDRV_PCM_IOCTL_HW_REFINE error (%d)\n", errno);
goto err_hw_refine; goto err_hw_refine;
} }
@ -2019,7 +2019,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
avail = pcm_avail_update(pcm); avail = pcm_avail_update(pcm);
if (avail < 0) if (avail < 0)
{ {
fprintf(stderr, "cannot determine available mmap frames"); RARCH_ERR("[TINYALSA] Cannot determine available mmap frames");
return err; return err;
} }
@ -2029,7 +2029,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
{ {
if (pcm_start(pcm) < 0) if (pcm_start(pcm) < 0)
{ {
fprintf(stderr, "start error: hw 0x%x app 0x%x avail 0x%x\n", RARCH_ERR("[TINYALSA] Start error: hw 0x%x app 0x%x avail 0x%x\n",
(unsigned int)pcm->mmap_status->hw_ptr, (unsigned int)pcm->mmap_status->hw_ptr,
(unsigned int)pcm->mmap_control->appl_ptr, (unsigned int)pcm->mmap_control->appl_ptr,
avail); avail);
@ -2052,7 +2052,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
{ {
pcm->prepared = 0; pcm->prepared = 0;
pcm->running = 0; pcm->running = 0;
fprintf(stderr, "wait error: hw 0x%x app 0x%x avail 0x%x\n", RARCH_ERR("[TINYALSA] Wait error: hw 0x%x app 0x%x avail 0x%x\n",
(unsigned int)pcm->mmap_status->hw_ptr, (unsigned int)pcm->mmap_status->hw_ptr,
(unsigned int)pcm->mmap_control->appl_ptr, (unsigned int)pcm->mmap_control->appl_ptr,
avail); avail);
@ -2073,7 +2073,7 @@ static int pcm_mmap_transfer(struct pcm *pcm, const void *buffer, unsigned int b
frames = pcm_mmap_transfer_areas(pcm, (void *)buffer, offset, frames); frames = pcm_mmap_transfer_areas(pcm, (void *)buffer, offset, frames);
if (frames < 0) if (frames < 0)
{ {
fprintf(stderr, "write error: hw 0x%x app 0x%x avail 0x%x\n", RARCH_ERR("[TINYALSA] Write error: hw 0x%x app 0x%x avail 0x%x\n",
(unsigned int)pcm->mmap_status->hw_ptr, (unsigned int)pcm->mmap_status->hw_ptr,
(unsigned int)pcm->mmap_control->appl_ptr, (unsigned int)pcm->mmap_control->appl_ptr,
avail); avail);

View File

@ -70,9 +70,10 @@ static void *sdl_dingux_gfx_init(const video_info_t *video,
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
FILE* f = fopen("/sys/devices/platform/jz-lcd.0/allow_downscaling", "w"); FILE* f = fopen("/sys/devices/platform/jz-lcd.0/allow_downscaling", "w");
if (f) { if (f)
fprintf(f, "%d", 1); {
fclose(f); fprintf(f, "%d", 1);
fclose(f);
} }
if (SDL_WasInit(0) == 0) if (SDL_WasInit(0) == 0)

View File

@ -419,7 +419,7 @@ static bool sixel_gfx_frame(void *data, const void *frame,
if (SIXEL_FAILED(sixel->sixel_status)) if (SIXEL_FAILED(sixel->sixel_status))
{ {
fprintf(stderr, "%s\n%s\n", RARCH_ERR("%s\n%s\n",
sixel_helper_format_error(sixel->sixel_status), sixel_helper_format_error(sixel->sixel_status),
sixel_helper_get_additional_message()); sixel_helper_get_additional_message());
} }

View File

@ -95,8 +95,8 @@ static void osmesa_fifo_open(gfx_ctx_osmesa_data_t *osmesa)
return; return;
} }
fprintf(stderr, "[osmesa] Frame size is %ix%ix%i\n", osmesa->width, osmesa->height, osmesa->pixsize); RARCH_ERR("[osmesa] Frame size is %ix%ix%i\n", osmesa->width, osmesa->height, osmesa->pixsize);
fprintf(stderr, "[osmesa] Please connect to unix:%s\n", g_osmesa_fifo); RARCH_ERR("[osmesa] Please connect to unix:%s\n", g_osmesa_fifo);
} }
static void osmesa_fifo_accept(gfx_ctx_osmesa_data_t *osmesa) static void osmesa_fifo_accept(gfx_ctx_osmesa_data_t *osmesa)
@ -116,7 +116,7 @@ static void osmesa_fifo_accept(gfx_ctx_osmesa_data_t *osmesa)
else if (res > 0) else if (res > 0)
{ {
osmesa->client = accept(osmesa->socket, NULL, NULL); osmesa->client = accept(osmesa->socket, NULL, NULL);
fprintf(stderr, "[osmesa] Client %i connected.\n", osmesa->client); RARCH_LOG("[osmesa] Client %i connected.\n", osmesa->client);
} }
} }
@ -134,7 +134,7 @@ static void osmesa_fifo_write(gfx_ctx_osmesa_data_t *osmesa)
if (res < 0) if (res < 0)
{ {
fprintf(stderr, "[osmesa] Lost connection to %i: %s\n", osmesa->client, strerror(errno)); RARCH_LOG("[osmesa] Lost connection to %i: %s\n", osmesa->client, strerror(errno));
close(osmesa->client); close(osmesa->client);
osmesa->client = -1; osmesa->client = -1;
break; break;

View File

@ -407,7 +407,7 @@ bool glslang::compile_spirv(const string &source, Stage stage,
100, ENoProfile, false, false, 100, ENoProfile, false, false,
messages, &msg, forbid_include)) messages, &msg, forbid_include))
{ {
fprintf(stderr, "%s\n", msg.c_str()); RARCH_ERR("%s\n", msg.c_str());
return false; return false;
} }