Skip to content

Commit

Permalink
"char*" (without "const") will no longer result in string overload
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Feb 3, 2020
1 parent 0a5753c commit ac3fabd
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 1,904 deletions.
13 changes: 7 additions & 6 deletions DataScraping/XML/GL/ScrapXML.pas
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@

ParData = sealed class
private name, t: string;
private readonly: boolean;
private ptr: integer;
private gr: Group := nil;

Expand All @@ -172,13 +173,12 @@
self.name := n.Nodes['name'].Single.Text;
if func_name=nil then func_name := self.name;

var text := n.Text;
self.t := n.Nodes['ptype'].SingleOrDefault?.Text;
if self.t=nil then
begin
var s := n.Text;
s := s.Remove(s.LastIndexOf(' '));
self.t := s.Remove('const').Trim;
end;
self.t := text.Remove(text.LastIndexOf(' ')).Remove('const').Trim;

self.readonly := text.Contains('const');

self.ptr := n.Text.Count(ch->ch='*');

Expand Down Expand Up @@ -214,14 +214,15 @@
// Otp(func_name);
// log.WriteLine($'Command [{func_name}] has enum parameter without group');

var ToDo := 0; // расскоментировать когда группы приведут в кое-какой порядк
var ToDo := 0; //ToDo расскоментировать когда группы приведут в кое-какой порядк

end;

public procedure Save(bw: System.IO.BinaryWriter; grs: array of Group);
begin
bw.Write(name);
bw.Write(t);
bw.Write(readonly);
bw.Write(ptr);

var ind := gr=nil ? -1 : grs.IndexOf(gr);
Expand Down
Binary file modified DataScraping/XML/GL/funcs.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions Packing/Template/GL/Fixers/Funcs/0Core.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

# glGetShaderInfoLog
!possible_par_types
* | * | -array of Int32 | -string |
* | * | -array of Int32 | * |

# glGetProgramInfoLog
!possible_par_types
* | * | -array of Int32 | -string |
* | * | -array of Int32 | * |

# glNamedBufferData
!possible_par_types
Expand Down
7 changes: 5 additions & 2 deletions Packing/Template/GL/FuncData.pas
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ sb += $' {name} = record' + #10;

FuncOrgParam = sealed class
public name, t: string;
public readonly: boolean;
public ptr: integer;
public gr: Group;

Expand Down Expand Up @@ -172,6 +173,7 @@ sb += $' {name} = record' + #10;
if LogCache.invalid_ntv_types.Add(ntv_t) then
Otp($'ERROR: Nativ type [{ntv_t}] isn''t defined');

self.readonly := br.ReadBoolean;
self.ptr := br.ReadInt32 + self.t.Count(ch->ch='*') - self.t.Count(ch->ch='-');
self.t := self.t.Remove('*','-').Trim;
if self.ptr<0 then
Expand Down Expand Up @@ -240,11 +242,12 @@ sb += $' {name} = record' + #10;
Result := Lst((par.ptr-1, 'string'));
exit;
end;
var res := new List<System.Tuple<integer,string>>(par.ptr+1);
var res := new List<System.Tuple<integer,string>>(par.ptr+integer(par.readonly));

for var ptr := 0 to par.ptr-1 do
res += ( ptr , 'IntPtr');
res += (par.ptr-1, 'string');
if par.readonly then
res += (par.ptr-1, 'string');

res.Reverse;
Result := res;
Expand Down
1,879 changes: 224 additions & 1,655 deletions Packing/Template/GL/Funcs.template

Large diffs are not rendered by default.

238 changes: 0 additions & 238 deletions Packing/Template/GL/Log/FinalFuncOverloads.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


# POCGL
pascal wrappers of OpenCL and OpenGL
Pascal Wrappers of OpenCL and OpenGL

---

Expand Down

0 comments on commit ac3fabd

Please sign in to comment.