Changeset 803631e in OpenModelica for OMCompiler/SimulationRuntime/c/meta/meta_modelica_builtin.c
- Timestamp:
- 2023-03-27T16:20:17+02:00 (14 months ago)
- Parents:
- 02fef0b9
- git-author:
- Per Östlund <perost86@…> (03/27/23 14:31:47)
- git-committer:
- Per Östlund <perost86@…> (03/27/23 16:20:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/SimulationRuntime/c/meta/meta_modelica_builtin.c
rb0b1473 r803631e 50 50 if (i>=0 && i<=9) /* Small integers are used so much it makes sense to cache them */ 51 51 return mmc_strings_len1['0'+i]; 52 s printf(buffer, "%ld", (long)i);52 snprintf(buffer, 22, "%" PRINT_MMC_SINT_T, i); 53 53 res = mmc_mk_scon(buffer); 54 54 MMC_CHECK_STRING(res); … … 81 81 modelica_integer nobox_stringInt(threadData_t *threadData,metamodelica_string s) 82 82 { 83 longres;83 modelica_integer res; 84 84 char *endptr,*str=MMC_STRINGDATA(s); 85 85 MMC_CHECK_STRING(s); 86 86 errno = 0; 87 #if defined(_WIN64) || defined(__MINGW64__) 88 res = strtoll(str,&endptr,10); 89 #else 87 90 res = strtol(str,&endptr,10); 91 #endif 88 92 if (errno != 0 || str == endptr) 89 93 MMC_THROW_INTERNAL(); 90 94 if (*endptr != '\0') 91 95 MMC_THROW_INTERNAL(); 92 if (res > INT_MAX || res <INT_MIN)96 if (res > MODELICA_INT_MAX || res < MODELICA_INT_MIN) 93 97 MMC_THROW_INTERNAL(); 94 98 return res;
Note: See TracChangeset
for help on using the changeset viewer.