[Bf-blender-cvs] [a32f447c542] master: Cleanup: remove NULL check and outdated comment

Campbell Barton noreply at git.blender.org
Tue Apr 26 06:03:24 CEST 2022


Commit: a32f447c54255fd1b283757fa6b2c6ec90212f4e
Author: Campbell Barton
Date:   Tue Apr 26 14:02:49 2022 +1000
Branches: master
https://developer.blender.org/rBa32f447c54255fd1b283757fa6b2c6ec90212f4e

Cleanup: remove NULL check and outdated comment

===================================================================

M	source/blender/blenkernel/BKE_text.h
M	source/blender/blenkernel/intern/text.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index 2bc019be288..edac64879e0 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -38,13 +38,14 @@ bool BKE_text_reload(struct Text *text);
 struct Text *BKE_text_load_ex(struct Main *bmain,
                               const char *filepath,
                               const char *relbase,
-                              bool is_internal);
+                              bool is_internal) ATTR_NONNULL(1, 2, 3);
 /**
  * Load a text file.
  *
  * \note Text data-blocks have no user by default, only the 'real user' flag.
  */
-struct Text *BKE_text_load(struct Main *bmain, const char *filepath, const char *relbase);
+struct Text *BKE_text_load(struct Main *bmain, const char *filepath, const char *relbase)
+    ATTR_NONNULL(1, 2, 3);
 void BKE_text_clear(struct Text *text) ATTR_NONNULL(1);
 void BKE_text_write(struct Text *text, const char *str, int str_len) ATTR_NONNULL(1, 2);
 /**
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 6cdb5791c3b..ec6387c9cf6 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -466,9 +466,7 @@ Text *BKE_text_load_ex(Main *bmain,
   BLI_stat_t st;
 
   BLI_strncpy(filepath_abs, filepath, FILE_MAX);
-  if (relbase) { /* Can be NULL (background mode). */
-    BLI_path_abs(filepath_abs, relbase);
-  }
+  BLI_path_abs(filepath_abs, relbase);
 
   buffer = BLI_file_read_text_as_mem(filepath_abs, 0, &buffer_len);
   if (buffer == NULL) {



More information about the Bf-blender-cvs mailing list