Skip to content

Commit 8cd145e

Browse files
committed
Define magic numbers as integer constants (#1518)
The underlying representation of multibyte character literals is implementation-defined. This could, at least in principle, cause cross-build data export/import issues independent of endianness. Define magic numbers as integer literals to be on the safe side. Signed-off-by: Juuso Alasuutari <[email protected]>
1 parent 5ea4339 commit 8cd145e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llama.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#endif
2121

2222
#define LLAMA_FILE_VERSION 2
23-
#define LLAMA_FILE_MAGIC 'ggjt'
24-
#define LLAMA_FILE_MAGIC_UNVERSIONED 'ggml'
25-
#define LLAMA_SESSION_MAGIC 'ggsn'
23+
#define LLAMA_FILE_MAGIC 0x67676a74u // 'ggjt'
24+
#define LLAMA_FILE_MAGIC_UNVERSIONED 0x67676d6cu // 'ggml'
25+
#define LLAMA_SESSION_MAGIC 0x6767736eu // 'ggsn'
2626
#define LLAMA_SESSION_VERSION 1
2727

2828
#ifdef __cplusplus

0 commit comments

Comments
 (0)