Skip to content

Commit

Permalink
Fix for type 'double' cannot be narrowed to 'long' in initializer list
Browse files Browse the repository at this point in the history
  • Loading branch information
correa committed Oct 20, 2020
1 parent e48965d commit fd6e537
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions runtime/core/lib/iec_std_lib.h
Expand Up @@ -52,6 +52,10 @@
#define DBG_TYPE(TYPENAME, name)
#endif

#ifdef __APPLE__
typedef long time_t;
#endif

/*
* Include type defs.
*/
Expand Down Expand Up @@ -379,7 +383,7 @@ static inline TIME __time_mul(TIME IN1, LREAL IN2){
time_t s = (time_t)s_f;
div_t ns = div((int)((LREAL)IN1.tv_nsec * IN2), 1000000000);
TIME res = {(long)s + ns.quot,
(long)ns.rem + (s_f - s) * 1000000000 };
(long)((long)ns.rem + (s_f - s) * 1000000000) };
__normalize_timespec(&res);
return res;
}
Expand Down Expand Up @@ -537,7 +541,7 @@ static inline LREAL __string_to_real(STRING IN) {
/* TO_TIME */
/***************/
static inline TIME __int_to_time(LINT IN) {return (TIME){IN, 0};}
static inline TIME __real_to_time(LREAL IN) {return (TIME){IN, (IN - (LINT)IN) * 1000000000};}
static inline TIME __real_to_time(LREAL IN) {return (TIME){(long)(IN), (long)((IN - (LINT)IN) * 1000000000)};}
static inline TIME __string_to_time(STRING IN){
__strlen_t l;
/* TODO :
Expand Down

0 comments on commit fd6e537

Please sign in to comment.