[Beremiz-devel] Generic functions ADD, MUL, SUB, DIV don't work with time data types.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Beremiz-devel] Generic functions ADD, MUL, SUB, DIV don't work with time data types.

Дмитрий Кузьмин
Beremiz in time functions contains both functions types such as ADD_TOD_TIME() and ADD(). Accordingly, the functions above only accept the ANY_NUM data types. Matiec macros don't allow to use any types accept of numeric. Is there any case to solve this problem?
Non working functions:
Снимок экрана (15).png

Matiec code, that generates ADD function:
#define __add(TYPENAME) \ __arith_expand(ADD_##TYPENAME, TYPENAME, +) /* explicitly typed function */\ __arith_expand(ADD__##TYPENAME##__##TYPENAME, TYPENAME, +) /* overloaded function */ __ANY_NUM(__add)

Error while using these functions with time type:
error: Data type incompatibility for value passed in position 1 when invoking function 'ADD'
In section: PROGRAM program0
0215:   var_time := ADD(var_time0, var_time1); 

Best regards,
Dmitriy

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel
skv
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] Generic functions ADD, MUL, SUB, DIV don't work with time data types.

skv
Administrator
On 18-09-04 12:10, Дмитрий Кузьмин wrote:

> Beremiz in time functions contains both functions types such as
> ADD_TOD_TIME() and ADD(). Accordingly, the functions above only accept the
> ANY_NUM data types. Matiec macros don't allow to use any types accept of
> numeric. Is there any case to solve this problem?
> Non working functions:
> [image: Снимок экрана (15).png]
>
> Matiec code, that generates ADD function:
> *#define __add(TYPENAME) \ __arith_expand(ADD_##TYPENAME, TYPENAME, +) /*
> explicitly typed function */\ __arith_expand(ADD__##TYPENAME##__##TYPENAME,
> TYPENAME, +) /* overloaded function */ __ANY_NUM(__add) *
>
> Error while using these functions with time type:
> *error: Data type incompatibility for value passed in position 1 when
> invoking function 'ADD'In section: PROGRAM program00215:   var_time :=
> ADD(var_time0, var_time1); *

Hi Dmitry,

it look like a bug in matiec. Please report it here [1], so it's not lost.
As a workaround for TIME types you can use ADD_TIME instead of ADD.

1. https://bitbucket.org/mjsousa/matiec/issues/




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel