errors and warnings fixes

This commit is contained in:
Nikita Smith
2024-11-08 11:30:16 -08:00
parent e297460697
commit 8e6a0ae4db
7 changed files with 16 additions and 20 deletions
-3
View File
@@ -1,9 +1,6 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
global read_only LNK_Chunk g_null_chunk = { 0, 0, /* is_discarded: */ 1 };
global read_only LNK_Chunk *g_null_chunk_ptr = &g_null_chunk;
internal LNK_ChunkRef
lnk_chunk_ref(U64 sect_id, U64 chunk_id)
{
+6 -4
View File
@@ -43,8 +43,6 @@ typedef struct LNK_Chunk
#if LNK_DEBUG_CHUNKS
String8 debug;
#endif
int debug;
} LNK_Chunk, * LNK_ChunkPtr;
typedef struct LNK_ChunkNode
@@ -115,8 +113,12 @@ typedef struct LNK_ChunkManager
U64 total_chunk_count;
} LNK_ChunkManager;
extern LNK_Chunk g_null_chunk;
extern LNK_Chunk *g_null_chunk_ptr;
////////////////////////////////
read_only global LNK_Chunk g_null_chunk = { 0, 0, /* is_discarded: */ 1 };
read_only global LNK_Chunk *g_null_chunk_ptr = &g_null_chunk;
////////////////////////////////
internal LNK_ChunkRef lnk_chunk_ref(U64 sect_id, U64 chunk_id);
internal B32 lnk_chunk_ref_is_equal(LNK_ChunkRef a, LNK_ChunkRef b);
+1 -3
View File
@@ -506,7 +506,7 @@ lnk_get_mt_path(Arena *arena)
#undef OS_WINDOWS
#define OS_WINDOWS 1
#else
mt_path = str8_lit("llvm-mt.exe");
String8 mt_path = str8_lit("llvm-mt.exe");
#endif
return mt_path;
}
@@ -1914,10 +1914,8 @@ lnk_build_config(Arena *arena, int argc, char **argv)
String8List raw_cmd_line = os_string_list_from_argcv(arena, argc, argv);
#if OS_WINDOWS
// remove exe name first argument
str8_list_pop_front(&raw_cmd_line);
#endif
// init config
LNK_Config *config = lnk_config_from_cmd_line(arena, raw_cmd_line);
+2 -2
View File
@@ -2483,10 +2483,10 @@ lnk_format_u128(U8 *buf, U64 buf_max, U64 length, U128 v)
if (length > 0 && buf_max > 0) {
if (length <= 8) {
U64 mask = length == 8 ? max_U64 : (1ull << (length*8)) - 1;
size = raddbg_snprintf((char*)buf, buf_max - 1, "%llX", v.u64[0] & mask);
size = raddbg_snprintf((char*)buf, buf_max - 1, "%llX", (long long)(v.u64[0] & mask));
} else {
U64 mask1 = length == 16 ? max_U64 : (1ull << ((length-8)*8)) - 1;
size = raddbg_snprintf((char*)buf, buf_max, "%llX%llX", v.u64[1] & mask1, v.u64[0]);
size = raddbg_snprintf((char*)buf, buf_max, "%llX%llX", (long long)(v.u64[1] & mask1), (long long)v.u64[0]);
}
}
return size;
+3 -3
View File
@@ -117,7 +117,7 @@ internal void lnk_suppress_error(LNK_ErrorCode code);
internal LNK_ErrorCodeStatus lnk_get_error_code_status(LNK_ErrorCode code);
internal void lnk_internal_error(LNK_InternalError code, char *file, int line, char *fmt, ...);
#define lnk_invalid_path(fmt, ...) lnk_internal_error(LNK_InternalError_InvalidPath, __FILE__, __LINE__, fmt, __VA_ARGS__)
#define lnk_not_implemented(fmt, ...) lnk_internal_error(LNK_InternalError_NotImplemented, __FILE__, __LINE__, fmt, __VA_ARGS__)
#define lnk_incomplete_switch(fmt, ...) lnk_internal_error(LNK_InternalError_IncompleteSwitch, __FILE__, __LINE__, fmt, __VA_ARGS__)
#define lnk_invalid_path(...) lnk_internal_error(LNK_InternalError_InvalidPath, __FILE__, __LINE__, __VA_ARGS__)
#define lnk_not_implemented(...) lnk_internal_error(LNK_InternalError_NotImplemented, __FILE__, __LINE__, __VA_ARGS__)
#define lnk_incomplete_switch(...) lnk_internal_error(LNK_InternalError_IncompleteSwitch, __FILE__, __LINE__, __VA_ARGS__)
-3
View File
@@ -1,9 +1,6 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
global read_only LNK_Symbol g_null_symbol = { str8_lit_comp("NULL"), LNK_Symbol_DefinedStatic };
global read_only LNK_Symbol *g_null_symbol_ptr = &g_null_symbol;
internal void
lnk_init_symbol(LNK_Symbol *symbol, String8 name, LNK_SymbolType type)
{
+4 -2
View File
@@ -169,8 +169,10 @@ typedef struct
////////////////////////////////
extern LNK_Symbol g_null_symbol;
extern LNK_Symbol *g_null_symbol_ptr;
global read_only LNK_Symbol g_null_symbol = { str8_lit_comp("NULL"), LNK_Symbol_DefinedStatic };
global read_only LNK_Symbol *g_null_symbol_ptr = &g_null_symbol;
////////////////////////////////
internal void lnk_init_symbol(LNK_Symbol *symbol, String8 name, LNK_SymbolType type);
internal void lnk_init_defined_symbol(LNK_Symbol *symbol, String8 name, LNK_DefinedSymbolVisibility visibility, LNK_DefinedSymbolFlags flags);