Commit Graph

180 Commits

Author SHA1 Message Date
Michael VAN CANNEYT
d2d3fe6bc3 * Char -> AnsiChar 2023-07-14 17:26:10 +02:00
florian
366aedc6d8 * more false positives of unintialized varibles worked around 2022-01-22 17:36:19 +01:00
florian
115f83794b * avoid warning/error on uninitialized variable 2022-01-22 14:13:59 +01:00
florian
02abad58d8 * some fixes for 8 Bit CPUs 2022-01-19 22:03:09 +01:00
florian
07cd469ade Merge branch 'main' into val_range_check
# Conflicts:
#	rtl/inc/sstrings.inc
2022-01-19 21:30:58 +01:00
florian
718709c87d * all val helpers now use the ValValueArray 2022-01-17 22:46:19 +01:00
florian
2f8750924f * patch by Bart B: fixes fpc_val_word_shortstr() and refactors fpc_val_longword_shortstr() so that it uses the same algorithm and naming conventions as the other unsigned val-helpers. 2022-01-16 23:08:37 +01:00
florian
5f089afdfb * unified ValueArray 2022-01-15 22:36:57 +01:00
florian
55f0103248 o patch by Bart B:
* fixes fpc_Val_UInt_Shortstr, part of #15633
    * fpc_val_qword_shortstr uses the ValueArray constant
2022-01-15 22:18:38 +01:00
florian
9a90db79c3 * patch by Bart B to fix fpc_val_smallint_shortstr similiar to #39406, resolves #39528 2022-01-13 22:51:10 +01:00
florian
8e4e229a5f + DestSize parameter for fpc_Val_UInt functions 2022-01-11 22:10:26 +01:00
florian
fc3b635013 * patch by Bart B to fix the value of Code for unsigned types if the input is negative, resolves #39523 2022-01-11 21:29:56 +01:00
florian
f39a6a7755 * fpc_Val_SInt_ShortStr: bug fixes and improvements by Bart B 2022-01-08 14:45:12 +01:00
florian
38c06e64c7 * optimze case
* few formatting changes
2022-01-07 23:43:59 +01:00
florian
05072d0d82 * updated version by Bart B 2022-01-07 23:21:12 +01:00
florian
4c296af05e * reordered condition so they can be evaluated quicker 2022-01-07 19:36:34 +01:00
florian
d29a482cd1 * fixes for fpc_Val_SInt_ShortStr by Bart B
+ new test for fpc_Val_SInt_ShortStr
  + benchmark
2022-01-07 19:19:55 +01:00
Jonas Maebe
4426d0da7a Fixed variant discriminator types 2021-10-31 21:13:35 +01:00
Jonas Maebe
f9672b53a2 - removed old float-to-string and string-to-float conversion code
git-svn-id: trunk@45401 -
2020-05-17 14:05:38 +00:00
pierre
3aa253c11d Allow system unit to be compiled without RTTI feature
git-svn-id: trunk@45351 -
2020-05-13 09:10:23 +00:00
florian
c932dfaf70 * first bunch of fixes for rtti for arm after attribute commits, fixes mostly alignment issues
git-svn-id: trunk@42446 -
2019-07-14 17:45:55 +00:00
svenbarth
c0da39a35d * Tenum_typedata needs to include the Common record as well
git-svn-id: trunk@42438 -
2019-07-13 14:38:24 +00:00
svenbarth
8b5461367b * move TTypeKind from TypInfo unit to System unit as it's necessary for the future GetTypeKind() intrinsic
* also adjust (P)Byte usages to (P/T)TypeKind where necessary/approbiate

git-svn-id: trunk@36873 -
2017-08-11 20:37:36 +00:00
nickysn
2fbe5d2a8b * use ObjpasInt instead of longint in fpc_shortstr_currency (generates shorter
and more efficient code on 16 and 8-bit targets)

git-svn-id: trunk@35484 -
2017-02-27 01:29:52 +00:00
florian
0b82f71e8d * take care of the fact that there are 32 bit abis (e.g. ARMHF) which align qword on 8 byte boundaries, resolves issue #31132
git-svn-id: trunk@35218 -
2016-12-30 15:32:56 +00:00
svenbarth
a2c9c75e97 Convert Insert() and Delete() to intrinsics in preparation for dynamic array support for these two procedures.
Since overloading compilerprocs does not work each procedure got its own unique name, but they are using the new compilerproc extension to map them to the Insert and Delete symbol so that error messages can be shown with the respective name for the procedure declarations instead of fpc_shortstr_delete for example.

git-svn-id: trunk@33895 -
2016-06-03 21:25:49 +00:00
michael
9d75d3aae8 * Fix by Laco for bug ID #29037
git-svn-id: trunk@33339 -
2016-03-26 23:54:13 +00:00
Jonas Maebe
2afd8eb802 - removed FPC_HAS_STR_CURRENCY-related code, FPC 2.6.4 has it
git-svn-id: trunk@31692 -
2015-09-15 11:51:48 +00:00
michael
8161c1135c * Add offset to Pos functions, Delphi XE 8 compatible.
git-svn-id: trunk@31464 -
2015-08-31 13:05:37 +00:00
florian
590ec0f3e6 * more procedures excluded to avoid internalerrors on avr after the trgobj.conservative fix
git-svn-id: trunk@31440 -
2015-08-28 18:49:07 +00:00
florian
886e3e8d02 * disable several complex procedures for avr with a newly introduced define: EXCLUDE_COMPLEX_PROCS. They
might compile with an improved register allocator in the future

git-svn-id: trunk@30546 -
2015-04-11 14:43:39 +00:00
florian
98856437b2 * disable fpc_chararray_enum for now on avr because the register allocator cannot currently handle it
git-svn-id: trunk@30380 -
2015-03-29 19:46:02 +00:00
Jonas Maebe
ff583bde6c * made setstring() a compiler intrinsic so it can set the compile-time
code page of ansistrings (mantis #26735)

git-svn-id: trunk@28813 -
2014-10-12 20:27:06 +00:00
nickysn
4c8e947f0c * changed the shortstring index variables that were previously longint and were later changed to sizeint (in r26917) to ObjpasInt after r27142
git-svn-id: trunk@27185 -
2014-03-19 15:35:21 +00:00
Jeppe Johansen
9b79f2f68d Added support for 8-bit CPU's in RTL. Mostly for missing implementations of int<->string conversion and console/text output.
git-svn-id: trunk@26958 -
2014-03-04 20:00:03 +00:00
nickysn
65fe978b71 * various shortstring index variables changed from longint to sizeint (generates
more efficient code on i8086)

git-svn-id: trunk@26917 -
2014-03-01 21:44:08 +00:00
Jonas Maebe
21eeec9981 + re-implementation of real->string and string->real conversion routines
based on the Grisu1 algorithm. This corrects several precision issues
    with the previous code used to perform such conversions (patch by
    Max Nazhalov, mantis #25241)
   o adaptation of several tests to deal with the better precision of these
     routines compared to the previous version
  Please don't remove the real2str.inc file yet, it's still used by the
  JVM target for now

git-svn-id: trunk@25888 -
2013-10-31 12:39:27 +00:00
sergei
a6d34945a2 * Commented out exponent check added in r25549: since this code is used by compiler, it breaks compilation of code with constants in extended range on targets without extended precision.
git-svn-id: trunk@25564 -
2013-09-25 07:18:18 +00:00
sergei
d6a4e30f06 * fpc_val_real_shortstr: track amount of digits in mantissa and limit integer exponent values. This does not (yet) prevent floating-point overflows, but is a necessary step to prevent them.
git-svn-id: trunk@25549 -
2013-09-24 15:57:01 +00:00
sergei
5ec95691c0 * fpc_val_real_shortstr: some more minor/style cleanup.
git-svn-id: trunk@25548 -
2013-09-24 15:38:15 +00:00
sergei
38c2fb755a * RTL, fpc_val_real_shortstr(): somewhat simplified, functionality is not changed.
git-svn-id: trunk@25481 -
2013-09-13 16:17:58 +00:00
sergei
b0153f1482 * RTL, fpc_val_int64_shortstr and fpc_val_qword_shortstr: variable 'u' does not have to be 64-bit because it only takes values 0 to 15. Changing to sizeint improves code quality on 32-bit targets.
* fpc_val_uint_shortstr and fpc_val_qword_shortstr: variable 'prev' is not needed, removed.
* ShortCompareText: variable 'i' type changed from integer to sizeint; integer is 16-bit here, resulting in suboptimal code on non-x86.

git-svn-id: trunk@25159 -
2013-07-22 10:13:03 +00:00
nickysn
cac6ac38d0 + added RTL helpers for Val() for longint/dword on 16/8-bit CPUs
git-svn-id: branches/i8086@24048 -
2013-03-29 01:19:14 +00:00
nickysn
4dfbf148f2 + added Str() helpers for 32-bit ints for 16/8-bit CPUs
git-svn-id: branches/i8086@24008 -
2013-03-25 23:55:47 +00:00
Jonas Maebe
a8a1bb6449 * fixed inserting something in a shortstring past its maximum length
(mantis #23744)

git-svn-id: trunk@23524 -
2013-01-26 19:27:17 +00:00
florian
1294ea4357 * patches by Max Nazhalov to solve some issues with currency formatting, resolves #18704 and #22063
git-svn-id: trunk@21339 -
2012-05-19 14:54:46 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00
paul
19d1cf9470 rtl: reduce amount of warnings regards implicit string conversions + little formatting
git-svn-id: trunk@20925 -
2012-04-19 01:33:47 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
florian
3297be603f * patch by Max Nazhalov to clean up changes of r20701
git-svn-id: trunk@20750 -
2012-04-07 19:25:47 +00:00