From 5e2934a399cde5451bc81b2baee69143119fa253 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 6 Jan 2024 03:30:32 -0500 Subject: [PATCH] Add Suffix --- src/method.ts | 4 ++-- src/vtable.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/method.ts b/src/method.ts index e616972..a668df2 100644 --- a/src/method.ts +++ b/src/method.ts @@ -31,7 +31,7 @@ export class Method { } // Generate Variable Definition - generateDefinition() { - return `${this.getType()} ${this.getName()};\n`; + generateDefinition(nameSuffix?: string) { + return `${this.getType()} ${this.getName()}${nameSuffix !== undefined ? nameSuffix : ''};\n`; } } \ No newline at end of file diff --git a/src/vtable.ts b/src/vtable.ts index 728e993..aaecf71 100644 --- a/src/vtable.ts +++ b/src/vtable.ts @@ -117,7 +117,7 @@ export class VTable implements Property { if (info) { const type = `${info.getType()} *`; out += `extern ${type}${info.getName()}_vtable_addr;\n`; - out += `extern ${info.generateDefinition()}`; + out += `extern ${info.generateDefinition('_non_virtual')}`; } } } @@ -152,7 +152,7 @@ export class VTable implements Property { const type = `${info.getType()} *`; init += `${INDENT}${info.getName()}_vtable_addr = (${type}) ${vtableAddress};\n`; declarations += `${type}${info.getName()}_vtable_addr;\n`; - init += `${INDENT}${info.getName()} = *${info.getName()}_vtable_addr;\n`; + init += `${INDENT}${info.getName()}_non_virtual = *${info.getName()}_vtable_addr;\n`; declarations += info.generateDefinition(); } }