diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-04 18:31:59 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-04 21:12:12 +0900 |
commit | 1e4fe94fcf03e933af64681bbda8aba22724679d (patch) | |
tree | c6d5c47248d87408706e520231258f3e6af3db7e /src/tempfiles.c | |
parent | 36afce6e3c868cf3b7d348b0a6f251898888d931 (diff) | |
download | libr-r14.1.4.tar.gz libr-r14.1.4.zip |
Replace TRUE/FALSE with boolean values true/falser14.1.4
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 090b467fe2ab0274cee1e20b46fc1eec05f40bb8)
Diffstat (limited to 'src/tempfiles.c')
-rw-r--r-- | src/tempfiles.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/tempfiles.c b/src/tempfiles.c index e4f633f..47c3091 100644 --- a/src/tempfiles.c +++ b/src/tempfiles.c @@ -28,6 +28,7 @@ /* For malloc/free and mkdtemp */ #include <stdlib.h> +#include <stdbool.h> /* For string handling */ #include <string.h> @@ -46,13 +47,6 @@ #include <sys/syslimits.h> #endif -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - #ifndef DOXYGEN_SHOULD_SKIP_THIS /* Hold on to folder names for cleanup when libr is removed from memory */ @@ -64,7 +58,7 @@ CleanupFolder *folders_to_remove = NULL; /* Hold on to libr handles for cleanup when libr is removed from memory */ typedef struct CLEANUPHANDLE { - int internal; /* do not warn the user about cleaning this handle up */ + bool internal; /* do not warn the user about cleaning this handle up */ libr_file *handle; struct CLEANUPHANDLE *next; } CleanupHandle; @@ -100,7 +94,7 @@ void register_handle_cleanup(libr_file *handle) CleanupHandle *h = malloc(sizeof(CleanupHandle)); h->handle = handle; - h->internal = FALSE; + h->internal = false; h->next = NULL; if(handles_to_remove != NULL) { @@ -119,7 +113,7 @@ void register_handle_cleanup(libr_file *handle) void unregister_handle_cleanup(libr_file *handle) { CleanupHandle *i, *last = NULL; - int found = FALSE; + bool found = false; if(handles_to_remove == NULL) { @@ -135,7 +129,7 @@ void unregister_handle_cleanup(libr_file *handle) else last->next = i->next; free(i); - found = TRUE; + found = true; break; } } @@ -148,7 +142,7 @@ void unregister_handle_cleanup(libr_file *handle) */ void register_internal_handle(libr_file *handle) { - int found = FALSE; + bool found = false; CleanupHandle *i; if(handles_to_remove == NULL) @@ -160,8 +154,8 @@ void register_internal_handle(libr_file *handle) { if(i->handle == handle) { - i->internal = TRUE; - found = TRUE; + i->internal = true; + found = true; break; } } |