Re: [fpc-pascal] if-then-else expression

2016-02-02 Thread Dmitry Boyarintsev
On Tue, Feb 2, 2016 at 4:40 PM, geneb wrote: > So it's not solving a /problem/ it's lessening an inconvienence(sp!). > > I would've gone with IIf(). :) > Just keep in mind that the thread (about preferences) is closed. Everyone are welcomed to create poll on the forum. Discussion also goes on at

Re: [fpc-pascal] if-then-else expression

2016-02-03 Thread Dmitry Boyarintsev
On Wed, Feb 3, 2016 at 6:11 AM, Serguei TARASSOV wrote: > Holy sh*t, ça continue ! :) > it's finally on the forum as well http://forum.lazarus.freepascal.org/index.php/topic,31367.msg200825/topicseen.html#new thanks, Dmitry ___ fpc-pascal maillist -

Re: [fpc-pascal] IfThen() intrinsic removed

2016-02-04 Thread Dmitry Boyarintsev
On Thu, Feb 4, 2016 at 2:44 PM, John Lee wrote: > luddite_clique 1 progressives 0 > > Just wait for Delphi to implement this... speaking of which, why they've not done it a long time ago? They could, but probably didn't do that, for very likely the same reasons. thanks, Dmitry __

Re: [fpc-pascal] if-then-else expression

2016-02-04 Thread Dmitry Boyarintsev
On Thu, Feb 4, 2016 at 6:42 AM, Jonas Maebe wrote: > And since this is now becoming a thread in which mostly things from the > previous one are repeated, please also move it to the fpc-other list. > Of the forum: http://forum.lazarus.freepascal.org/index.php/topic,31367.0.html __

Re: [fpc-pascal] Please someone explain this to me

2016-02-10 Thread Dmitry Boyarintsev
On Wed, Feb 10, 2016 at 3:32 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > On 2016-02-10 19:20, Michael Van Canneyt wrote: > > You just need to look at the system or sysutils units from recent > delphis to > > see why include files are the better option, > As someone that doesn't

Re: [fpc-pascal] Happy tickets benchmark

2016-02-15 Thread Dmitry Boyarintsev
On Sun, Feb 14, 2016 at 4:45 AM, Mattias Gaertner wrote: > Maybe documentation helps here. > > Is there already a page "pimp my fpc"? > In fact there's but. http://wiki.freepascal.org/Improving_language_shootout_results But the information is a bit outdated. thanks, Dmitry

Re: [fpc-pascal] How to pass an array of bytes directly in a TBytes param?

2016-02-19 Thread Dmitry Boyarintsev
procedure test(const b: array of byte) ?? On Friday, February 19, 2016, silvioprog wrote: > Hello, > > Consider the following procedure: > > procedure test(b: TBytes); > begin > end; > > The common way to pass an array of bytes in this procedure is declaring > and initializing a TBytes variable.

Re: [fpc-pascal] Wiki upgraded

2016-02-21 Thread Dmitry Boyarintsev
On Sat, Feb 20, 2016 at 5:50 PM, Jonas Maebe wrote: > The wiki has been upgraded to MediaWiki 1.23 Great! thank you! Is it possible to enable Subpages ? ( https://www.mediawiki.org/wiki/Help:Subpages) Purpose - hierarchical organization of the knowledge base. For example, all the pages of the

Re: [fpc-pascal] Primitive Record Wrappers

2016-02-26 Thread Dmitry Boyarintsev
On Fri, Feb 26, 2016 at 10:38 PM, Mazola Winstrol wrote: > In the code bellow, the generic type TNullableTyple is implemented (and > incomplete for now). > How to reset TNullableType to Null value? HasValue seems to be read-only. > Is there any possibility of "nullable types" be added to RTL or

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-29 Thread Dmitry Boyarintsev
On Tue, Mar 29, 2016 at 11:06 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > So why does the Object Pascal language have a Cardinal type? Why > couldn't LongWord be used instead? > In Delphi world LongWord is 64-bit on 64-bit iOS platform and it is 32-bit on 64-bit Windows platfor

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-29 Thread Dmitry Boyarintsev
On Tue, Mar 29, 2016 at 11:20 AM, Michael Van Canneyt < mich...@freepascal.org> wrote: > > Which is quite confusing and a really bad decision. > Basic integer types should not depend on the OS. On the CPU, yes. > > I guess they tried to make iOS platform a selling point and be more C-like. Just to

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-29 Thread Dmitry Boyarintsev
On Tue, Mar 29, 2016 at 11:31 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > On 2016-03-29 16:17, Dmitry Boyarintsev wrote: > > In Delphi world LongWord is 64-bit on 64-bit iOS platform and it is > 32-bit > > on 64-bit Windows platform. > > So what

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-29 Thread Dmitry Boyarintsev
On Tue, Mar 29, 2016 at 9:06 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > So I definitely see the benefit in using (U)Int style data types. > They are a lot more obvious [to the programmer] regarding data ranges > and byte size. > Does, it also make the code less high-level? Di

Re: [fpc-pascal] History of the Cardinal data type?

2016-03-30 Thread Dmitry Boyarintsev
On Wed, Mar 30, 2016 at 4:37 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > In my case I'm specifically referring to the benefit of using (U)Int > style data types for use in record structures when reading binary data > files. > Makes sense. > Does FPC follow that platform rule,

Re: [fpc-pascal] Class constructor called unconditionally

2016-03-31 Thread Dmitry Boyarintsev
On Thu, Mar 31, 2016 at 11:28 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > On 2016-03-31 16:06, Michael Van Canneyt wrote: > > I usually have a 'Start Application' kind of routine where I register all > > the necessary things, link things together (needed if you follow 'loosely

Re: [fpc-pascal] Framework for Objects Serialization / Deserialization

2016-04-01 Thread Dmitry Boyarintsev
On Fri, Apr 1, 2016 at 9:51 AM, Mazola Winstrol wrote: > I can't change the actual hierarchical structure of my classes so i can't > use TComponent. > > Delphi do have an intersting way to do with serialization: they have some > standard classes (TTypeMashaller, TConverter). If one wants to seria

Re: [fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-15 Thread Dmitry Boyarintsev
On Fri, Apr 15, 2016 at 1:19 PM, Jürgen Hestermann < juergen.hesterm...@gmx.de> wrote: > > So why do we need {$ZeroBasedStrings On} at all? ;-) > The same reason as other FPC features - (some of) Delphi code compatibility. thanks, Dmitry ___ fpc-pascal

Re: [fpc-pascal] Any chance to add the TStringBuilder to FCL?

2016-04-16 Thread Dmitry Boyarintsev
On Sat, Apr 16, 2016 at 2:28 PM, Jürgen Hestermann < juergen.hesterm...@gmx.de> wrote: > I don't know what you mean. > A For-loop has it's limits anyway. > And when decrementing 'manually' I would stop if INDEX=0. > For 0-based arrays I would stop if INDEX=-1? > What would be different? > For 1-ba

[fpc-pascal] c-blocks odd hints

2016-04-23 Thread Dmitry Boyarintsev
Hello, The compiler seems to generate odd hints: Local absolutevar "FPC_BLOCK_SELF" is not used Here's the code. if Assigned(gc.extendedGamepad) then gc.extendedGamepad.setValueChangedHandler(GamePadChange) else if Assigned(gc.gamepad) then // <-- hint here gc.gamepad.setVa

[fpc-pascal] intel vs att asm (fstp instruction) (osx/clang features)

2016-05-03 Thread Dmitry Boyarintsev
Hello, I'm dealing with the following code (from ZenGL library), targeting OSX --- {$mode delphi} procedure m_SinCos( Angle : Single; out s, c : Single ); assembler; asm FLD Angle FSINCOS FSTP [EDX] FSTP [EAX] end; var s,c: single; begin m_SinCos(0,s,c); end.

Re: [fpc-pascal] FCL: moving FastHTMLParser

2016-05-04 Thread Dmitry Boyarintsev
On Wed, May 4, 2016 at 10:36 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > FPC manages to find in somehow (not sure how yet - FPC magic ). > Isn't it in fpc.cfg? -Fu/usr/local/bin/x.x.x/units/$fpctarget/* That's forcing FPC to look through all compiled packages. Since fasthtm

Re: [fpc-pascal] intel vs att asm (fstp instruction) (osx/clang features)

2016-05-04 Thread Dmitry Boyarintsev
On Wed, May 4, 2016 at 6:14 AM, Pierre Free Pascal wrote: > I think the correct solution for you is to use explicit size information: > > > > FSTP SINGLE PTR [EDX] > > FSTP SINGLE PTR [EAX] > Indeed that worked as expected. Thank you. > but > > FSTP [s] > > and > > FSTP [c] > It still r

Re: [fpc-pascal] TJSONboolean and locale settings

2016-05-13 Thread Dmitry Boyarintsev
On Fri, May 13, 2016 at 10:32 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > So does the JSON Standard define saved boolean values as hard-coded > English “True” and “False” values, no matter the locale? > What's case where "true"/"false" are localized? thanks, Dmitry __

Re: [fpc-pascal] What to use when porting WaitForMultipleObjects to Linux?

2016-05-16 Thread Dmitry Boyarintsev
On Mon, May 16, 2016 at 6:22 AM, Bo Berglund wrote: > When porting a Delphi console program on Windows to FreePascal on > Linux, what can one do with API calls like WaitForMultipleObjects, > which is used to synchronize processing between threads? > It depends if you're actually using WaitForMul

Re: [fpc-pascal] What to use when porting WaitForMultipleObjects to Linux?

2016-05-16 Thread Dmitry Boyarintsev
On Mon, May 16, 2016 at 9:01 AM, Bo Berglund wrote: > The Execute procedure handles everything going on and it acts on event > signals picked up (I believe) by the WaitForMultipleObjects calls. > > What I would like to know is how exactly to handle this in FreePascal > on Linux > I presume

[fpc-pascal] Google AdMob for iOS

2016-07-06 Thread Dmitry Boyarintsev
Hello, I did a little search and didn't find any headers of iOS AdMob for FPC. It's Objective-C interface. Thus, I converted them myself: https://github.com/skalogryz/admob-pascal Note, the conversion is incomplete, I stopped after converting Interstitial Ad (which I needed). If you need some ot

Re: [fpc-pascal] OData and Office365 REST API support

2016-07-11 Thread Dmitry Boyarintsev
On Mon, Jul 11, 2016 at 10:50 AM, Michael Van Canneyt < mich...@freepascal.org> wrote: > Long overdue, I have finally committed the initial version of the odata > package in the FPC repository. > Is it worth its own repository, similar to googleapis? thanks, Dmitry __

Re: [fpc-pascal] OData and Office365 REST API support

2016-07-11 Thread Dmitry Boyarintsev
On Mon, Jul 11, 2016 at 1:05 PM, Michael Van Canneyt wrote: > > googleapis also does not have an own repository ? > > They don't, but maybe they should. It's just taking more and more time to check out trunk. thanks, Dmitry ___ fpc-pascal maillist -

Re: [fpc-pascal] OData and Office365 REST API support

2016-07-11 Thread Dmitry Boyarintsev
On Mon, Jul 11, 2016 at 2:32 PM, Michael Van Canneyt wrote: > As such, I consider web APIs an essential part of the compiler (or indeed > any) toolchain. In fact I think FPC is woefully behind in this department... > Then I have API design question.Is it possible not to bind web-apis to fcl-web

Re: [fpc-pascal] OData and Office365 REST API support

2016-07-11 Thread Dmitry Boyarintsev
On Mon, Jul 11, 2016 at 5:12 PM, Michael Van Canneyt wrote: > I am VERY glad you asked this question. I had the same consideration when > creating it :-) :-) > [snip] > Got it. Thank you for clarification. ___ fpc-pascal maillist - fpc-pascal@lists.fr

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 11:16 AM, James Richters < ja...@productionautomation.net> wrote: > Any suggestions on how to do this on windows with a console application? > I don't have an answer, but I'm wondering what kind of task is that? Why do you need this 55mS tick? thanks, Dmitry _

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 11:19 AM, Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > On Tue, Jul 26, 2016 at 11:16 AM, James Richters < > ja...@productionautomation.net> wrote: > >> Any suggestions on how to do this on windows with a console application? >>

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 11:21 AM, Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > Maybe you want to look into QueryPerformanceCounter. > > https://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx > > Here's an example: {$mode objfpc}{$H

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 12:38 PM, James Richters < ja...@productionautomation.net> wrote: > What I need is a timer that I can specify in microseconds, a millisecond > is too long. I am using it for timing to read in a string on a serial > connection. My fastest baudrate is 25, so at that ra

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 1:58 PM, James Richters < ja...@productionautomation.net> wrote: > I think there may be a solution with this performance counter for my > purposes… here’s what I’m trying to accomplish: > Well, Windows provides a different means of waiting (and waiting with time out) for t

Re: [fpc-pascal] RTF writer

2016-08-05 Thread Dmitry Boyarintsev
On Fri, Aug 5, 2016 at 3:11 AM, Torsten Bonde Christiansen wrote: > I am looking for at component that can write RTF format, preferably like > the TRichMemo: > > http://wiki.lazarus.freepascal.org/RichMemo > > but without the need for LCL. > > In fpc 3.0 there is a RTF reader, but i have not been

Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread Dmitry Boyarintsev
On Wed, Aug 31, 2016 at 6:15 PM, African Wild Dog wrote: > Again,thanks for the detailed explanation. As this is a recurrent > topic,maybe it would be a good ideia to create a wiki page with all these > points. > http://wiki.freepascal.org/LLVM thanks, Dmitry ___

Re: [fpc-pascal] Underscores in numerical literals - grouping

2016-11-21 Thread Dmitry Boyarintsev
On Mon, Nov 21, 2016 at 9:46 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > I don't know about you, but I like this idea implemented in Java 7 and > later. > > http://jasdhir.blogspot.co.uk/2016/11/using-underscores-in-literals.html > > > I always find it hard to read long numeric

Re: [fpc-pascal] Readln a password

2016-11-27 Thread Dmitry Boyarintsev
On Sun, Nov 27, 2016 at 8:24 AM, Adriaan van Os wrote: > I wonder what the recommended way is to readln a password from console, as > a standard Readln echoes the password. > > 1. SetConsoleMode seems to be Windows-specific > I'd think you want something simlar on unix. Take a look at man 4 term

[fpc-pascal] SysSetCtrlBreakHandler

2016-11-27 Thread Dmitry Boyarintsev
On Sun, Nov 27, 2016 at 12:07 PM, Michael Van Canneyt < mich...@freepascal.org> wrote: > > If you mean in a cross-platform way, I think we would welcome patches :) > > On the subject of cross-platform console applications... While working recently on converting libwebsockets header to FPC, I ran i

Re: [fpc-pascal] SysSetCtrlBreakHandler

2016-11-29 Thread Dmitry Boyarintsev
Hello Tomas A question regarding your comment ( http://bugs.freepascal.org/view.php?id=31023#c96393) Specifically ad 2) Is it fine to safe-guard access to SpecialKey / ScanCode through the whole crt unit? My only concern is that there're many places that has to be adjusted making the patch rather

Re: [fpc-pascal] SysSetCtrlBreakHandler

2016-11-30 Thread Dmitry Boyarintsev
On Tue, Nov 29, 2016 at 5:13 PM, Tomas Hajny wrote: > > 1) Instead of using the special handler registered via > SetConsoleCtrlHandler (invoked in a special thread), isn't it possible to > process this event in the exception handler (running in the same thread > probably)? > Not that I'm (or MSD

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Dmitry Boyarintsev
On Sun, Dec 4, 2016 at 5:28 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > If I use an array to hold a list of say Integers. Is there any serious > performance penalty for resizing (growing) the dynamic array as I add > items. My point being, I don't know the number of elements I'

Re: [fpc-pascal] Untyped var params

2017-01-04 Thread Dmitry Boyarintsev
On Wed, Jan 4, 2017 at 9:29 AM, Ryan Joseph wrote: > I’ve seen functions that use the untyped params like: > > function GetSomething (var something): boolean; > > This seems like something useful I would like to use but how can you > assign to the parameter? I tried but I got an error message whi

Re: [fpc-pascal] Untyped var params

2017-01-04 Thread Dmitry Boyarintsev
On Wed, Jan 4, 2017 at 10:24 AM, Ryan Joseph wrote: > But how do you assign to “something" then if you don’t know the type? The > param is “var” so shouldn’t I be able to assign to the param and return it > back to the caller? In your example how could I return 5 to “i” inside > GetSomething? > >

Re: [fpc-pascal] Untyped var params

2017-01-07 Thread Dmitry Boyarintsev
On Sat, Jan 7, 2017 at 2:37 PM, Andrew Hall wrote: > If you cast your “something” to a typed pointer, the compiler will do the > work for you in the usual way: > > PDouble(something)^ := myDouble; > or rather PDouble(@something)^ := myDouble; ? thanks, Dmitry

Re: [fpc-pascal] Untyped var params

2017-01-07 Thread Dmitry Boyarintsev
On Sat, Jan 7, 2017 at 4:52 PM, Bart wrote: > > But if you know that at forehand (and you know, since you cast it), > why then use an untyped var parameter at all? > http://www.freepascal.org/docs-html/rtl/system/fillchar.html ? thanks, Dmitry ___ fpc

Re: [fpc-pascal] Untyped var params

2017-01-07 Thread Dmitry Boyarintsev
On Sat, Jan 7, 2017 at 5:42 PM, Bart wrote: > > procedure X(var Y); > begin > PInteger(Y)^ := 3; //syntax may be wrong, too lazy to test > end; > > To me this completely defies the purpose of an untyped var parameter, > since in this exmaple you do know, @design time, the type of Y, so why > n

Re: [fpc-pascal] Untyped var params

2017-01-07 Thread Dmitry Boyarintsev
On Sat, Jan 7, 2017 at 6:53 PM, Bart wrote: > OK, I can imagine more complex examples where this may come in handy. > > And thanks for the rest of the explanation. And only more complex examples should be used :) There're much better ways to implement var-type variables. I was always thinking

Re: [fpc-pascal] Untyped var params

2017-01-07 Thread Dmitry Boyarintsev
On Sat, Jan 7, 2017 at 6:02 PM, Lars wrote: > Some brave soldiers once tried to reinvent generics using these tricks.. Well, Pascal run-time has been using "hidden" generics forever. As an example: http://www.freepascal.org/docs-html/rtl/system/val.html Val() declares the second parameter as

Re: [fpc-pascal] C# translatation

2017-01-08 Thread Dmitry Boyarintsev
On Sun, Jan 8, 2017 at 12:22 PM, Sven Barth wrote: > The closest equivalence to bitwise and in Pascal is bitwise and. > > The operators "and", "or", "xor" and "not" are logical or bitwise > depending on their arguments. > With that said... On Sun, Jan 8, 2017 at 11:46 AM, José Mejuto wrote:

[fpc-pascal] alignment of types ( __alignof__ in fpc)

2017-01-11 Thread Dmitry Boyarintsev
Hello, Porting some C-headers. Ran, into a declaration: #define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) _alignof_ seems to be a compiler attribute https://gcc.gnu.org/onlinedocs/gcc/Alignment.html Is there anything similar available fpc? Delphi doesn't seem to have any http://stackov

Re: [fpc-pascal] ppcjvm issues

2017-01-27 Thread Dmitry Boyarintsev
On Tue, Jan 10, 2017 at 6:14 AM, Michael Schnell wrote: > > If destroying an object is not necessary, the class should provide a dummy > Free procedure. So the application programmer always can/should use Free. > > Why dummy? if it should be like this procedure TObject.Free; begin if Self<>nil

Re: [fpc-pascal] ppcjvm issues

2017-01-27 Thread Dmitry Boyarintsev
On Fri, Jan 27, 2017 at 12:52 PM, Jon Foster wrote: > Correct me if I'm wrong: It would seem like that your free implementation >> doesn't actually do anything, other than fulfilling the obligation of >> having a "free". If I do this: >> > > var > o: TObject; > begin > o:=TObject.create;

Re: [fpc-pascal] ppcjvm issues

2017-01-27 Thread Dmitry Boyarintsev
On Fri, Jan 27, 2017 at 1:41 PM, Jonas Maebe wrote: > It is defined as "if the instance is not nil, then it calls the destroy > method, and next it calls FreeInstance". You could override FreeInstance to > not free memory on any platform. > > However, if JVM free method would at least reset "o"

Re: [fpc-pascal] A jit tool for command line compilation of Pascal?

2017-02-05 Thread Dmitry Boyarintsev
InstantFPC ? http://wiki.freepascal.org/InstantFPC thanks, Dmitry On Sun, Feb 5, 2017 at 8:31 PM, Stuart Cox wrote: > Several years ago I seem to remember using a FPC tool that allowed me to > write Pascal code and have its source file loaded, compiled and executed at > the command line. If I

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

2017-07-06 Thread Dmitry Boyarintsev
On Thu, Jul 6, 2017 at 10:27 AM, Marcos Douglas B. Santos wrote: > That would be very, very nice. > And instead of using [ " ' sql ' " ] would be better to use just [ " sql " > ]. > The thread of discussion: http://lists.freepascal.org/pipermail/fpc-devel/2016-February/036709.html __

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

2017-07-10 Thread Dmitry Boyarintsev
On Mon, Jul 10, 2017 at 6:14 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > * Try/Catch blocks where you can catch multiple exception types - without > needing nested code blocks like Object Pascal. You can even add a finally > block in there too - again without nested blocks. >

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

2017-07-10 Thread Dmitry Boyarintsev
On Mon, Jul 10, 2017 at 9:46 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > On 2017-07-10 13:34, Dmitry Boyarintsev wrote: > >> are you referring to "Catching More Than One Type of Exception with One >> Exception Handler" in >> https://d

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

2017-07-10 Thread Dmitry Boyarintsev
On Mon, Jul 10, 2017 at 11:19 AM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Though you can't use the same code block for multiple types. > Structured development to the rescue :) === program project1; {$mode delphi} {$RANGECHECKS on} uses SysUtils; function Handling

Re: [fpc-pascal] C to Pascal conversion - Help request

2017-07-17 Thread Dmitry Boyarintsev
On Mon, Jul 17, 2017 at 7:17 AM, Sandro Cumerlato < sandro.cumerl...@gmail.com> wrote: > Hello, > can someone please help me converting the folowing C types to Pascal? > SF_CUE_POINT is simple, but I'm not sure how to convert SF_CUES_VAR(count) > ad SF_CUES. > > type SF_CUES = record cue

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-21 Thread Dmitry Boyarintsev
On Sun, Aug 20, 2017 at 5:37 PM, wrote: > Is h2pas for example the one that is used for Mysql header translations > and other major C headers? > I'm using Chelper. (http://wiki.freepascal.org/Chelper) It's my choice, because it preserves comments (which is usually an important part of open-sour

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-21 Thread Dmitry Boyarintsev
On Sun, Aug 20, 2017 at 5:37 PM, wrote: > > Is there a competing tool that does more, or is updated more? > How about this list? http://wiki.freepascal.org/C_to_Pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-23 Thread Dmitry Boyarintsev
On Wed, Aug 23, 2017 at 3:50 AM, Florian Klämpfl wrote: > Am 22.08.2017 um 15:59 schrieb Martok: > > As a heads-up: whatever tool you end up using, make sure you do NOT > translate > > the C enums in mpfr.h as enumerations. It will work, but create > unpredictable > > codegen on the FPC side. > >

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-27 Thread Dmitry Boyarintsev
On Sun, Aug 27, 2017 at 2:37 AM, wrote: > > Why borland chose the bool to not be 100 percent compatible, and only 50 > percent compatible? > > Bool in delphi: > true = -1 > > Bool in C: > true = ($) 1 > > Why not just make it exactly compatible, there must be some underlying > (possi

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-27 Thread Dmitry Boyarintsev
August 27, 2017, wrote: > On 2017-08-27 06:22, Dmitry Boyarintsev wrote: > >> On Sun, Aug 27, 2017 at 2:37 AM, wrote: >> >> Why borland chose the bool to not be 100 percent compatible, and >>> only 50 percent compatible? >>> >>> Bool in delp

Re: [fpc-pascal] Initializing constant (translate from C)

2017-10-16 Thread Dmitry Boyarintsev
On Mon, Oct 16, 2017 at 3:36 PM, Darius Blaszyk wrote: > Here's an interesting one. In C I have this code: > > #define ID1 MAKE_ID('A', 'B') > > Where MAKE_ID is a macro that depending on the endianness of the target > will create either AB or BA. > > The only issue with the following approach co

Re: [fpc-pascal] Range checks

2018-01-27 Thread Dmitry Boyarintsev
On Sat, Jan 27, 2018 at 10:06 AM, Adriaan van Os wrote: > > > The code shouldn't generate a range check error, as the target type is > signed. > Count returns Unsigned Qword. unsigned $ is beyond 32-bit boundary. The similar issue, but more explicit. {$R+} function Count: qword;

Re: [fpc-pascal] Range checks

2018-01-27 Thread Dmitry Boyarintsev
On Sat, Jan 27, 2018 at 9:10 AM, C Western wrote: > > I can (more or less) see why, but it means that I can't (for example) > compile the Cocoa widget set in 64 bit with bounds checking on, as then > qword seems to be used as a count for, for example, NSarray. > > how about taking objc approach:

Re: [fpc-pascal] Range checks

2018-01-27 Thread Dmitry Boyarintsev
On Sat, Jan 27, 2018 at 12:30 PM, C Western wrote: > > The actual code that triggered my interest was: > > procedure LCLViewExtension.lclSetEnabled(AEnabled: Boolean); > var > ns : NSArray; > i : integer; > obj : NSObject; > begin > ns := subviews; > for i := 0 to ns.count - 1 do > be

Re: [fpc-pascal] Range checks

2018-01-27 Thread Dmitry Boyarintsev
On Sat, Jan 27, 2018 at 12:51 PM, Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > > imho, bad approach to adjust compiler for not safe code. > However, getting a compiler warning would be nice. > > Some time ago, the compiler has been extended with for-in syntax

Re: [fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

2018-05-09 Thread Dmitry Boyarintsev
On Wed, May 9, 2018 at 9:38 PM, Michalis Kamburelis < michalis.ka...@gmail.com> wrote: > This would mean that it is impossible to openly distribute an open-source > code interfacing with e.g. PlayStation custom OS. Precluding open-source > support from both FPC and Castle Game Engine for the conso

Re: [fpc-pascal] LongBool True = -1

2018-05-19 Thread Dmitry Boyarintsev
On Thu, May 17, 2018 at 5:26 PM, Anthony Walter wrote: > I am working with some a glib library that expects gboolean to be positive > 1 for true, yet FPC emits -1 for true. > I'd think that pascal defines true as true = not false; In case of unsigned integers "-1" is not an option thanks, Dmi

Re: [fpc-pascal] A new fpc desirable feature

2018-07-17 Thread Dmitry Boyarintsev
Please, fpc-other please ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] access violation?

2018-07-27 Thread Dmitry Boyarintsev
On Fri, Jul 27, 2018 at 11:15 AM, Ryan Joseph wrote: > I never use Free directly so I had no idea. How is that even accomplished > in the language? I thought it was just a method and behaved accordingly. > > If it is magic then how do we call other methods on nil objects? There are > times that w

Re: [fpc-pascal] access violation?

2018-07-27 Thread Dmitry Boyarintsev
On Fri, Jul 27, 2018 at 1:06 PM, Ryan Joseph wrote: > I had no idea you could do that! > Obviously, it speaks high of your abilities ;) You've been able to accomplish your tasks without use of hacks (of any kind), playing strict by the rules. I’m totally confused now. Since when was it ok to c

Re: [fpc-pascal] access violation?

2018-07-27 Thread Dmitry Boyarintsev
On Fri, Jul 27, 2018 at 3:22 PM, Michael Van Canneyt wrote: > In order to have robust, maintainable and portable (to either other >> platform or even language) a developer should respect high-level rules and >> never depend on low-level rules to be the same on any platform. >> > > Do I have permi

Re: [fpc-pascal] Assigning open array

2018-07-31 Thread Dmitry Boyarintsev
On Tue, Jul 31, 2018 at 11:39 AM Santiago A. wrote: > I'm not very sure how open arrays are copied > In your example you don't have open arrays used - you have dynamic arrays. > I looks like working fine. MyArray.ArrayInt[0] is still 5. But I wonder > whether it is really right or just luck. O

[fpc-pascal] FPC for linking only

2018-08-20 Thread Dmitry Boyarintsev
Hello, Is it possible to use FPC for linking only? (assuming that .ppu/.o files were created by fpc previously) using options -shGenerate script to link on host or -stGenerate script to link on target generates the linking script, but the script is referring to an external linker.

[fpc-pascal] odd compiling + linking error (with invalid casting of Exp)

2018-10-29 Thread Dmitry Boyarintsev
I'm using 3.0.4 (win32), could any one try it on a later version of the compiler? The code i'm compiling looks like this: -- {$mode delphi} type Ttest = class(TObject) public Value: string; end; function Custom: extended; begin Result := 0; end; begin // writeln( TTest

Re: [fpc-pascal] Adding options when building packages

2018-11-27 Thread Dmitry Boyarintsev
On Tue, Nov 27, 2018 at 9:55 AM Ryan Joseph wrote: > > Is there is a way I can add > "-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib” to that > command so it finds the file? > > make OPT='-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib ...extra options...'

Re: [fpc-pascal] wiki.freepascal.org is down?

2019-06-05 Thread Dmitry Boyarintsev
It's in maintenance mode now. You can actually open a sub page. I.e.: http://wiki.freepascal.org/Lazarus_Faq Yet the main page seems to be affected. On Wed, Jun 5, 2019 at 9:42 AM denisgolovan wrote: > Hi > > I get empty pages when browsing http://wiki.freepascal.org/ > Is it some bug or I am d

Re: [fpc-pascal] specify variable name with string variable

2019-07-07 Thread Dmitry Boyarintsev
associative array? On Sunday, July 7, 2019, James Richters wrote: > This might sound silly, but is it possible to somehow specify a variable > with a string containing the name of the variable? > > For example: > > Var >MyVariable1 : Word; >MyVariableName : String; > > Procedure ShowVar

Re: [fpc-pascal] Initial support for Custom Attributes

2019-07-13 Thread Dmitry Boyarintsev
On Fri, Jul 12, 2019 at 6:10 PM Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > The wiki pages New Features Trunk and User Changes Trunk will be updated > soon with the new information. > Here's a stand-alone page too https://wiki.freepascal.org/Custom_Attributes ___

Re: [fpc-pascal] String type with specified length and without codepage

2019-08-18 Thread Dmitry Boyarintsev
RawByteString? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Dmitry Boyarintsev via fpc-pascal
On Sunday, November 17, 2019, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > Either way, that's a pie in the face for Embarcadero. :-) > They probably asked Embarcadero the same question for Delphi language reference thanks, Dmitry ___ fp

[fpc-pascal] bug tracker (bugs.freepascal.org) APPLICATION ERROR #400 (db connection failed)

2020-08-29 Thread Dmitry Boyarintsev via fpc-pascal
The site opens up with: APPLICATION ERROR #400 Database connection failed. Error received from database was #-1: Database connection failed. Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or s

Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program

2021-02-12 Thread Dmitry Boyarintsev via fpc-pascal
Are signed executables subject to anti-virus inspection? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-11 Thread Dmitry Boyarintsev via fpc-pascal
why not to use Github mirror? svn co https://github.com/fpc/FPCSource/trunk or svn co https://github.com/fpc/FPCSource/tags/$FPCTAG/ thanks, Dmitry ___ fpc-pascal maillist - fpc-pascal@lists.freepasc

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-11 Thread Dmitry Boyarintsev via fpc-pascal
On Wed, Aug 11, 2021 at 5:37 PM Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > why not to use Github mirror? > Why not encourage people to go with the times ? > it might depend on the use of the version control. Maybe there's a certain automation involved behind t

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-11 Thread Dmitry Boyarintsev via fpc-pascal
On Thu, Aug 12, 2021 at 12:27 AM Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > It's like switching car brands from a VW to an Audi or so. > Some buttons are in different places, your key will maybe look different, > but that's it. It's a car, it brings you from a t

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-11 Thread Dmitry Boyarintsev via fpc-pascal
On Thu, Aug 12, 2021 at 1:34 AM LacaK via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I have related question: in SVN was possible to checkout specific > sub-directory (for example if I am interested in fcl-db package only I > checkedout only this sub-directory). > Is it possible with g

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-11 Thread Dmitry Boyarintsev via fpc-pascal
On Thu, Aug 12, 2021 at 2:00 AM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > What could I replace these svn co (or svn export) calls with? > the current: svn co https://svn.freepascal.org/svn/fpc/tags/$FPCTAG/ $FPCVER turns into: svn co https://github.com/fpc/FPCSource/

[fpc-pascal] Explicit Interface implementation and inheritance

2021-08-14 Thread Dmitry Boyarintsev via fpc-pascal
Hello, Why is interface implementation not inherited, if explicit implementation is used. Example. Here are interfaces: IAAA = interface procedure MethodA; end; IBBB = interface(IAAA) procedure MethodB; end; Interface IBBB inherits from IAAA Here's an implicit interface impleme

Re: [fpc-pascal] freepascal.org SSL_ERROR_BAD_CERT_DOMAIN

2022-01-04 Thread Dmitry Boyarintsev via fpc-pascal
You probably want to give a bit more context here. 1. The error seems to be visible only in Safari (iOS or macOS). I did test Chrome, it fails to open "https://freepascal.org"; and automagically reopens "www.freepascal.org". Thus the certificate error is not observed. Chrome also suggested that re

Re: [fpc-pascal] freepascal.org SSL_ERROR_BAD_CERT_DOMAIN

2022-01-05 Thread Dmitry Boyarintsev via fpc-pascal
On Wed, Jan 5, 2022 at 2:49 AM Dimitrios Chr. Ioannidis via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > the certificate issued for www.freepascal.org and not for freepascal.org . > > It seems that the let's encrypt script was run with -d freepascal.org > instead of -d *.freepascal.org .

Re: [fpc-pascal] freepascal.org SSL_ERROR_BAD_CERT_DOMAIN

2022-01-05 Thread Dmitry Boyarintsev via fpc-pascal
On Wed, Jan 5, 2022 at 5:05 AM Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I have made some changes, hopefully all is fixed.. > The redirect has been added. Can the search form also be changed to use "https://"; instead of "http://"; as its action? Currently it

<    1   2   3