Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit cdb18df

Browse files
committed
[x64 fix]: Scintilla structures required correction for x64
- ScNotification struct had incorrect data type 'int' for lineNumber, position, etc fields - This might cause misinterpretation of data block eventually leading to corruption. - Scintilla interface method signatures were incorrectly using int. - This would cause truncation of data in x64 environment and possible data corruption. - Enums in GatewayDomain.cs required [Flags] attribute to combine using OR.
1 parent e0c80f0 commit cdb18df

File tree

7 files changed

+507
-438
lines changed

7 files changed

+507
-438
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,4 @@ UpgradeLog*.XML
109109
*.pyc
110110

111111
Visual Studio Project Template C#/$projectname$.sln
112+
.vscode/launch.json

ToolsForMaintainersOfTheProjectTemplate/Scintilla_iface_synchronizer/Face.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def ReadFromFile(self, name):
5050
currentCategory = ""
5151
currentComment = []
5252
currentCommentFinished = 0
53+
import os, os.path, inspect
54+
if '__file__' not in locals():
55+
__file__ = inspect.getframeinfo(inspect.currentframe())[0]
56+
os.chdir(os.path.dirname(os.path.realpath(__file__)))
5357
file = open(name)
5458
for line in file.readlines():
5559
line = sanitiseLine(line)

ToolsForMaintainersOfTheProjectTemplate/Scintilla_iface_synchronizer/cs.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ def isTypeUnsupported(t):
3535
if t in ["formatrange"]: return True
3636
return False
3737

38-
def translateType(t):
38+
def translateType(t:str):
3939
if t == "cells": return "Cells"
4040
if t == "colour": return "Colour"
41-
if t == "line": return "int"
41+
if t == "line": return "long"
4242
if t == "pointer": return "IntPtr"
43-
if t == "position": return "int"
43+
if t == "position": return "long"
4444
if t == "textrange": return "TextRange"
4545
if t == "findtext": return "TextToFind"
4646
if t == "keymod": return "KeyModifier"
@@ -81,7 +81,7 @@ def getUnsafeModifier(returnType, param1Type, param2Type):
8181
def translateReturnType(v, param1Type, param2Type):
8282
if param1Type == "stringresult" or param2Type == "stringresult":
8383
return "string"
84-
else:
84+
else:
8585
return translateType(v["ReturnType"])
8686

8787
def getParameterList(param1Type, param1Name, param2Type, param2Name):
@@ -100,6 +100,7 @@ def printEnumDefinitions(f):
100100
if v["FeatureType"] in ["enu"] and name not in ["Keys"]: # for all except excluded enums [conflicting]
101101
appendComment(indent, out, v)
102102
prefix = v["Value"]
103+
out.append(indent + "[Flags]")
103104
out.append(indent + "public enum " + name)
104105
out.append(indent + "{")
105106
for ename in f.order:
@@ -189,10 +190,6 @@ def printLexGatewayFile(f):
189190
out.append(iindent + "return 1 == (int)" +res+ ";")
190191
elif returnType == "Colour":
191192
out.append(iindent + "return new Colour((int) " +res+ ");")
192-
# elif returnType == "Line":
193-
# out.append(iindent + "return new Line((int) " +res+ ");")
194-
# elif returnType == "Position":
195-
# out.append(iindent + "return new Position((int) " +res+ ");")
196193
elif returnType == "string":
197194
out.append(iindent + res + ";")
198195
out.append(iindent + "return Encoding.UTF8.GetString("+bufferVariableName+").TrimEnd('\\0');")

0 commit comments

Comments
 (0)