mirror of
https://github.com/sheumann/hush.git
synced 2024-08-20 19:29:02 +00:00
- eliminate globals
This commit is contained in:
parent
7d9d251543
commit
8af23f8fc3
@ -20,11 +20,15 @@
|
|||||||
#define isNAND (1 << _bitNAND)
|
#define isNAND (1 << _bitNAND)
|
||||||
#define bbtest (1 << 3)
|
#define bbtest (1 << 3)
|
||||||
|
|
||||||
/* This is used in the cpu_to_je/je_to_cpu macros in jffs2_user.h */
|
struct globals {
|
||||||
/* FIXME: target_endian should be const!
|
/* This is used in the cpu_to_je/je_to_cpu macros in jffs2_user.h */
|
||||||
* FIXME: Also it sounds more sensible to use our own existing SWAP_ macros.
|
int tgt_endian;
|
||||||
*/
|
};
|
||||||
/* const */ int target_endian = __BYTE_ORDER;
|
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||||
|
#define target_endian (G.tgt_endian)
|
||||||
|
#define INIT_G() do { \
|
||||||
|
target_endian = __BYTE_ORDER; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
static uint32_t crc32(uint32_t val, const void *ss, int len,
|
static uint32_t crc32(uint32_t val, const void *ss, int len,
|
||||||
uint32_t *crc32_table)
|
uint32_t *crc32_table)
|
||||||
@ -54,6 +58,7 @@ int flash_eraseall_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
char *mtd_name;
|
char *mtd_name;
|
||||||
|
|
||||||
|
INIT_G();
|
||||||
opt_complementary = "=1";
|
opt_complementary = "=1";
|
||||||
flags = getopt32(argv, "jq");
|
flags = getopt32(argv, "jq");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user