Commit Graph

24 Commits

Author SHA1 Message Date
florian
9bb6a32c62 * avoid wrong warning about FillChar not initializing the output parameter in case count <= 0 2024-01-15 21:54:11 +01:00
Michael VAN CANNEYT
d2d3fe6bc3 * Char -> AnsiChar 2023-07-14 17:26:10 +02:00
florian
5442e9f9d8 * insert explicit type cast for the count parameter of move/fillchar wrapping C functions,
avoids a warning in combination with -O3 and negative count values

git-svn-id: trunk@49205 -
2021-04-14 19:02:54 +00:00
svenbarth
daa746243a * use clib constant instead of literal 'c' in case we have a target where the library is not called 'c' (hopefully all targets that use cgeneric.inc have the clib constant declared in their sysos.inc)
git-svn-id: trunk@43121 -
2019-10-05 09:42:55 +00:00
svenbarth
dcfd734bbf Fix cycling with -dFPC_USE_LIBC on Linux systems to allow usage of FPC Linux programs on OSv.
memchr seems to have a bug on recent Linux systems if the count that is passed in is larger than the buffer (in our specific case the count is -1 to find the 0 byte of \0 terminated strings): the function "randomly" fails to find the byte and returns zero thus leading to for example incorrect parameter handling.

rtl/inc/cgeneric.inc:
  * use rawmemchr on Linux if -1 is passed as count

git-svn-id: trunk@30160 -
2015-03-10 18:34:04 +00:00
sergei
4ebc34c5e7 * Promoted result type of FPC_PCHAR_LENGTH and FPC_PWIDECHAR_LENGTH to SizeInt.
+ Check for nil pointer in FPC_PWIDECHAR_LENGTH

git-svn-id: trunk@17733 -
2011-06-13 04:59:17 +00:00
Jonas Maebe
22aacd2a60 * return 0 for length(pchar(0)), like Kylix does (using corrected and
multi-platform version of patch in r12461, which caused the i386 version
    of fpc_pchar_length to return 0 in all cases, which used tabs, and did
    not include a test case)

git-svn-id: trunk@12464 -
2009-01-01 22:02:17 +00:00
Jonas Maebe
95abc479ac * actually assign result of strncmp to comparechar0 result
git-svn-id: trunk@9221 -
2007-11-12 21:26:07 +00:00
Jonas Maebe
eb6c8fa570 * one more typecast fix
git-svn-id: trunk@8818 -
2007-10-15 14:02:30 +00:00
Jonas Maebe
4486a2cecb * fixed some type casts
git-svn-id: trunk@8817 -
2007-10-15 13:58:45 +00:00
Jonas Maebe
6121df1f67 * moved inclusion of sysos.inc higher up in system.inc, so that
cgeneric.inc can use the C types
  * imports of C routines in cgeneric.inc now use C types

git-svn-id: trunk@8816 -
2007-10-15 13:51:51 +00:00
peter
e8322a83e4 * optimized generic implementations to use pointers instead of
array accesses. This also allows better register variable
    optimizations

git-svn-id: trunk@8742 -
2007-10-07 18:36:18 +00:00
Jonas Maebe
5b9f58ef73 * reverted r2037 because of braindead "out" semantics for refcounted
types

git-svn-id: trunk@2045 -
2005-12-24 01:06:05 +00:00
Jonas Maebe
84aab46550 * changed formal "var" paramters of move, movechar0 and fill* into
"out" parameters to avoid wrong "uninitialized" warnings

git-svn-id: trunk@2037 -
2005-12-23 20:59:08 +00:00
tom_at_work
653f4b465d * fixed some typecasts of pointers to Longint for 64 bit architectures (Linux and generic parts of the RTL only)
* 64 bit sockets unit fixes

git-svn-id: trunk@1625 -
2005-11-01 22:40:23 +00:00
tom_at_work
701638138b * fixed exception handling for PowerPC64
* math library is now automatically linked on non-x86 platforms when FPC_USE_LIBC is defined
* generic C system function signature adaptions for 64 bit CPUs 

git-svn-id: trunk@1392 -
2005-10-15 21:24:15 +00:00
michael
93ba0409be + Removed HASCOMPILERPROC define
git-svn-id: trunk@265 -
2005-06-07 21:41:02 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
Jonas Maebe
0f26252376 + cgenmath with libc math functions. Faster than the routines in genmath
and also have full double support (exp() only has support for values in
    the single range in genmath, for example). Used in FPC_USE_LIBC is
    defined
  * several fixes to allow compilation with -dHASINLINE, but internalerrors
    because of missing support for inlining assembler code
2004-10-09 21:00:46 +00:00
Jonas Maebe
dedf697f3a * use some more string routines from libc if FPC_USE_LIBC is used 2004-05-01 15:26:33 +00:00
Jonas Maebe
5439babeb5 + cgeneric.inc: implementations of rtl routines based on libc
* system.inc: include cgeneric.inc before powerpc.inc/i386.inc/... if
    FPC_USE_LIBC is defined
  * powerpc.inc, i386.inc: check whether the routines they implement aren't
    implemented yet in another include file (cgeneric.inc)
2004-01-11 11:10:07 +00:00