1.1 --- a/templates/progops.c Sat Oct 30 23:09:57 2021 +0200
1.2 +++ b/templates/progops.c Sun Oct 31 01:01:10 2021 +0200
1.3 @@ -49,7 +49,7 @@
1.4
1.5 /* Generic internal data allocation. */
1.6
1.7 -__fragment *__new_fragment(unsigned int n)
1.8 +__fragment *__new_fragment(__int n)
1.9 {
1.10 /* Allocate space for the list. */
1.11
1.12 @@ -62,9 +62,9 @@
1.13 return data;
1.14 }
1.15
1.16 -void __newdata_sequence(unsigned int number, __fragment *data, __attr args[])
1.17 +void __newdata_sequence(__int number, __fragment *data, __attr args[])
1.18 {
1.19 - unsigned int i;
1.20 + __int i;
1.21
1.22 /* Copy the given number of values. */
1.23
1.24 @@ -74,7 +74,7 @@
1.25 data->size = number;
1.26 }
1.27
1.28 -__attr __newdata_list(unsigned int number, __attr args[])
1.29 +__attr __newdata_list(__int number, __attr args[])
1.30 {
1.31 __attr self = __NEWINSTANCE(__builtins___list_list);
1.32 __fragment *data = __new_fragment(number);
1.33 @@ -86,7 +86,7 @@
1.34 return self;
1.35 }
1.36
1.37 -__attr __newdata_tuple(unsigned int number, __attr args[])
1.38 +__attr __newdata_tuple(__int number, __attr args[])
1.39 {
1.40 /* Allocate the tuple and fragment together. */
1.41
1.42 @@ -103,7 +103,7 @@
1.43 }
1.44
1.45 #ifdef __HAVE___builtins___dict_dict
1.46 -__attr __newdata_dict(unsigned int number, __attr args[])
1.47 +__attr __newdata_dict(__int number, __attr args[])
1.48 {
1.49 __attr self = __NEWINSTANCE(__builtins___dict_dict);
1.50
1.51 @@ -313,10 +313,11 @@
1.52 {
1.53 __ref value;
1.54
1.55 - /* Integers can be used directly as truth values. */
1.56 + /* Non-zero integers yield a non-zero result. Since the integer type can be
1.57 + larger than int, a conversion is performed. */
1.58
1.59 if (__INTEGER(attr))
1.60 - return __TOINT(attr);
1.61 + return __TOINT(attr) ? 1 : 0;
1.62
1.63 /* Test against True and False explicitly. If necessary, invoke the bool
1.64 function with the object and test against True. */