1.1 --- a/templates/native/common.c Sun Feb 12 00:25:36 2017 +0100
1.2 +++ b/templates/native/common.c Sun Feb 12 01:21:33 2017 +0100
1.3 @@ -1,6 +1,6 @@
1.4 /* Common operations for native functions.
1.5
1.6 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.8
1.9 This program is free software; you can redistribute it and/or modify it under
1.10 the terms of the GNU General Public License as published by the Free Software
1.11 @@ -29,7 +29,7 @@
1.12 __attr __new_int(int i)
1.13 {
1.14 /* Create a new integer and mutate the __data__ attribute. */
1.15 - __attr attr = __new(&__InstanceTable___builtins___int_int, &__builtins___int_int, sizeof(__obj___builtins___int_int));
1.16 + __attr attr = __NEWINSTANCE(__builtins___int_int);
1.17 attr.value->attrs[__pos___data__].intvalue = i;
1.18 return attr;
1.19 }
1.20 @@ -37,7 +37,7 @@
1.21 __attr __new_str(char *s, size_t size)
1.22 {
1.23 /* Create a new string and mutate the __data__ and __key__ attributes. */
1.24 - __attr attr = __new(&__InstanceTable___builtins___str_string, &__builtins___str_string, sizeof(__obj___builtins___str_string));
1.25 + __attr attr = __NEWINSTANCE(__builtins___str_string);
1.26 attr.value->attrs[__pos___data__].size = size;
1.27 attr.value->attrs[__pos___data__].strvalue = s;
1.28 attr.value->attrs[__pos___key__] = __NULL;
1.29 @@ -47,7 +47,7 @@
1.30 __attr __new_list(__fragment *f)
1.31 {
1.32 /* Create a new list and mutate the __data__ attribute. */
1.33 - __attr attr = __new(&__InstanceTable___builtins___list_list, &__builtins___list_list, sizeof(__obj___builtins___list_list));
1.34 + __attr attr = __NEWINSTANCE(__builtins___list_list);
1.35 attr.value->attrs[__pos___data__].seqvalue = f;
1.36 return attr;
1.37 }