fix makefile

This commit is contained in:
silverweed 2024-07-11 16:49:18 +02:00
parent e66ecfe8a7
commit d21bceac89
4 changed files with 13 additions and 9 deletions

View file

@ -7,19 +7,23 @@ ROOTLIBS = -L$(ROOT)/lib -lCore -lRIO -lROOTNTuple -lxxhash -Wl,-rpath,$(ROOT)/l
LIBS = -lglfw
MOLD = mold -run
.PHONY: all clean
all: build/imgui.o build/root_stuff.o noasan
clean:
rm build/*.o rntviewer
build/imgui.o: src/imgui_inc.cpp third_party/imgui/imgui.h
$(CXX) -O3 -fPIC -c -Ithird_party/imgui $< -o $@
build/root_stuff.o: src/PseudoMiniFile.cxx
$(CXX) -fPIC -c $(ROOTFLAGS) $< -o $@
$(CXX) -O3 -fPIC -c $(ROOTFLAGS) $< -o $@
d:
d: build/root_stuff.o build/imgui.o
$(MOLD) $(CXX) -DDEBUG -g -O0 -DENABLE_ASAN $(CFLAGS) -fsanitize=undefined $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o build/root_stuff.o -lasan $(ROOTLIBS) $(LIBS)
noasan:
noasan: build/root_stuff.o build/imgui.o
$(MOLD) $(CXX) -DDEBUG -g -O0 $(CFLAGS) -fsanitize=undefined $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o build/root_stuff.o $(ROOTLIBS) $(LIBS)
r:
r: build/root_stuff.o build/imgui.o
$(MOLD) $(CXX) -O2 $(CFLAGS) $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o build/root_stuff.o $(ROOTLIBS) $(LIBS)

View file

@ -10,7 +10,7 @@ String8 rntuple_description(Arena *arena, const RNTuple &anchor)
}
internal
RNTuple_Info get_rntuple_info(Arena *arena, const char *fname, const char *ntpl_name)
RNTuple_Info get_rntuple_info(const char *fname, const char *ntpl_name)
{
RNTuple_Info info = {};

View file

@ -110,7 +110,7 @@ int main(int argc, char **argv)
}
app.ntpl_name = ntpl_name;
app.rntinfo = get_rntuple_info(arena, fname, ntpl_name);
app.rntinfo = get_rntuple_info(fname, ntpl_name);
app.vsettings = make_viewer_settings();
// Start main loop

View file

@ -276,9 +276,9 @@ struct MemoryEditor
const char* format_byte_space = OptUpperCaseHex ? "%02X " : "%02x ";
while (clipper.Step())
for (size_t line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines
for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines
{
size_t addr = (size_t)(line_i * Cols);
size_t addr = (size_t)(line_i) * Cols;
ImGui::Text(format_address, s.AddrDigitsCount, base_display_addr + addr);
// Draw Hexadecimal
@ -415,7 +415,7 @@ struct MemoryEditor
// Draw ASCII values
ImGui::SameLine(s.PosAsciiStart);
ImVec2 pos = ImGui::GetCursorScreenPos();
addr = line_i * Cols;
addr = (size_t)line_i * Cols;
ImGui::PushID(line_i);
if (ImGui::InvisibleButton("ascii", ImVec2(s.PosAsciiEnd - s.PosAsciiStart, s.LineHeight)))
{