Browse Source

Make SaveFile* callbacks return a boolean (#1697)

pull/1707/head
Rob Loach 3 years ago
committed by GitHub
parent
commit
d58b7b509e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions
  1. +2
    -2
      src/raylib.h
  2. +2
    -4
      src/utils.c

+ 2
- 2
src/raylib.h View File

@ -880,9 +880,9 @@ typedef enum {
// WARNING: This callbacks are intended for advance users
typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); // Logging: Redirect trace log messages
typedef unsigned char* (*LoadFileDataCallback)(const char* fileName, unsigned int* bytesRead); // FileIO: Load binary data
typedef void (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data
typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned int bytesToWrite); // FileIO: Save binary data
typedef char *(*LoadFileTextCallback)(const char* fileName); // FileIO: Load text data
typedef void (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data
typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data
#if defined(__cplusplus)

+ 2
- 4
src/utils.c View File

@ -245,8 +245,7 @@ bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite)
{
if (saveFileData)
{
saveFileData(fileName, data, bytesToWrite);
return success;
return saveFileData(fileName, data, bytesToWrite);
}
#if defined(SUPPORT_STANDARD_FILEIO)
FILE *file = fopen(fileName, "wb");
@ -340,8 +339,7 @@ bool SaveFileText(const char *fileName, char *text)
{
if (saveFileText)
{
saveFileText(fileName, text);
return success;
return saveFileText(fileName, text);
}
#if defined(SUPPORT_STANDARD_FILEIO)
FILE *file = fopen(fileName, "wt");

Loading…
Cancel
Save