MCPcopy Create free account
hub / github.com/dborth/fceugx / readVarPtr

Function readVarPtr

source/patch.cpp:65–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65static s64 readVarPtr(MFILE *f) {
66 s64 offset = 0, shift = 1;
67 for (;;) {
68 int c = memfgetc(f);
69 if (c == MEOF)
70 return 0;
71 offset += (c & 0x7F) * shift;
72 if (c & 0x80)
73 break;
74 shift <<= 7;
75 offset += shift;
76 }
77 return offset;
78}
79
80#ifndef MIN
81#define MIN(a,b) (((a)<(b))?(a):(b))

Callers 1

patchApplyUPSFunction · 0.85

Calls 1

memfgetcFunction · 0.85

Tested by

no test coverage detected