Re: [fpc-pascal] Floating point question

2024-02-20 Thread Bernd Oppolzer via fpc-pascal
See below ... Am 19.02.2024 um 02:00 schrieb James Richters via fpc-pascal: >And if you have set the precision, then the calculation will be identical to the calculation when you use a variable of the same type (if not, it's indeed a bug). This is what I have been trying to point out.Math

Re: [fpc-pascal] Floating point question

2024-02-17 Thread Bernd Oppolzer via fpc-pascal
, controlled by the type of y1. But this could be controlled by ANOTHER new option, if someone asks for it. Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Floating point question

2024-02-17 Thread Bernd Oppolzer via fpc-pascal
Am 17.02.2024 um 16:38 schrieb Bernd Oppolzer: IMO, a compiler switch that gives all FP constants the best available precision would solve the problem - BTW: WITHOUT forcing expressions where they appear to use this precision, if the other parts of the expression have lower precision. In

Re: [fpc-pascal] Floating point question

2024-02-17 Thread Bernd Oppolzer via fpc-pascal
uld do. That's why I write all those mails (although I am not an active FPC user), because I want all Pascal versions around to implement a clear and UNDERSTANDABLE language without strange effects. Kind regards Bernd (incidentally, this is one of the reasons the FPC team does not

Re: [fpc-pascal] Floating point question

2024-02-17 Thread Bernd Oppolzer via fpc-pascal
he y2 case as in the const declarations. Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Floating point question

2024-02-16 Thread Bernd Oppolzer via fpc-pascal
Am 16.02.2024 um 15:57 schrieb James Richters via fpc-pascal: So you are saying when constant propagation is on, an expression should have a different result than with constant propagation off? The result of math when using constants MUST be the same as the result of identical math using var

Re: [fpc-pascal] Floating point question

2024-02-16 Thread Bernd Oppolzer via fpc-pascal
ts of the reduced type (which I believe it does, no matter how the syntax is), I find it acceptable if the computation is done using single precision, because that's what the developer calls for. So probably the answer to your question is: yes. Kind rega

Re: [fpc-pascal] Floating point question

2024-02-13 Thread Bernd Oppolzer via fpc-pascal
My opinions about the solutions below ... Am 13.02.2024 um 12:07 schrieb Thomas Kurz via fpc-pascal: But, sorry, because we are talking about compile time math, performance (nanoseconds) in this case doesn't count, IMO. That's what i thought at first, too. But then I started thinking about

Re: [fpc-pascal] Floating point question

2024-02-13 Thread Bernd Oppolzer via fpc-pascal
Am 13.02.2024 um 10:54 schrieb Michael Van Canneyt via fpc-pascal: On Tue, 13 Feb 2024, James Richters via fpc-pascal wrote: Sorry for the kind of duplicate post, I submitted it yesterday morning and I thought it failed, so I re-did it and tried again.. then after that the original one showe

Re: [fpc-pascal] Floating point question

2024-02-13 Thread Bernd Oppolzer via fpc-pascal
se, if you wish. It's all about context ... Kind regards Bernd Am 12.02.2024 um 10:44 schrieb Thomas Kurz via fpc-pascal: I wouldn't say so. Or at least, not generally. Why can't the compiler do what the programer intends to do: var s: single; d: double; e: exten

Re: [fpc-pascal] Floating point question

2024-02-11 Thread Bernd Oppolzer via fpc-pascal
g the maximum precision, no matter if it is done at compile time or at run time ... and this would IMHO be the solution which is the easiest to document and maybe to implement and which would satisfy the users. Kind regards Bernd Oppolzer ___ fpc-p

Re: [fpc-pascal] Floating point question

2024-02-06 Thread Bernd Oppolzer via fpc-pascal
s HH, because the computation involving the constants (hopefully done by the compiler) would be done with the best available precision. HTH, kind regards Bernd Am 06.02.2024 um 16:23 schrieb James Richters via fpc-pascal: program TESTDBL1 ; Const HH = 8427.02291

Re: [fpc-pascal] Floating point question

2024-01-28 Thread Bernd Oppolzer via fpc-pascal
at this place, prints the 8, and then only zeroes. The extended format internally has more hex digits and therefore can reliably show more decimal digits. But the last two are wrong, too (the exact value is 6... period). HTH, kind regards Bernd Am 27.01.2024 um 22:53 schrieb Bart via fpc-

Re: [fpc-pascal] case statement

2023-12-17 Thread Bernd Oppolzer via fpc-pascal
ctions were inspired by PL/1 functions, indeed. Kind regards Bernd Regards, Adriaan van Os ___ fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] case statement

2023-12-17 Thread Bernd Oppolzer via fpc-pascal
range" character sets like EBCDIC. When I ported it to ASCII based machines in 2016, I had some trouble with case statements based on character variables and expressions. See the story here: http://bernd-oppolzer.de/job9i025.htm ___ fpc-pascal mailli

Re: [fpc-pascal] Does the compiler make prodigious use of use ENTER instruction?

2023-12-12 Thread Bernd Oppolzer via fpc-pascal
I wrote a comment on the original Microsoft dev blog (for a non-Pascal community), maybe it's of interest here, too ... In normal Pascal procedure calls, such a vector of stack frame addresses is not needed. A standard Pascal runtime knows all the time about the current stack frame address of

Re: [fpc-pascal] Does the compiler make prodigious use of use ENTER instruction?

2023-12-12 Thread Bernd Oppolzer via fpc-pascal
have to be set and restored when entering or leaving a function. I had the idea to extend the limit from 9 to 20, but there was no hard requirement so far, so I left it at 9. C, for example, and other "modern" languages, have a static limit of 1. Kind regards Bernd Some forms of

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Bernd Oppolzer via fpc-pascal
regards Bernd Am 10.08.2023 um 10:52 schrieb Elmar Haneke via fpc-pascal: 1) what does "i := x - x;" do and what is it's purpose and why doesn't "x + x" work the same? Subtracting pointers may be useful if they point to consecutive memory. The Result is the number o

Re: [fpc-pascal] Legitimate use of for and break

2023-06-18 Thread Bernd Oppolzer via fpc-pascal
therwise, goto? Break is common in basically all languages now. Can't think of a language I've used without it. FWIW, when I started to work on New Stanford Pascal (http://bernd-oppolzer.de/job9.htm) in 2011, the very first thing that I did was to add BREAK, CONTINUE and RETURN to this com

Re: [fpc-pascal] Converting old pascal written for Pascal/MT+ compiler

2023-04-04 Thread Bernd Oppolzer via fpc-pascal
e nightmare, this is very good to run the program once during program test, because it will show if your program depends on such effects or if it produces different values, depending on initialized or uninitialized local variables. Kind regards Bernd The program depends on this feature i

Re: [fpc-pascal] My Linux service application consumes 10% CPU when idling - why?

2021-10-24 Thread Bernd K. via fpc-pascal
info contained in the executable (not as external debug file), maybe also reduce the optimization level if, and it should be able to show you the call tree along with time consumption of each function. Bernd ___ fpc-pascal maillist - fpc-p

Re: [fpc-pascal] Is RV32I instruction set for RISC-V (embedded) supported?

2021-03-10 Thread Bernd Mueller via fpc-pascal
On 3/5/21 6:22 PM, Florian Klämpfl via fpc-pascal wrote: It is not expected that it works as RiscV support is still work in progress, but it should work ;) I'll look into it. Thank you. For me, the compiler for RV32I/RV32IMAC works already pretty well. Regards,

Re: [fpc-pascal] Is RV32I instruction set for RISC-V (embedded) supported?

2021-03-06 Thread Bernd Mueller via fpc-pascal
I saw your changes in revision 48881, downloaded latest trunk, compiled with make crosszipinstall CPU_TARGET=riscv32 OS_TARGET=embedded SUBARCH=rv32i but the problem remains: make[4]: Entering directory '/home/bernd/fpc/fpc331/48882/src/rtl/embedded' /bin/mkdir -p /home/bernd/fpc/fp

[fpc-pascal] Is RV32I instruction set for RISC-V (embedded) supported?

2021-03-05 Thread Bernd Mueller via fpc-pascal
message, when I try to compile the crosscompiler/rtl: /home/bernd/fpc/fpc331/48875/src/compiler/ppcrossrv32 -Ur -Cprv32i -Tembedded -Priscv32 -XPriscv32-embedded- -Ur -Xs -O2 -n -Fi../inc -Fi../riscv32 -FE. -FU/home/bernd/fpc/fpc331/48875/src/rtl/units/riscv32-embedded -Fl/home/bernd/riscv/riscv_2008

Re: [fpc-pascal] Graphing library

2020-11-15 Thread Bernd Oppolzer via fpc-pascal
Hi, I don't know if this can help you, but in the 1980s I worked with a library called GKS (graphic kernel system) which I used to build such graphics like the following example: http://bernd-oppolzer.de/fdynsb.pdf This programs that did this were written in Pascal at that time. It

Re: [fpc-pascal] basic question on begin, end;

2020-09-26 Thread Bernd Oppolzer via fpc-pascal
s the indentation, is in many cases scheduled automatically after a successful compiler run. This is how a program looks after automated indentation: https://github.com/StanfordPascal/Pascal/blob/master/PASCAL1.pas Kind regards Bernd ___ fpc-pascal maillist -

Re: [fpc-pascal] Floating point exception not always caught on Linux i386.

2019-10-11 Thread Bernd Mueller
On 10/11/19 10:51 AM, Bart wrote: See https://www.freepascal.org/docs-html/current/prog/progsu69.html#x76-750001.2.69 sorry, I forgot to mention, that I checked with {$SAFEFPUEXCEPTIONS ON}, but it did not change the behavior. Regards, Bernd

[fpc-pascal] Floating point exception not always caught on Linux i386.

2019-10-11 Thread Bernd Mueller
oduce this problem with the trunk version of the compiler, but all versions down to 2.2.2 show the described behavior. FPC 2.2.0 is working correct. The 64-bit version of FPC 3.0.4 works correct too. Is this something for the bug tracker? Regards, Bernd. ___

Re: [fpc-pascal] Illegal counter variable?

2019-09-09 Thread Bernd Oppolzer
s for many aggressive optimization strategies around loops. Maybe today such limitations seem too restrictive. Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] += property bug?

2019-08-14 Thread Bernd Oppolzer
ndex expression contains for example a function call with side effects :-) PL/1 is another language which has been enhanced to support this notation some years ago. Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freep

[fpc-pascal] Implementation of variant records

2019-07-05 Thread Bernd Oppolzer
he current record type namespace, and this has to be fixed, before I can do this. BTW: is there a forum to discuss general Pascal questions not directly related to the FPC product? FPC-Pascal will sure be the largest auditorium available for such questions ... Thank you, kind rega

Re: [fpc-pascal] Turbo Pascal 3 graphics

2019-05-08 Thread Bernd Oppolzer
o HPGL), it is still possible to do sort of professional graphics programming using much the same functions and features that I used in the 1990s. The language doesn't really matter; it can be C or Pascal. Example output file: http://bernd-oppolzer.de/fdynsb.pdf If you want to know more abou

Re: [fpc-pascal] XML - Indent, text content, special char

2019-04-30 Thread Bernd Oppolzer
ll anything about what a certain parser etc. should do to XML content (IMO, not much), there are not many restrictions (<, of course, should be <) ... attributes are different, of course. Kind regards Bernd ___ fpc-pascal mailli

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Bernd Oppolzer
Am 15.04.2019 um 08:29 schrieb Tomas Hajny: On Mon, April 15, 2019 07:52, Bernd Oppolzer wrote: . . On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: . . Can FPC optimize it so it only reads s[i] once (to register), not 3 times? . . True for New Stanford Pascal

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread Bernd Oppolzer
Am 15.04.2019 um 03:35 schrieb wkitt...@windstream.net: On 4/14/19 7:28 AM, Rainer Stratmann wrote: On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote: E.g. i have a loop which test each s[i] char for several cases: 'a', 'b', 'c'. for i:= 1 to length(s) do if (s[i]='a') or (s[i]='b')

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-14 Thread Bernd Oppolzer
check in this case) is in fact done in stage 2, that is: in the P-Code to 370 translator. The credits for this very fine compiler technology (which is about 40 years old) does not belong to me, but to many other people who worked on this in the 1975 to 1990 era. I only did som

Re: [fpc-pascal] Order of Precedence: FPC/Delphi vs Java

2018-10-06 Thread Bernd Oppolzer
e same on all platforms (again: IBM mainframe and Windows PC, for example), which was not the case before my extension. The story is documented in more detail here (including the Pascal source code of the rounding function): http://bernd-oppolzer.de/job9i032.htm Have fun! Another optio

Re: [fpc-pascal] Order of Precedence: FPC/Delphi vs Java

2018-10-03 Thread Bernd Oppolzer
Some corrections, see below ... Am 03.10.2018 um 11:54 schrieb Bernd Oppolzer: The explanation for the results is as follows: the first three codings do the multiplication first, then the division. the last two first division, then multiplication. That makes the difference. When division

Re: [fpc-pascal] Order of Precedence: FPC/Delphi vs Java

2018-10-03 Thread Bernd Oppolzer
hat's pure luck. Example: Multiplication first:  LOC 21  LOD R,1,416  LOD R,1,408  LOD R,1,416  MPR  LOD R,1,424  DVR  SBR  STR R,1,432 Division first:  LOC 23  LOD R,1,416  LOD R,1,408  LOD R,1,416  LOD R,1,424  DVR  MPR  SBR  STR R,1,432 The result was zero in both cases. Kind regards B

Re: [fpc-pascal] round(2.5)=2

2018-06-08 Thread Bernd Oppolzer
runc(-x + 0.5); end; That is fine, except that I will likely forget it in some unit, and manually inspecting all units is less reliable than when the compiler ensures it. This is not sufficient, IMO, when using float, look here: http://bernd-oppolzer.de/job9i032.htm In Turbo-Pascal the bro

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-03 Thread Bernd Oppolzer
Am 03.06.2018 um 18:12 schrieb Sven Barth via fpc-pascal: Bernd Oppolzer <mailto:bernd.oppol...@t-online.de>> schrieb am So., 3. Juni 2018, 11:56: Am 02.06.2018 um 15:14 schrieb Sven Barth via fpc-pascal: Mark Morgan Lloyd mailto:markmll.fpc-pas...@telemetry.co.uk>>

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-03 Thread Bernd Oppolzer
= '='; SYNEOP := '<>'; SYGTOP := '>'; SYLTOP := '<'; SYGEOP := '>='; SYLEOP := '<='; SYOROP := '|'; SYANDOP := '&'; SYASSIGN := ':='; SYCONCAT := '||'; if you want to change the representation of the symbols, you only change here. Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] pointerful

2018-04-22 Thread Bernd Oppolzer
stpt.prrlis PCINT (Build 1.0 Apr  5 2018 07:58:58)    5 c:\work\pascal\work> this is the New Stanford Pascal compiler, a modern variant of Wirth's P4 compiler. that is: type PINT = -> INT ; INT = PINT ; PT = -> PT ; this is all possible in Standard Pascal,

Re: [fpc-pascal] procedure and function parameters?

2018-03-04 Thread Bernd Oppolzer
Am 04.03.2018 um 18:45 schrieb Sven Barth via fpc-pascal: On 04.03.2018 18:06, Bernd Oppolzer wrote: Are procedure and function parameters allowed in Free Pascal? When I tried to compile the Man-or-boy example program (Knuth's test), FPC complained with a syntax error: c:\work\pascal

[fpc-pascal] procedure and function parameters?

2018-03-04 Thread Bernd Oppolzer
begin (* B *)     K := K - 1 ;     B := A ( K , B , X1 , X2 , X3 , X4 ) ;   end (* B *) ;    begin (* A *) if K <= 0 then    begin A := X4 + X5 ;    end (* then *) else    begin A := B ;    end (* else *) ;    end (* A *) ;

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Bernd Oppolzer
ee page 10: http://bernd-oppolzer.de/PascalReport.pdf (page 18 of the PDF). Kind regards Bernd Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Bernd Oppolzer
will need to be emulated on the non-mainframe platforms. For some years now, the mainframe also supports floating point data based on a decimal representation. But I don't have experience with this so far. Some compilers support this (PL/1). Kind regards

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Bernd Oppolzer
value in Euro, no matter how many digits after the decimal point quantity and quotation had. The multiply function will take care of the proper scaling and stop after the third digit which is sufficient to round at the second position. Kind regards Bernd

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Bernd Oppolzer
; end (* HAUPTPROGRAMM *) . that is: long strings may be concatenated simply by closing the string constant on one line and reopening it on the next line. http://bernd-oppolzer.de/job9.htm HTH, kind regards Bernd ___ fpc-pascal maillist - fpc-p

Re: [fpc-pascal] named parameter

2017-05-27 Thread Bernd Oppolzer
on the procedure call but this is a different topic and should be discussed seperate from the default issue. I guess, that all this will be limited to byvalue parameters ... not for var parameters ... Kind regards Bernd Am 27.05.2017 um 08:17 schrieb Mr Bee via fpc-pascal: Hi, As Pascal m

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-20 Thread Bernd Mueller
r the embedded targets like AVR and ARM. Regards, Bernd. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] parser combinator library

2017-02-24 Thread Bernd
I am myself still quite unfamiliar with this whole parsing business) currently all my parsers only return arrays of strings that I can optionally post-process with an optional hook function after a parser has completed. Bernd ___ fpc-pascal mail

Re: [fpc-pascal] bitwise operations using AND, OR, XOR, NOT

2017-01-10 Thread Bernd Oppolzer
56) x 14 y 29 x and y12 x and y12 x or y 31 x or y 31 x xor y19 not x -15 not y -30 aFALSE bTRUE a and b FALSE a and b FALSE a or b TRUE a or b TRUE a xor b

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Bernd Oppolzer
Am 08.01.2017 um 18:22 schrieb Sven Barth: Am 08.01.2017 17:32 schrieb "Bernd Oppolzer" mailto:bernd.oppol...@t-online.de>>: > > Am 08.01.2017 um 11:46 schrieb Sven Barth: >> >> On 08.01.2017 10:55, Ryan Joseph wrote: >>> >>> I’m going t

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Bernd Oppolzer
closest equivalence to bitwise and in Pascal are set intersections, IMO. If I had to implement that on integers using standard pascal, this would cause me some headache ... Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.

Re: [fpc-pascal] HIDAPI Bindings for FPC (on Linux)

2016-11-20 Thread Bernd
will most likely be interested in testing this with his own hardware and use different vid/pid anyways. The demo program will produce output like this: --($)-- sudo ./demo [sudo] Passwort für bernd: will now enumerate all USB HID devices. Note that it will list more info if you run with sudo, you

[fpc-pascal] HIDAPI Bindings for FPC (on Linux)

2016-11-19 Thread Bernd
with other FPC units. -Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] C translation question

2016-10-23 Thread Bernd Oppolzer
while loop first, then you can translate this loop in a straightforward manner to Pascal, and the probability of inserting logic errors is much lower. Kind regards Bernd Am 23.10.2016 um 22:20 schrieb Bernd Oppolzer: it might help if I translate the C for loop into an equivalent while loop for

Re: [fpc-pascal] C translation question

2016-10-23 Thread Bernd Oppolzer
urn c; } HTH, kind regards Bernd Am 22.10.2016 um 11:06 schrieb Ryan Joseph: I’m trying to translate a function from C (taken from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html) and although I think I got it correctly it’s not behaving 100% accurately so I’m n

Re: [fpc-pascal] ARM CMSIS support

2016-02-23 Thread Bernd Mueller
would avoid them. Regards, Bernd. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] ARM CMSIS support

2016-02-23 Thread Bernd Mueller
Michael Ring wrote: (Glad to hear that basic functionality works...) I finished my first (small) project with the STM32F429ZI controller and everything went smooth :-) Even with optimization level -O2. Thanks everyone, who is involved in the ARM compiler/rtl development. Regards, Bernd

Re: [fpc-pascal] ARM CMSIS support

2016-02-12 Thread Bernd Mueller
rtl not affected? What is recommended by the developers? Where bug reports accepted, if I use optimization -O2? Regards, Bernd. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Default type of string literals

2016-01-04 Thread Bernd
onstant by default, even when not explicitely writing const FOO_DIR: AnsiString = 'foobar'; -Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Which compiler for ARM embedded project?

2015-11-13 Thread Bernd Mueller
trunk? Regards, Bernd. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] For .. in .. loops with sets and valued enums

2015-06-20 Thread Bernd Oppolzer
Bernd Am 20.06.2015 um 14:03 schrieb Michael Van Canneyt: On Sat, 20 Jun 2015, Jonas Maebe wrote: On 20/06/15 12:01, Michael Van Canneyt wrote: On Sat, 20 Jun 2015, Jonas Maebe wrote: On 20/06/15 11:41, Michael Van Canneyt wrote: But it is a bug that the compiler does not give an error

Re: [fpc-pascal] Optimal number of threads for SMP

2014-09-18 Thread Bernd
2014-09-15 11:10 GMT+02:00 Xiangrong Fang : > (hyper-threads)? If the CPU has hyper threading then these should show up as individual cores (CPUs). They call a "core" with 2 processors on it a "core" but each of these "cores" is actually two complete processors (cores in the conventional meaning

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-14 Thread Bernd Oppolzer
inspiration, at that time. Kind regards Bernd Am 14.09.2014 16:30, schrieb Bernd Oppolzer: The possible dangers of using WITH are only very limited, compared to other languages, for example PL/1, where - you don't need to declare variables, like in FORTRAN - you can omit structure qualifiers, i

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-14 Thread Bernd Oppolzer
ons that control the vector indices, which is IMHO a great help in the early stages of program development. Kind regards Bernd Cheers, Ched' ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] struct definition in C

2014-03-23 Thread Bernd Oppolzer
n into account, too (not, if you use unsigned chars as the base for the bit strings, and if the chars are eight bits long, which should be the case on all modern architectures). Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists

Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-11 Thread Bernd Oppolzer
On Windows, too: C:\>cd \backup\\\///\\\sich C:\backup\sich> Only the first backslash has to be (only one) backslash; no slash allowed. Kind regards Bernd Am 11.09.2013 19:36, schrieb Reimar Grabowski: On Wed, 11 Sep 2013 17:37:36 +0200 Jürgen Hestermann wrote: And double deli

Re: [fpc-pascal] Breaking Pascal source lines

2013-09-06 Thread Bernd Oppolzer
Am 06.09.2013 18:16, schrieb Bernd Oppolzer: To keep the syntax correct, you can break after every symbol, that is: not inside identifiers, not inside numbers (including floating point constants) not inside quoted strings but anywhere else I am using a Pascal pretty print program, that knows

Re: [fpc-pascal] Breaking Pascal source lines

2013-09-06 Thread Bernd Oppolzer
accepts only classical Pascal syntax (my extension of Stanford P4) - no FPC. So it makes not much sense to share it. But I compiled it with FPC recently, and it ran without problems on Windows. Kind regards Bernd ___ fpc-pascal maillist - fpc-pa

Re: [fpc-pascal] ++ and --

2013-08-01 Thread Bernd Oppolzer
xpression to be incremented !!) seems unimportant. And, if that's a matter for you: the newer PL/1 compilers support += etc., but don't support ++ and --, Kind regards Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lis

Re: [fpc-pascal] ++ and -- ( and +=, -=, ...)

2013-08-01 Thread Bernd Oppolzer
Am 31.07.2013 11:33, schrieb Sven Barth: Technically it would be simple to change that as the corresponding code is already available for the above mentioned situation, but it would definitely change the semantics if the left side is e.g. an array with a function as index accessor (as the funct

Re: [fpc-pascal] Text IDE, the displayed cursor position

2013-03-06 Thread Bernd Mueller
using FPC 2.6.0 no problem with FPC 2.6.2 under (32-bit) Windows 98 ;-) Regards, Bernd. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] array of const with cdecl procedure

2012-11-12 Thread Bernd
2012/11/11 Jonas Maebe : > No, it is not possible. There are no Pascal (or C, for that matter) > expressions that map to particular registers on entry into the function. ok, my wording was wrong. What I really meant to say was that if I am absolutely determined to find a solution because I have

Re: [fpc-pascal] array of const with cdecl procedure

2012-11-11 Thread Bernd
2012/11/11 Jonas Maebe : > Then you probably only read about i386 ABIs (and maybe m68k). But a bunch of ifdefs should do the trick then, it should still be possible to implement every possible implementation in pascal somehow. Is there a document somewhere that specifies how exactly cdecl vararg

Re: [fpc-pascal] array of const with cdecl procedure

2012-11-11 Thread Bernd
2012/11/11 Jonas Maebe : > No, because the C varargs calling convention does not simply pass the > parameters on the stack on most platforms. Where else are the arguments if not on the stack? Everything I have read so far about varargs and cdecl says they are on the stack. __

Re: [fpc-pascal] array of const with cdecl procedure

2012-11-11 Thread Bernd
2012/11/11 Sven Barth : > Yes and this is exactly what the change states. You can not write "varargs" > functions in Pascal that can be accessed from C. Wouldn't it be possible to write a function in pascal that declares a simple longint parameter instead of the varargs and then inside the functi

Re: [fpc-pascal] Memory alignment with FPC

2012-10-10 Thread Bernd
2012/10/10 : > However when > objects have methods, does that change memory alignment No. As long as there are no virtual methods it will not affect the size or the memory layout. From what I have read the new gtk3 API for fpc will also use objects (with methods and also inheritance) instead of r

[fpc-pascal] FPC-2.6.1 daily build for Ubuntu Precise and Quantal, i386 and amd64

2012-10-08 Thread Bernd
I have set up a daily build of latest 2.6.1: https://code.launchpad.net/~prof7bit/+archive/fpc-2.6-latest ppa:prof7bit/fpc-2.6-latest (should update automatically from now on without manual intervention) and also (because I needed it once for bootstrapping and will also need it for lazarus-1.0.0)

Re: [fpc-pascal] bunxh.inc(24, 52) Fatal: Syntax error, ":" expected but "identifier NSET" found

2012-10-06 Thread Bernd
2012/10/7 Bernd : > I'm currently uploading a source package which I have quickly put > together for fpc-2.6.0 to launchpad, hoping it will successfully build > tonight This is the ppa (should contain fpc and fpc-source for ubuntu 12.04 once the build has completed): https:/

Re: [fpc-pascal] bunxh.inc(24, 52) Fatal: Syntax error, ":" expected but "identifier NSET" found

2012-10-06 Thread Bernd
2012/10/6 Marco van de Voort : > which should have been done 9 months ago, like the other distributions. > > 2.6.0 is from January 1st. I'm neither Debian nor Ubuntu official, I'm just an ordinary user who wants to publish software via launchpad and for this to work everything needs to be abl

Re: [fpc-pascal] bunxh.inc(24, 52) Fatal: Syntax error, ":" expected but "identifier NSET" found

2012-10-06 Thread Bernd
2012/10/6 Florian Klämpfl : > Well, if somebody does testing and provides the necessary fixes, it can > be done. I will not waste time with it because I personally consider it > as a problem of the linux package system and not FPC's problem. It can be solved in Ubuntu, its just a bit more tricky.

Re: [fpc-pascal] bunxh.inc(24, 52) Fatal: Syntax error, ":" expected but "identifier NSET" found

2012-10-06 Thread Bernd
2012/10/6 Jonas Maebe : > As has been mentioned a "few" times before, building FPC development versions > has always been only supported when starting with the latest release. So: yes. I have never tried to build it on Launchpad servers before so I never ran into this problem before and also goo

[fpc-pascal] bunxh.inc(24, 52) Fatal: Syntax error, ":" expected but "identifier NSET" found

2012-10-06 Thread Bernd
I'm trying to build current 2.6.1 on Ubuntu Precise with build-dependency fpc-2.4.4 (because there exist no later version of fpc in precise) and gettting this error: bunxh.inc(24,52) Fatal: Syntax error, ":" expected but "identifier NSET" found the offending line in rtl/unix/bunxh.inc is: Fu

Re: [fpc-pascal] CThreads for linked C library?

2012-10-01 Thread Bernd
2012/10/1 Johann Glaser : > Is it necessary to have the unit "CThreads" in my Uses clause? No, only if you use threads in your pascal code. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pasc

Re: [fpc-pascal] Editing XMP data in images

2012-10-01 Thread Bernd
2012/10/1 Mattias Gaertner : > Hi, > > I need to edit XMP data in images (at least tif, jpg). If you need some quick and dirty solution then I have something here that will one day become part of an application to tag and organize jpeg images from digital cameras. It will start a separate exiftool

Re: [fpc-pascal] libusb header translation and OOP wrapper

2012-09-25 Thread Bernd
2012/9/25 Graeme Geldenhuys : > Thanks for the tip, but Git is *not* difficult to use. To cover the average > developer workflow, you need like 3-4 commands max. If you can't remember 4 > commands, then you have bigger issues than git. I know that git is not as complicated as it initially seems b

Re: [fpc-pascal] Error: Can't take the address of constant expressions

2012-09-25 Thread Bernd
2012/9/25 patspiper : > procedure test; > begin > Move(MyClass1.Ref.Data^, MyClass2.Ref.Data^, 1); > end; and if you cast it to some other pointer type before dereferencing the error goes away: procedure test; begin Move(MyClass1.Ref.Data^, PByte(MyClass2.Ref.Data)^, 1); end; But this should

Re: [fpc-pascal] Error: Can't take the address of constant expressions

2012-09-25 Thread Bernd
2012/9/25 patspiper : > Hi, > > Despite > http://wiki.freepascal.org/User_Changes_2.4.0#Treating_direct-mapped_properties_as_regular_fields, > shouldn't the following be legal? I tested under FPC 2.6.1 and 2.7.1. This shouldn't even matter here since IMHO it should work even if Ref were a function

Re: [fpc-pascal] libusb header translation and OOP wrapper

2012-09-25 Thread Bernd
2012/9/24 Christo : > I'm new to using git so it may be > something trivial I'm missing. Regarding git, I highly recommend using the easygit wrapper to make life easier, especially when you come from SVN because git will be very confusing in the beginning if you are used to svn and then try to u

Re: [fpc-pascal] Re: Issue with deploying linux application in /opt directory

2012-09-04 Thread Bernd
2012/9/4 Mark Morgan Lloyd : > What files were changed by the chown -R operation? In other words, compare > before and after. One more thing comes to mind: It is necessary to set the x bit for folders. If you create the directory tree and then recursively chown and chmod all files and folders the

Re: [fpc-pascal] Re: Issue with deploying linux application in /opt directory

2012-09-04 Thread Bernd
2012/9/4 Reinier Olislagers : > Perhaps you're using some protection/privilege management system > (AppArmor, SELinux, something else) that restricts internet access to > the application running under root... The owner of the file or the folder does not affect under which UID it will run. All oth

Re: [fpc-pascal] Issue with deploying linux application in /opt directory

2012-09-03 Thread Bernd
2012/9/3 Krzysztof : > Hmm problem is that I'm trying deploy libQt4Pas with my application (I > have run.sh script which do "export > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/myapp/lib" before running > application) and I see that this library trying do something in /opt > folder: > open("/opt/myapp/l

Re: [fpc-pascal] Access to compiler's internal data structures

2012-09-01 Thread Bernd
2012/8/31 Kenneth Cochran : > I'm finding myself in need of a parser for object pascal. I'm wondering if > fpc exposes any of the output (syntax trees, graphs, etc) from the parser > that could be consumed by an external tool? Depending on what exactly you need and how difficult it is to get a sy

Re: [fpc-pascal] GDB help needed please

2012-08-31 Thread Bernd K.
On 30.08.2012 00:13, Graeme Geldenhuys wrote: > Signal received. Signal: SIGSEGV, Segmentation fault. > > #0 0040E1BB :0 SYSTEM_WAITFREE_FIXED$PMEMCHUNK_FIXED$POSCHUNK() > #1 01FB8D3C :0 ??() > #2 0040C51A :0 fpc_finalize() > #3 0001 :0 ??() > #4 0040AD2A :0 SYSTEM_TOBJECT_$__CLEANUPINST

[fpc-pascal] wrong definition of SHCreateStdEnumFmtEtc() in unit shlobl

2012-08-21 Thread Bernd
While implementing an OLE drag&drop source I stumbled over this: shlobj.pp, Line 2444 function SHCreateStdEnumFmtEtc(cfmt:UINT; afmt:array of TFORMATETC; var ppenumFormatEtc:IEnumFORMATETC):HRESULT;StdCall;external External_library name 'SHCreateStdEnumFmtEtc'; this must be wrong. I got nothin

Re: [fpc-pascal] Variable of class method type of function

2012-07-17 Thread Bernd K.
On 17.07.2012 01:09, waldo kitty wrote: > now we need to remember to use "of object" when we are working with nothing > but > classes? Imagine for a moment (in a parallel universe) there exists no keyword "object" and never has. All there has ever been was the keyword "class". now you have ty

Re: [fpc-pascal] bug fpc-image

2012-07-07 Thread Bernd
2012/7/7 tazio mirandola > hi all, > > i'm trying to resize a jpg via fpc-image, this is the relevant > code(adapted from http://wiki.freepascal.org/fcl-image): > > for resizing you should use StretchDraw() from the TCanvas object: ImageOriginal := TFPMemoryImage.Create(0, 0); Imag

  1   2   3   >