# HG changeset patch # User Paul Boddie # Date 1477765119 -7200 # Node ID f36960912999970ba623cf5998e2558cb37911a2 # Parent b9ff845ba2cd4a3bd8fe1d440cc2d6fb91e15aff Replaced old null references and added __COPY macro. diff -r b9ff845ba2cd -r f36960912999 templates/ops.h --- a/templates/ops.h Sat Oct 29 20:17:38 2016 +0200 +++ b/templates/ops.h Sat Oct 29 20:18:39 2016 +0200 @@ -4,8 +4,7 @@ #define __OPS_H__ #include "types.h" - -extern __attr null; +#include /* for __COPY */ /* Direct access to functions. */ @@ -88,4 +87,8 @@ #define __ATTRCODE(__ATTRNAME) (__code_##__ATTRNAME) #define __ATTRPOS(__ATTRNAME) (__pos_##__ATTRNAME) +/* Copying of structures. */ + +#define __COPY(__SOURCE, __TARGET) (memcpy(__TARGET, __SOURCE, sizeof(__SOURCE))) + #endif /* __OPS_H__ */ diff -r b9ff845ba2cd -r f36960912999 templates/progops.c --- a/templates/progops.c Sat Oct 29 20:17:38 2016 +0200 +++ b/templates/progops.c Sat Oct 29 20:18:39 2016 +0200 @@ -54,7 +54,7 @@ /* Check the number of arguments. */ if ((min > (nargs + nkwargs)) || ((nargs + nkwargs) > max)) - return null; + return __NULL; /* Copy the arguments. */ @@ -79,7 +79,7 @@ arguments. */ if ((pos == -1) || (pos < nargs)) - return null; + return __NULL; /* Set the argument using the appropriate position. */