lib/iec_std_lib.h
changeset 389 94b67e38188a
parent 384 4626828277f9
child 393 f09a5ffe1edc
equal deleted inserted replaced
388:17eaad42ba88 389:94b67e38188a
   338     return (STRING){5,"FALSE"};
   338     return (STRING){5,"FALSE"};
   339 }
   339 }
   340 static inline STRING __bit_to_string(LWORD IN) {
   340 static inline STRING __bit_to_string(LWORD IN) {
   341     STRING res;
   341     STRING res;
   342     res = __INIT_STRING;
   342     res = __INIT_STRING;
   343     res.len = snprintf((char*)res.body, STR_MAX_LEN, "16#%llx", IN);
   343     res.len = snprintf((char*)res.body, STR_MAX_LEN, "16#%llx",(long long unsigned int)IN);
   344     if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
   344     if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
   345     return res;
   345     return res;
   346 }
   346 }
   347 static inline STRING __real_to_string(LREAL IN) {
   347 static inline STRING __real_to_string(LREAL IN) {
   348     STRING res;
   348     STRING res;
   352     return res;
   352     return res;
   353 }
   353 }
   354 static inline STRING __sint_to_string(LINT IN) {
   354 static inline STRING __sint_to_string(LINT IN) {
   355     STRING res;
   355     STRING res;
   356     res = __INIT_STRING;
   356     res = __INIT_STRING;
   357     res.len = snprintf((char*)res.body, STR_MAX_LEN, "%lld", IN);
   357     res.len = snprintf((char*)res.body, STR_MAX_LEN, "%lld", (long long int)IN);
   358     if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
   358     if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
   359     return res;
   359     return res;
   360 }
   360 }
   361 static inline STRING __uint_to_string(ULINT IN) {
   361 static inline STRING __uint_to_string(ULINT IN) {
   362     STRING res;
   362     STRING res;
   363     res = __INIT_STRING;
   363     res = __INIT_STRING;
   364     res.len = snprintf((char*)res.body, STR_MAX_LEN, "%llu", IN);
   364     res.len = snprintf((char*)res.body, STR_MAX_LEN, "%llu", (long long unsigned int)IN);
   365     if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
   365     if(res.len > STR_MAX_LEN) res.len = STR_MAX_LEN;
   366     return res;
   366     return res;
   367 }
   367 }
   368     /***************/
   368     /***************/
   369     /* FROM_STRING */
   369     /* FROM_STRING */