Use retro_read_file in more places

This commit is contained in:
twinaphex 2016-01-30 03:58:33 +01:00
parent 9371d3ae48
commit 9ab31824f8
4 changed files with 16 additions and 7 deletions

View File

@ -19,6 +19,7 @@
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <file/file_path.h>
#include <retro_file.h>
#include <string/stdstring.h>
#include "../../general.h"
@ -463,7 +464,8 @@ static bool gl_glsl_load_source_path(struct video_shader_pass *pass,
const char *path)
{
ssize_t len;
bool ret = read_file(path, (void**)&pass->source.string.vertex, &len);
bool ret = retro_read_file(path,
(void**)&pass->source.string.vertex, &len);
if (!ret || len <= 0)
return false;
@ -472,7 +474,8 @@ static bool gl_glsl_load_source_path(struct video_shader_pass *pass,
return pass->source.string.fragment && pass->source.string.vertex;
}
static bool gl_glsl_compile_programs(glsl_shader_data_t *glsl, GLuint *gl_prog)
static bool gl_glsl_compile_programs(
glsl_shader_data_t *glsl, GLuint *gl_prog)
{
unsigned i;
@ -487,9 +490,11 @@ static bool gl_glsl_compile_programs(glsl_shader_data_t *glsl, GLuint *gl_prog)
* load the file here, and pretend
* we were really using XML all along.
*/
if (*pass->source.path && !gl_glsl_load_source_path(pass, pass->source.path))
if (*pass->source.path && !gl_glsl_load_source_path(
pass, pass->source.path))
{
RARCH_ERR("Failed to load GLSL shader: %s.\n", pass->source.path);
RARCH_ERR("Failed to load GLSL shader: %s.\n",
pass->source.path);
return false;
}
*pass->source.path = '\0';

View File

@ -21,6 +21,7 @@
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_file.h>
#include "video_state_python.h"
#include "../dynamic.h"
@ -302,7 +303,9 @@ py_state_t *py_state_new(const char *script,
* compiled with MSVC. */
ssize_t len;
char *script_ = NULL;
bool ret = read_file(script, (void**)&script_, &len);
bool ret = retro_read_file
(script, (void**)&script_, &len);
if (!ret || len < 0)
{
RARCH_ERR("Python: Failed to read script\n");

View File

@ -25,6 +25,7 @@
#include <compat/msvc.h>
#include <file/file_path.h>
#include <file/file_archive.h>
#include <retro_file.h>
#include <string/stdstring.h>
#include "patch.h"
@ -491,7 +492,7 @@ static bool apply_patch_content(uint8_t **buf,
ssize_t ret_size = *size;
uint8_t *ret_buf = *buf;
if (!read_file(patch_path, &patch_data, &patch_size))
if (!retro_read_file(patch_path, &patch_data, &patch_size))
return false;
if (patch_size < 0)
return false;

View File

@ -201,7 +201,7 @@ static int database_info_iterate_playlist(
default:
{
ssize_t ret;
int read_from = read_file(name, (void**)&db_state->buf, &ret);
int read_from = retro_read_file(name, (void**)&db_state->buf, &ret);
#ifdef HAVE_ZLIB
const struct file_archive_file_backend *stream_backend =
file_archive_get_default_file_backend();