Commit Graph

40579 Commits

Author SHA1 Message Date
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
Jonas Maebe
da7a67bc74 + FPCRTL_FILESYSTEM_SINGLE_BYTE_API define that is set for targets where we
use a single byte API for file system operations
  + FPCRTL_FILESYSTEM_TWO_BYTE_API define that is set for targets where we
    use a single byte API for file system operations
   o in principle, both can be set if both are supprted and implemented in
     the RTL in order to minimise conversions depending on the scenario

git-svn-id: branches/cpstrrtl@24991 -
2013-06-27 21:37:39 +00:00
Jonas Maebe
7659bfc01b - removed internal error if savesize of tfiledef is 0 when writing the def
to the ppu file, because it does not exist on the JVM platform and
    hence will be 0 (and on other platforms, you'll get a fatal error earlier
    in case the filerec type cannot be found) (originally added as part of
    r24957)

git-svn-id: branches/cpstrrtl@24990 -
2013-06-27 21:37:32 +00:00
Jonas Maebe
ba7fc58bed * declare tsyscharset as a set of ansichar instead of as a set of char
(widechar sets are not (yet?) supported)

git-svn-id: branches/cpstrrtl@24989 -
2013-06-27 21:37:29 +00:00
Jonas Maebe
4c7605d6bf * fixed duplicate StringToTB definition error in r22467; only kept the
new StringToTB implementation (rawbytestring), because it ensures we
    don't overflow the transfer buffer size

git-svn-id: branches/cpstrrtl@24988 -
2013-06-27 21:37:25 +00:00
Jonas Maebe
b0613d9ec5 * converted Windows FileCreate/FileOpen to use unicode interface instead of
ansistring

git-svn-id: branches/cpstrrtl@24969 -
2013-06-24 21:24:13 +00:00
Jonas Maebe
ff87431565 - removed "PathOnly" field from Unix TSearchRec (deprecated since 2.4.0, not
initialised or used on any target))

git-svn-id: branches/cpstrrtl@24968 -
2013-06-24 21:24:09 +00:00
Jonas Maebe
e65d01a717 * small optimisation for ToSingleByteFileSystemEncodedFileName(rawbytestring):
don't call SetCodePage() if the input already has the correct code page
    (SetCodePage would always make the string unique, which is not necessary)

git-svn-id: branches/cpstrrtl@24962 -
2013-06-24 09:40:06 +00:00
Jonas Maebe
980975ff85 * fixed fpc_UnicodeStr_SetLength for 2.6.x bootstrapping
git-svn-id: branches/cpstrrtl@24961 -
2013-06-24 09:40:03 +00:00
Jonas Maebe
3694b4f003 * moved ToSingleByteFileSystemEncodedFileName() to the system unit and
export it so it can be used in all rtl units

git-svn-id: branches/cpstrrtl@24960 -
2013-06-24 09:40:00 +00:00
Jonas Maebe
e6c812a60a * assume unicode in case of FPC_OS_UNICODE instead of only for WinCE
git-svn-id: branches/cpstrrtl@24959 -
2013-06-24 09:39:57 +00:00
Jonas Maebe
112fafc6fd + paramstr(longint):unicode string function in uuchar
* optimised objpas.paramstr (let the compiler convert the pchar to
    ansistring instead of using an unoptimised loop)

git-svn-id: branches/cpstrrtl@24958 -
2013-06-24 09:39:54 +00:00
Jonas Maebe
5a72bc3656 * export filerec/textrec from the system unit and use them in the compiler
to determine their size, rather than hardcoding the size for all possible
    configurations

git-svn-id: branches/cpstrrtl@24957 -
2013-06-24 09:39:50 +00:00
Jonas Maebe
eae1cd6cca * msdos target was added after the cpstrrtl branch was created; no special
defines

git-svn-id: branches/cpstrrtl@24914 -
2013-06-18 10:57:49 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
o resolved conflict in updated morphos sysutils unit
   o moved code that had been added to the now deleted  sysunix.inc to the
     unix-specific block of the fpwidestring unit's init code

git-svn-id: branches/cpstrrtl@24913 -
2013-06-17 20:50:02 +00:00
pierre
91bc424694 Fix bug report 24612:
hermes package has compile error with introduced at r24910.
  Solved by checking that the procdef is not declared forward.

git-svn-id: trunk@24912 -
2013-06-17 15:21:07 +00:00
pierre
4892461009 Fix error in script about check if C compiler is GNU
git-svn-id: trunk@24911 -
2013-06-17 08:18:30 +00:00
florian
37df6f6455 * nostackframe now results in an error if used on pascal subroutines
git-svn-id: trunk@24910 -
2013-06-16 18:59:03 +00:00
florian
fc72490166 * handle LOC_*FPUREGISTER correctly when using sse2 sqr, resolve #26408
git-svn-id: trunk@24909 -
2013-06-16 18:48:08 +00:00
mazen
9c4052b505 + Added a new directive, CFGDIR, to configuration file allowing user to add a directory to a list where included configuration files are searched.
git-svn-id: trunk@24908 -
2013-06-16 15:43:10 +00:00
florian
9b6094a58c + added a few BMI instructions to see if they can be encoded
git-svn-id: trunk@24907 -
2013-06-16 09:35:21 +00:00
florian
0a84f1f10c + avx uses add to multiply by 2
* formatting

git-svn-id: trunk@24906 -
2013-06-15 21:18:40 +00:00
michael
7e72f856ce * Fix for bug ID #24603 (initialize result of TJSONObject.DoFormatJSON)
git-svn-id: trunk@24905 -
2013-06-15 16:14:35 +00:00
sergei
121271c38f * MIPS case node: simplified code a bit.
* Moved jump tables into data segment. For disassembly-based stack unwinding to work properly, MIPS ABI expects text segment to contain instructions only.

git-svn-id: trunk@24904 -
2013-06-15 12:36:21 +00:00
sergei
5bcae5a80a - Removed TMIPSParaManager.getintparaloc method, its generic implementation from r24716 works without issues.
git-svn-id: trunk@24903 -
2013-06-15 12:24:19 +00:00
nickysn
e291805880 * i8086 compilation fixed after r24896
git-svn-id: trunk@24902 -
2013-06-15 10:33:18 +00:00
sergei
a4217da7df * Factored repeating code into separate procedure (IsJumpToLabel)
- Assigned(x) check before "x is y" is redundant because "is" operator does the same check.

git-svn-id: trunk@24901 -
2013-06-15 07:02:47 +00:00
sergei
8b8553991a + MIPS: prevent coalescing written-to registers with $sp,$fp,$zero and $at.
+ Implemented subset of "spill replace" functionality, replacing moves from/to spilled registers with loads/stores to spill locations. This helps to reduce amount of instructions.

git-svn-id: trunk@24900 -
2013-06-15 04:04:08 +00:00
florian
0af7a6f92c + has_life_info
* successor info for for nodes fixed

git-svn-id: trunk@24899 -
2013-06-14 20:52:40 +00:00
florian
3016d48521 * clear optinfo after allocating it
git-svn-id: trunk@24898 -
2013-06-14 20:52:38 +00:00
florian
d8ff85846f * don't reuse mm registers used by child nodes
git-svn-id: trunk@24897 -
2013-06-14 20:52:36 +00:00
florian
e81d2d1f3b * basic avx support for floating point operations (use -Cfavx to activate)
git-svn-id: trunk@24896 -
2013-06-14 20:03:01 +00:00
sergei
6a8e4f0381 * MIPS: generate real instructions, not macros, for comparisons with $zero.
* g_concatcopy, g_concatcopy_unaligned: call a_cmp_reg_reg_label instead of duplicating code.

git-svn-id: trunk@24895 -
2013-06-14 07:27:48 +00:00
sergei
fb88cc4257 * TCGMIPS.a_load_reg_reg: reduce code duplication, and don't generate same register move for OS_32->OS_S32 and vice versa. Such moves explode into at least 4 instructions if register needs spilling, after which they are no longer recognized and cannot be removed by reg.allocator. So it's much better not to generate them in first place.
* Implemented overflow checking for multiplication, no longer generate MULO and MULOU macros.

git-svn-id: trunk@24894 -
2013-06-14 00:12:17 +00:00
sergei
7e0ae2e984 * MIPS: fixed cgsize2subreg to return correct result for float registers.
- TCGMIPS.getfpuregister override is no longer necessary with the above fix.

git-svn-id: trunk@24893 -
2013-06-13 23:50:20 +00:00
svenbarth
b6bfa864d4 Disallow the usage of the inline assembler inside generics, because there are currently two problems:
1. At least on x86 the assembler reader initializes the parameter location informations which results in InternalError 200301231
2. Assembler tokens are not stored in the token stream and thus won't be reproduced during specialization

x86/rax86int.pas, tx86intreader.Assemble:
  * check for "parse_generic" before calling generate_parameter_info
pstatmnt.pas, assembler_block & statement:
  * generate an error message if an asm statement should be parsed inside a generic

+ added test

git-svn-id: trunk@24892 -
2013-06-13 19:42:49 +00:00
florian
caef53e63b * another patch by Max Nazhalov to fix missing exits in the softfpu code
git-svn-id: trunk@24891 -
2013-06-13 19:40:17 +00:00
florian
7f6aa98553 * restored changes made in r24864 which I accidently overwrote with r24871
git-svn-id: trunk@24890 -
2013-06-13 18:38:35 +00:00
michael
30621e2e06 * Patch from Reinier OlieSlagers to correct message in case of not equals (bug ID 24433)
git-svn-id: trunk@24889 -
2013-06-13 14:43:21 +00:00
lacak
f95f42d72b fcl-db: tests: introduce TDBBasicsTestCase as ancestor for other test cases (call DBConnector.StartTest and StopTest from him)
git-svn-id: trunk@24888 -
2013-06-13 11:46:42 +00:00
svenbarth
2e186a91fa Add support for integer constants to SetPEFlags and SetPEOptFlags. This is Delphi compatible.
scandir.pas:
  + add function "get_peflag_const" to retrieve the value of a constant
  * dir_setpeflags & dir_setpeoptflags: first check for an identifier (value is retrieved through "get_peflag_const") and then read a value

+ added messages for illegal parameters for SetPEFlags and SetPEOptFlags respectively
+ added tests

git-svn-id: trunk@24887 -
2013-06-13 10:51:42 +00:00
nickysn
4840a33b80 * also return true in is_calljmp() for the A_JCXZ instruction on the i8086
git-svn-id: trunk@24886 -
2013-06-12 23:42:45 +00:00
sergei
6cb66faffe * Removed redundant assignments to result in UniversalTimeToLocal and LocalTimeToUniversal, Mantis #24582.
git-svn-id: trunk@24884 -
2013-06-12 14:33:23 +00:00
lacak
812efbad13 fcl-db: tests: add TestSQLDB to dbtestframework
git-svn-id: trunk@24883 -
2013-06-12 12:54:37 +00:00