From 9e817304d14e4c3aa24dda390d036378199d89f8 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 11 Jun 2022 23:49:05 +0300 Subject: [PATCH] Get rid of saving pointers --- src/scripts.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scripts.cc b/src/scripts.cc index 7eff5e6..6bb43a6 100644 --- a/src/scripts.cc +++ b/src/scripts.cc @@ -1723,7 +1723,8 @@ int scriptWrite(Script* scr, File* stream) if (fileWriteInt32(stream, scr->flags) == -1) return -1; if (fileWriteInt32(stream, scr->field_14) == -1) return -1; - if (fileWriteInt32(stream, (int)scr->program) == -1) return -1; // FIXME: writing pointer to file + // NOTE: Original code writes `scr->program` pointer which is meaningless. + if (fileWriteInt32(stream, 0) == -1) return -1; if (fileWriteInt32(stream, scr->field_1C) == -1) return -1; if (fileWriteInt32(stream, scr->localVarsOffset) == -1) return -1; if (fileWriteInt32(stream, scr->localVarsCount) == -1) return -1; @@ -1753,8 +1754,8 @@ int scriptListExtentWrite(ScriptListExtent* a1, File* stream) return -1; } - if (fileWriteInt32(stream, (int)a1->next) != 0) { - // FIXME: writing pointer to file + // NOTE: Original code writes `a1->next` pointer which is meaningless. + if (fileWriteInt32(stream, 0) != 0) { return -1; }