From 7a89a38d17c0efa14a78cf858ac6bd082e889c3f Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 18 Sep 2024 10:57:30 -0700
Subject: [PATCH] Updated to the latest version of SDL
---
include/SDL3_rtf/SDL_rtf.h | 12 ++++++------
src/SDL_rtf.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/SDL3_rtf/SDL_rtf.h b/include/SDL3_rtf/SDL_rtf.h
index e512c22..1311159 100644
--- a/include/SDL3_rtf/SDL_rtf.h
+++ b/include/SDL3_rtf/SDL_rtf.h
@@ -147,19 +147,19 @@ extern SDL_DECLSPEC RTF_Context * SDLCALL RTF_CreateContext(SDL_Renderer *render
*
* \param ctx the RTF context to update.
* \param file the file path to load RTF data from.
- * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
+ * \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL_rtf 3.0.0.
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL RTF_Load(RTF_Context *ctx, const char *file);
+extern SDL_DECLSPEC bool SDLCALL RTF_Load(RTF_Context *ctx, const char *file);
/**
* Set the text of an RTF context, with data loaded from an SDL_IOStream.
*
* This can be called multiple times to change the text displayed.
*
- * If `closeio` is SDL_TRUE, this function will close `src`, whether this
+ * If `closeio` is true, this function will close `src`, whether this
* function succeeded or not.
*
* On failure, call RTF_GetError() to get a human-readable text message
@@ -167,14 +167,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL RTF_Load(RTF_Context *ctx, const char *file
*
* \param ctx the RTF context to update.
* \param src the SDL_IOStream to load RTF data from.
- * \param closeio SDL_TRUE to close `src` when the font is closed, SDL_FALSE
+ * \param closeio true to close `src` when the font is closed, false
* to leave it open.
- * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
+ * \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL_rtf 3.0.0.
*/
-extern SDL_DECLSPEC SDL_bool SDLCALL RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio);
+extern SDL_DECLSPEC bool SDLCALL RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, bool closeio);
/**
* Get the title of an RTF document.
diff --git a/src/SDL_rtf.c b/src/SDL_rtf.c
index 2fb8d83..a82d6a3 100644
--- a/src/SDL_rtf.c
+++ b/src/SDL_rtf.c
@@ -63,12 +63,12 @@ RTF_Context *RTF_CreateContext(SDL_Renderer *renderer, RTF_FontEngine *fontEngin
}
/* Set the text of an RTF context.
- * This function returns SDL_TRUE if it succeeds or SDL_FALSE if it fails.
+ * This function returns true if it succeeds or false if it fails.
* Use SDL_GetError() to get a text message corresponding to the error.
*/
-SDL_bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio)
+bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, bool closeio)
{
- SDL_bool retval;
+ bool retval;
ecClearContext(ctx);
@@ -83,7 +83,7 @@ SDL_bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio)
/* Parse the RTF text and clean up */
switch (ecRtfParse(ctx)) {
case ecOK:
- retval = SDL_TRUE;
+ retval = true;
break;
case ecStackUnderflow:
retval = SDL_SetError("Unmatched '}'");
@@ -124,11 +124,11 @@ SDL_bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio)
return retval;
}
-SDL_bool RTF_Load(RTF_Context *ctx, const char *file)
+bool RTF_Load(RTF_Context *ctx, const char *file)
{
SDL_IOStream *src = SDL_IOFromFile(file, "rb");
if (!src) {
- return SDL_FALSE;
+ return false;
}
return RTF_Load_IO(ctx, src, 1);
}