zertovitch / gwindows

GWindows: GUI framework for MS Windows
https://sf.net/projects/gnavi/
21 stars 5 forks source link

Bug in gwindows-scintilla.adb #14

Closed NicoPy closed 11 months ago

NicoPy commented 11 months ago

There's a bug in file gwindows-scintilla.adb at line 2981.

NM.modificationType is of type Int_32. It is casted to Interfaces.Unsigned_32 which will raise an exception with negative numbers.

Replacing the cast with Ada.Unchecked_Conversion solves the problem. But maybe it would be best to modify STRUCT_SCNotification definition by replacing modificationType : Int_32; with modificationType : Interfaces.Unsigned_32;.

zertovitch commented 11 months ago

Commit https://github.com/zertovitch/gwindows/commit/98dc1ba650207f75d7e2d271478eb30129def970 should fix it. Probably this error didn't appear until now because the default mask (SC_MODEVENTMASKALL) doesn't set the sign bit.

NicoPy commented 11 months ago

Thanks Gautier.