Cleanup: move endian values from BKE_global into BLI_endian_defines

This change was prompted by D6408 which moves thumbnail extraction into
a shared function that happens use these endian defines but only links
blenlib.

There is no need for these defines to be associated with globals
so move into their own header.
This commit is contained in:
Campbell Barton
2021-06-10 21:05:50 +10:00
parent e4ef8cbf7e
commit 1a72ee4cbe
9 changed files with 45 additions and 18 deletions
-14
View File
@@ -199,20 +199,6 @@ enum {
*/
#define G_FILE_FLAG_ALL_RUNTIME (G_FILE_NO_UI | G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE)
/** ENDIAN_ORDER: indicates what endianness the platform where the file was written had. */
#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined.
#endif
#define L_ENDIAN 1
#define B_ENDIAN 0
#ifdef __BIG_ENDIAN__
# define ENDIAN_ORDER B_ENDIAN
#else
# define ENDIAN_ORDER L_ENDIAN
#endif
/** #Global.moving, signals drawing in (3d) window to denote transform */
enum {
G_TRANSFORM_OBJ = (1 << 0),
@@ -24,13 +24,13 @@
#include "MEM_guardedalloc.h"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_fileops.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_customdata_file.h"
#include "BKE_global.h"
/************************* File Format Definitions ***************************/
@@ -36,6 +36,7 @@
# include <AUD_Special.h>
# endif
# include "BLI_endian_defines.h"
# include "BLI_math_base.h"
# include "BLI_threads.h"
# include "BLI_utildefines.h"
@@ -0,0 +1,38 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
/** \file
* \ingroup bli
*/
/* NOTE: these names are historic and could use a more generic prefix.
* This could be done as part of a bigger refactor. */
/** ENDIAN_ORDER: indicates what endianness the platform where the file was written had. */
#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined.
#endif
#define L_ENDIAN 1
#define B_ENDIAN 0
#ifdef __BIG_ENDIAN__
# define ENDIAN_ORDER B_ENDIAN
#else
# define ENDIAN_ORDER L_ENDIAN
#endif
@@ -62,6 +62,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_ghash.h"
#include "BLI_linklist.h"
@@ -100,6 +100,7 @@
#include "BLI_bitmap.h"
#include "BLI_blenlib.h"
#include "BLI_endian_defines.h"
#include "BLI_mempool.h"
#include "MEM_guardedalloc.h" /* MEM_freeN */
+1 -2
View File
@@ -24,6 +24,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_fileops.h"
#include "BLI_ghash.h"
@@ -40,8 +41,6 @@
#include "IMB_indexer.h"
#include "imbuf.h"
#include "BKE_global.h"
#ifdef WITH_AVI
# include "AVI_avi.h"
#endif
+1
View File
@@ -38,6 +38,7 @@
#include "imbuf.h"
#include "BLI_endian_defines.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
@@ -35,6 +35,7 @@
#include "IMB_imbuf_types.h"
#include "BLI_blenlib.h"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_fileops.h"
#include "BLI_fileops_types.h"
@@ -44,7 +45,6 @@
#include "BLI_path_util.h"
#include "BLI_threads.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_scene.h"