Commit Graph

40856 Commits

Author SHA1 Message Date
Jonas Maebe
d66d15aad3 + added mkdir/chdir/rmdir(rawbytestring) and (unicodestring) to the system unit
* renamed platform-specific pchar versions of those rouines to do_*() and
    changed them to either rawbytestring or unicodestring depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API setting
  * implemented generic shortstring versions of those routines on top of either
    rawbytestring or unicodestring depending on the API-kind (in case of the
    embedded target, if ansistring are not supported they will map directly
    to shortstring routines instead)
  * all platform-specific *dir() routines with rawbytestring parameters now
    receive their parameters in DefaultFileSystemCodePage
  - removed no longer required ansistring variants from the objpas unit
  - removed no longer required FPC_SYS_MKDIR etc aliases
  * factored out empty string and inoutres<>0 checks from platform-specific
    *dir() routines to generic ones
  o platform-specific notes:
   o amiga/morphos: check new pathconv(rawbytestring) function
   o macos TODO: convert PathArgToFSSpec (and the routines it calls) to
     rawbytestring
   o nativent: added SysUnicodeStringToNtStr() function
   o wii: convert dirio callbacks to use rawbytestring to avoid conversion
  + test for unicode mk/ch/rm/getdir()

git-svn-id: branches/cpstrrtl@25048 -
2013-07-04 22:28:37 +00:00
Jonas Maebe
e26210f448 * fixed wii compilation after r24993
git-svn-id: branches/cpstrrtl@25047 -
2013-07-04 22:28:31 +00:00
Jonas Maebe
893a9a57c6 * missing getdir -> do_getdir rename for r24993
git-svn-id: branches/cpstrrtl@25046 -
2013-07-04 22:28:27 +00:00
Jonas Maebe
ab9036ecbf + missing unicodestring version of ExpandUNCFileName
* make ansistring version of ExpandUNCFileName call the unicodestring version

git-svn-id: branches/cpstrrtl@25045 -
2013-07-04 22:28:24 +00:00
Jonas Maebe
8368f7dba5 * call unicodestring version of ExpandUNCFileName from ansistring version
instead of infinitely recursing into the ansistring version

git-svn-id: branches/cpstrrtl@25044 -
2013-07-04 22:28:20 +00:00
Jonas Maebe
3ba39f8e71 * fixed building after cpall unit addition
git-svn-id: branches/cpstrrtl@25043 -
2013-07-04 22:28:17 +00:00
Jonas Maebe
08ab4dcabe * convert calls to GetCurrentDirectory to *W in Windows do_getdir()
git-svn-id: branches/cpstrrtl@25042 -
2013-07-04 22:28:13 +00:00
Jonas Maebe
6dbcb7db80 + rawbytestring version of PathConv()
git-svn-id: branches/cpstrrtl@25041 -
2013-07-04 22:28:09 +00:00
Jonas Maebe
fd0a2ac365 + SysUnicodeStringToNtStr() helper
git-svn-id: branches/cpstrrtl@25040 -
2013-07-04 22:28:05 +00:00
florian
963a488ca2 * handle also LOC_CREGISTER/LOC_CMMREGISTER in tcgvecnode.pass_generate_code, resolves #24705
git-svn-id: trunk@25039 -
2013-07-04 19:36:28 +00:00
sergei
59d6df4fca * MIPS: replaced opcode mapping functions with array, much shorter that way. Separate "overflow" mapping is also no longer needed.
* Use SRAV/SRLV/SLLV opcodes for shifts by variable amount.

git-svn-id: trunk@25038 -
2013-07-04 14:26:44 +00:00
sergei
30a6432a17 + Assembler implementation of SarInt64 for i386.
git-svn-id: trunk@25037 -
2013-07-04 09:43:30 +00:00
lacak
7c110e9b42 fcl-db:
- for MSSQL map TINYINT to ftWord 
- for SQLite map TINYINT to ftSmallint 
- TestTinyint

git-svn-id: trunk@25036 -
2013-07-04 08:25:33 +00:00
lacak
206e5eb475 fcl-db: odbc: map ftWord fields to TWordField (avoid potential problem with Big Endian systems)
git-svn-id: trunk@25035 -
2013-07-04 06:46:45 +00:00
nickysn
3505ba4ee6 + added CPU detection code in the msdos rtl startup in order to properly initialize the Test8086 variable
git-svn-id: trunk@25034 -
2013-07-03 15:43:01 +00:00
sergei
1c84c3edbf * Fixed label optimizer to work with MIPS, and enabled level 1 optimization for MIPS targets.
The difference in branch instruction formats is isolated in function JumpTargetOp, it is a plain function rather than a virtual method, so it can be easily inlined and, after inlining, produces the same code for non-MIPS targets as it was before change.

git-svn-id: trunk@25033 -
2013-07-03 14:40:24 +00:00
lacak
7a46ebd7f1 fcl-db: odbc: map UNSIGNED SMALLINT to ftWord fields. TestSupportWordFields
git-svn-id: trunk@25032 -
2013-07-03 08:24:51 +00:00
florian
162cb30528 * another patch by Max Nazhalov to fix shifting and rounding of float128
git-svn-id: trunk@25031 -
2013-07-02 21:03:39 +00:00
sergei
8823574fe2 * MIPS: get rid of DIV and DIVU macros.
git-svn-id: trunk@25030 -
2013-07-02 14:28:10 +00:00
sergei
d0ae800da6 + MIPS: Use INS and EXT instructions for bit manipulations when target CPU type is set to mips32r2.
git-svn-id: trunk@25029 -
2013-07-02 14:21:29 +00:00
pierre
eb1ff90de1 Fix jvm compiler compilation failure after rev 25013
git-svn-id: trunk@25028 -
2013-07-02 12:52:32 +00:00
lacak
1ffcb9c1e6 fcl-db: mssql: add comments
git-svn-id: trunk@25027 -
2013-07-02 11:38:33 +00:00
lacak
f2464fbf3d fcl-db: mysql: formatting (remove unused variables)
git-svn-id: trunk@25026 -
2013-07-02 11:29:15 +00:00
lacak
029eb92bd0 fcl-db: mysql: map UNSIGNED SMALLINT to ftWord fields. TestSupportWordFields
git-svn-id: trunk@25025 -
2013-07-02 11:20:04 +00:00
sergei
828309e61d - MIPS: removed opcodes that are not in any known documentation.
git-svn-id: trunk@25023 -
2013-07-01 06:09:53 +00:00
florian
a0292b8962 * patch by Max Nazhalov to fix more conversion issues of the C code translation, resolves #24691
git-svn-id: trunk@25022 -
2013-06-30 18:07:40 +00:00
marco
ee5ce52d4c * Simple Add/remove firewall rule wrapper by d4nn13 (forum)
git-svn-id: trunk@25021 -
2013-06-30 16:19:01 +00:00
florian
6ab95815d8 * try to optimze (p-/+const)^ by putting const into the offset of the generated reference
git-svn-id: trunk@25014 -
2013-06-29 22:20:34 +00:00
florian
be2ab84474 * make actualtargetnode a normal procedure using pointers to node so it can be used also when replacing nodes
+ replacenode to replace nodes inline

git-svn-id: trunk@25013 -
2013-06-29 22:20:30 +00:00
nickysn
7e70a5f763 * i8086 fix after r25010: i8086 doesn't support lea sp,[sp-XXX]
git-svn-id: trunk@25012 -
2013-06-29 12:21:15 +00:00
Tomas Hajny
67b3017751 * RealMaxPathLen added - value queried from the system on startup
git-svn-id: trunk@25011 -
2013-06-28 21:02:04 +00:00
florian
94cf650d9a * use lea to adjust stack pointer, this is equal or faster on all modern CPUs than add/sub
git-svn-id: trunk@25010 -
2013-06-28 17:06:57 +00:00
Jonas Maebe
2e9b642a3b * rtldefs.inc include file for embedded targets (forgot to commit earlier)
git-svn-id: branches/cpstrrtl@25009 -
2013-06-28 15:46:31 +00:00
sergei
7810d6637a * MIPS: improved 64-bit comparisons by using cg.a_cmp_reg_reg_label, uses less instructions and registers when comparing with zero.
git-svn-id: trunk@25008 -
2013-06-28 15:46:17 +00:00
sergei
7a28815182 * r24895 used wrong expression for swapping sides of comparison, and it went undetected by tests. Fixed.
git-svn-id: trunk@25007 -
2013-06-28 15:40:37 +00:00
Jonas Maebe
5ed4e99dc1 + uppercase/lowercase(unicodestring) (fixes a warning in fina.inc when
compiled with unicodestring)
  * changed uppercase/lowercase(ansistring) to use the same logic as the
    new unicode versions (unify code for lower/upper, only make result
    unique if necessary)
  + test for all four routines

git-svn-id: branches/cpstrrtl@25006 -
2013-06-28 12:46:25 +00:00
sergei
40045e6269 - Removed unused variables
git-svn-id: trunk@25005 -
2013-06-28 11:53:10 +00:00
sergei
8bfef107b3 * TAB characters removed.
git-svn-id: trunk@25004 -
2013-06-28 10:58:22 +00:00
sergei
c855868a3d * MIPS: get rid of macros in comparison operations, use immediate operands for comparison with constants when possible.
+ InternalError if valid GP is needed but pi_needs_got was not set in pass 1.

git-svn-id: trunk@25003 -
2013-06-28 10:22:26 +00:00
Jonas Maebe
bae3c0296e * fixed result type of StrBufSize(PWideChar) for 64 bit targets
git-svn-id: branches/cpstrrtl@25002 -
2013-06-28 08:41:46 +00:00
Jonas Maebe
8a4b092ab9 * made ToSingleByteFileSystemEncodedFileName(unicodestring) overridable by
target-specific code and implemented a JVM-compatible version

git-svn-id: branches/cpstrrtl@25001 -
2013-06-27 21:38:17 +00:00
Jonas Maebe
1da05d1553 * declared CharInSet(ansichar,tsyscharset) as inline
* moved the inclusion of sysansi.inc to before the inclusion of all other
    sysutils include files so the inline body of CharInSet is available

git-svn-id: branches/cpstrrtl@25000 -
2013-06-27 21:38:13 +00:00
Jonas Maebe
b08d8091b2 * made fexpand unicodestring-safe (use charinset instead of "in" --
"widechar in set" compiles, but results in a runtime conversion of
    the widechar into an ansistring and then getting the first character
    of that ansistring, which is horribly slow -- and Delphi-incompatible,
    but introduced a long time ago because of bug #7758)
  * replaced all "in" operations in sysutils fina.inc with CharInSet for
    the same reason
  * replaced all "string" declarations in finah.inc/fina.inc with "PathStr"
    and "pchar" with "PathPChar", and include them twice in sysutilh.inc/
    sysutils.inc, once with PathStr=UnicodeString/PathPChar=PWideChar and
    once with PathStr=AnsiString/PathPChar=PAnsiChar (not rawbytestring
    because there are several routines with var-parameters and then the
    string type has to match exactly; the "rtlproc" modifier could circumvent
    this, but should be used sparingly, and additionally the routine's
    internals would then first also have to be reviewed to ensure that at
    no point they start mixing in strings with the defaultsystemcodepage
    (e.g. directory separators) without first adjusting their codepage)
  * call GetShortPathNameA or GetShortPathNameW in ExtractShortPathName on
    Windows depending on whether we are parsing the RawByteString/UnicodeString
    version of fina.inc
  + ExpandUNCFileName(unicode) version for Windows, let its
    ExpandUNCFileName(ansistring) call the unicode version (avoid data loss
    due to ansi conversion) and convert the result to
    DefaultRTLFileSystemCodePage (to have no more data loss than what's
    specified by the user)

git-svn-id: branches/cpstrrtl@24999 -
2013-06-27 21:38:10 +00:00
Jonas Maebe
746546ed09 + remaining missing pwidechar overloads/equivalents of pchar functions
(strecopy, strend, strcat, strcomp, strlcomp, stricomp, strlcat, strrscan,
     strlower, strupper, strlicomp, strpos, WideStrAlloc, StrBufSize,
     StrDispose)
  * adjusted pwidechar version of strnew to call WideStrAlloc instead of
    StrAlloc
  + tests for several newly added sysutils pwidechar routines based on
    existing tests for equivalent pchar routines
  * converted several sysutils ansistr*() function tests to tests for str*
    functions

git-svn-id: branches/cpstrrtl@24998 -
2013-06-27 21:38:06 +00:00
Jonas Maebe
eb93429cf0 * prefer "constant string" -> pwidechar for {$modeswitch unicodestrings}
* prefer "constant char" -> pchar to "constant char" -> pwidechar, and
    "constant widechar" -> pwidechar to "constant widechar" -> pchar

git-svn-id: branches/cpstrrtl@24997 -
2013-06-27 21:38:02 +00:00
Jonas Maebe
c49ae76837 * let StrBufSize return a cardinal rather than a sizeuint, and also change
its internal pointer arithmetic to use cardinal, because that's also what
    stralloc uses to initialize that value

git-svn-id: branches/cpstrrtl@24996 -
2013-06-27 21:37:58 +00:00
Jonas Maebe
8f1e85d9ae * moved SameFileName from finah.inc to sysansih.inc, since the implementation
is in sysansi.inc

git-svn-id: branches/cpstrrtl@24995 -
2013-06-27 21:37:55 +00:00
Jonas Maebe
95a877c7e5 * moved GetFileHandle() from fina.inc to filutil.inc because fina.inc
will be included twice using different string types (and those two
    routines don't have a string argument, so this would result in duplicate
    definitions), and their declaration is in filutilh.inc rather than
    finah.inc anyway
  * ensure that the fina.inc "MaxDirs" constant gets declared only once
  * ensure that the finah.inc "TFilenameCaseMatch" type gets declared only
    once

git-svn-id: branches/cpstrrtl@24994 -
2013-06-27 21:37:51 +00:00
Jonas Maebe
62ee16278b * changed getdir(ansistring):ansistring to
getdir(rawbytestring):rawbytestring so it can accept strings in any
    encoding and cleanly return results in DefaultRTLFileSystemCodePage
  + getdir(unicodestring):unicodestring
  * renamed the getdir implementation of all platforms except for embedded-
    without-ansistring-support to do_getdir(), and depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API define
    changed its shortstring parameter to ansistring or unicodestring. The
    do_getdir(rawbytestring) routine should just set the code page of the
    return value to DefaultFileSystemCodePage without conversion (not
    DefaultRTLFileSystemCodePage with conversion, that conversion is performed
    in getdir if necessary; this avoids double conversions in case
    getdir(unicodestring) is called)
  + generic getdir(shortstring) for platforms supporting either ansistrings or widestrings
  o platform maintainers:
   o OS/2: adjust code to supports paths > 255 characters if those are supported
   o Wii: adjust used callback to use rawbytestring to support paths > 255 characters and
     avoid shortstring->rawbytestring conversion overhead
   o Windows: GetCurrentDirectoryW is now always used (to prevent data loss)

git-svn-id: branches/cpstrrtl@24993 -
2013-06-27 21:37:47 +00:00
Jonas Maebe
679785f90c + rawbytestring and unicodestring versions of DoDirSeparators (optimised to
prevent calling uniquestring multiple times)

git-svn-id: branches/cpstrrtl@24992 -
2013-06-27 21:37:43 +00:00