GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [[ LCB ]] Add constant formalism for binary module format versioning. · livecode/livecode@0ae0416

This repository was archived by the owner on Aug 31, 2021. It is now read-only.

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • libscript/src
    • script-builder.cpp
    • script-module.cpp
    • script-private.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎libscript/src/script-builder.cpp‎

Copy file name to clipboardExpand all lines: libscript/src/script-builder.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ bool MCScriptEndModule(MCScriptModuleBuilderRef self, MCStreamRef p_stream)
148148
byte_t t_header[4];
149149
t_header[0] = 'L';
150150
t_header[1] = 'C';
151-
t_header[2] = 0;
152-
t_header[3] = 0;
151+
t_header[2] = ((kMCScriptCurrentModuleVersion & 0xFF) >> 0);
152+
t_header[3] = ((kMCScriptCurrentModuleVersion & 0xFF) >> 8);
153153

154154
t_success = MCStreamWrite(p_stream, t_header, 4) &&
155155
MCScriptWriteRawModule(p_stream, &self -> module);
Collapse file

‎libscript/src/script-module.cpp‎

Copy file name to clipboardExpand all lines: libscript/src/script-module.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ bool MCScriptCreateModuleFromStream(MCStreamRef stream, MCScriptModuleRef& r_mod
427427

428428
if (t_header[0] != 'L' ||
429429
t_header[1] != 'C' ||
430-
t_header[2] != 0x00 ||
431-
t_header[3] != 0x00)
430+
t_header[2] != (kMCScriptCurrentModuleVersion & 0xFF) ||
431+
t_header[3] != ((kMCScriptCurrentModuleVersion >> 8) & 0xFF))
432432
return false;
433433

434434
MCScriptModule *t_module;
Collapse file

‎libscript/src/script-private.h‎

Copy file name to clipboardExpand all lines: libscript/src/script-private.h
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,18 @@ bool MCScriptBytecodeIterate(byte_t*& x_bytecode, byte_t *p_bytecode_limit, MCSc
565565
// byte version[1]
566566
// <pickle of module struct>
567567

568+
// The module version will be incremented for every public release of the libscript
569+
// which occurs in which the module binary format changes.
570+
//
571+
// We will only aim to support module formats which have been released as final and
572+
// stable.
573+
//
574+
// The following constants keep track of, and should be updated to reflect the meaning
575+
// of each module version.
576+
577+
#define kMCScriptModuleVersion_8_0_0_DP_1 0
578+
#define kMCScriptCurrentModuleVersion kMCScriptModuleVersion_8_0_0_DP_1
579+
568580
////////////////////////////////////////////////////////////////////////////////
569581

570582
#endif

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.