Ver Fonte

Merge pull request #846 from Angluca/master

use addr instead unsafeAddr
Andre Weissflog há 2 anos atrás
pai
commit
d3c9ea7df5
2 ficheiros alterados com 3 adições e 3 exclusões
  1. 1 1
      .github/workflows/gen_bindings.yml
  2. 2 2
      bindgen/gen_nim.py

+ 1 - 1
.github/workflows/gen_bindings.yml

@@ -125,7 +125,7 @@ jobs:
     steps:
     steps:
       - uses: jiro4989/setup-nim-action@v1
       - uses: jiro4989/setup-nim-action@v1
         with:
         with:
-         nim-version: 1.6.12
+         nim-version: devel
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          repo-token: ${{ secrets.GITHUB_TOKEN }}
       - uses: actions/checkout@v3
       - uses: actions/checkout@v3
         with:
         with:

+ 2 - 2
bindgen/gen_nim.py

@@ -437,7 +437,7 @@ def gen_func_nim(decl, prefix):
             arg_name = param_decl['name']
             arg_name = param_decl['name']
             arg_type = param_decl['type']
             arg_type = param_decl['type']
             if is_const_struct_ptr(arg_type):
             if is_const_struct_ptr(arg_type):
-                s += f"unsafeAddr({arg_name})"
+                s += f"addr({arg_name})"
             else:
             else:
                 s += arg_name
                 s += arg_name
         s += ")"
         s += ")"
@@ -562,7 +562,7 @@ def gen_extra(inp):
     #if inp['prefix'] in ['sg_', 'sdtx_', 'sshape_']:
     #if inp['prefix'] in ['sg_', 'sdtx_', 'sshape_']:
     #    l('# helper function to convert "anything" into a Range')
     #    l('# helper function to convert "anything" into a Range')
     #    l('converter to_Range*[T](source: T): Range =')
     #    l('converter to_Range*[T](source: T): Range =')
-    #    l('  Range(addr: source.unsafeAddr, size: source.sizeof.uint)')
+    #    l('  Range(addr: source.addr, size: source.sizeof.uint)')
     #    l('')
     #    l('')
     c_source_path = '/'.join(c_source_paths[inp['prefix']].split('/')[3:])
     c_source_path = '/'.join(c_source_paths[inp['prefix']].split('/')[3:])
     l('{.passc:"-DSOKOL_NIM_IMPL".}')
     l('{.passc:"-DSOKOL_NIM_IMPL".}')