[fpc-pascal] header translation question: I need an int sized boolean

2012-04-21 Thread Bernd
sized bool? Bernd ___ ¹ I am trying to find out whether I can make a libpurple (Pidgin) plugin in FPC without needing these headers and gcc at all and without jumping through too many hoops. Now I have it loading, registering and unloading without a crash already :-) its not as complicated as I

Re: [fpc-pascal] header translation question: I need an int sized boolean

2012-04-22 Thread Bernd
ave posted the results of yesterday's experiments after it finally started working for the first time in the Lazarus forum: http://www.lazarus.freepascal.org/index.php/topic,10795.msg91177.html#msg91177 just in case somebody else also wants to experiment with it and doesn't

Re: [fpc-pascal] header translation question: I need an int sized boolean

2012-04-22 Thread Bernd
Am 22. April 2012 16:46 schrieb Mattias Gaertner : > Why not use gboolean from the glib unit? I didn't know it exists, so I didn't even try to search for it Thanks for the info :-) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.

Re: [fpc-pascal] header translation question: I need an int sized boolean

2012-04-22 Thread Bernd
Am 22. April 2012 17:39 schrieb Marco van de Voort : > FPC 2.6.0+ introduced boolean8/16/32/64 types for this. I just saw it in gtypes.inc and wondered what this is, this is the first time I have seen these new boolean types. Also Lazarus does not yet know about them in the code completion.

Re: [fpc-pascal] header translation question: I need an int sized boolean

2012-04-22 Thread Bernd
Am 22. April 2012 17:39 schrieb Marco van de Voort : > gboolean, > like Pascal booleans, are only true =1. Just out of curiosity, how can they enforce this for the C compiler with only some definitions in a header file? Isn't it just an alias for int? what if i just write gboolean something; som

[fpc-pascal] typesafe typecasting

2012-04-25 Thread Bernd
a good idea or would there have been an even more elegant way to achieve the same? Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] cross compiling - easier than expected - wiki needs update?

2012-04-29 Thread Bernd
ertainly more complicated because of the binutils but maybe also became easier), but I don't have enough experience with this to feel confident enough to make changes. Someone else with more routine in cross compiling should do this. Bernd ___ fpc-pasca

Re: [fpc-pascal] cross compiling - easier than expected - wiki needs update?

2012-04-29 Thread Bernd
resulting exe in wine then it will print this error and exit: err:module:import_dll Library libgdk-win32-2.0-0.dll (which is needed by L"Z:\\home\\bernd\\proj\\inventar\\inventar.exe") not found ___ fpc-pascal maillist - fpc-p

Re: [fpc-pascal] cross compiling - easier than expected - wiki needs update?

2012-04-29 Thread Bernd
2012/4/29 Mattias Gaertner : >> I tried this but then it seems it would try to use what is configured >> in "Build Lazarus" > I fixed that. Please test. Now it works, now just setting the target OS is sufficient :-) Thank you! Bernd _

[fpc-pascal] missing compiler warning in for loop - is this intentional?

2012-05-01 Thread Bernd
ariable is used" or should I file a bug? Or would this introduce too many complications and ugliness into the compiler that simply are not worth the effort? var A,B : Integer; begin B := 0; // will warn about unused B for A := 0 to 1000 do begin // no warning about

[fpc-pascal] FSplit is deprecated

2012-05-17 Thread Bernd
unixutil another deprecated function that has not written any hint towards its replacement right behind the 'deprecated' keyword (where it would belong). The RTL documentation also does not contain any hints. ___ fpc-pascal maillist - fpc-pascal@lists.

Re: [fpc-pascal] FSplit is deprecated

2012-05-18 Thread Bernd
ute perfection for granted and when I then accidentally stumble over one little trivial imperfection (every 6 months or so) while I am in a hurry (always) it irritates me sometimes ;-) Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org h

Re: [fpc-pascal] Unicodestrings and Assign(File)

2012-05-18 Thread Bernd
just make your own TFileStream descendant with a slightly different constructor that is using the widestring file open API? Maybe you could then use such a customized stream with AssignStream()? (Untested) Bernd ___ fpc-pascal maillist - fpc-pascal@lists.

Re: [fpc-pascal] Extend multiple classes with same code

2012-05-18 Thread Bernd
2012/5/18 Zaher Dirkey : > Hi, > > I have 2 objects inherited from the base one > > T_A = class(TObject); > > T_B1 = class(T_A); > T_B2 = class(T_A); > T_B3 = class(T_A); How about this: T_A = class(TObject); T_AX = class(T_A);// <-- this class implements your extensions T_B1 = class(T_AX);

[fpc-pascal] I need an lNet expert: multiple connections and only one central CallAction() - is this possible?

2012-05-28 Thread Bernd
This is a pure fpc project, no LCL. If I have understood it correctly then I have to call the CallAction() method for every connection I have created but this seems to totally contradict what it claims to be able to do: namely using some sophisticated event-mechanism that can watch multiple handles

[fpc-pascal] Re: I need an lNet expert: multiple connections and only one central CallAction() - is this possible?

2012-05-29 Thread Bernd
2012/5/29 Bernd Kreuss : > Also with my code I > seem to be able to produce strange crashes inside heaptrc that I have > never seen before. Here it is again: Marked memory at $ACBCEC60 invalid Wrong signature $ instead of F1283A25 $015D75BD FINISH_HEAP_FREE_TODO_LIST, li

Re: [fpc-pascal] Re: I need an lNet expert: multiple connections and only one central CallAction() - is this possible?

2012-05-30 Thread Bernd
2012/5/29 Jonas Maebe : > It means that you have memory corruption in your program (using objects after > freeing them, writing via pointers that have already been freed, writing past > end of a memory block allocated to a pointer, etc). This seems to happen inside the TLEpollEventer (it won't

[fpc-pascal] large TFDSet in windows, select() and FD_XXX() functions - will this work?

2012-05-31 Thread Bernd
I'm going to experiment with something like this: https://gist.github.com/2842807 Am I calling for trouble, did I forget something? According to some Google searching it seems other people have successfully done similar things in their C programs, has anybody here on this list already experiment

[fpc-pascal] Re: large TFDSet in windows, select() and FD_XXX() functions - will this work?

2012-05-31 Thread Bernd
2012/5/31 Bernd : > I'm going to experiment with something like this: > > https://gist.github.com/2842807 > I just patched my local copy of lNet to use this unit after winsock2 and tried it with Windows XP professional in a virtual machine, I went even higher with the number

[fpc-pascal] Re: large TFDSet in windows, select() and FD_XXX() functions - will this work?

2012-06-02 Thread Bernd
2012/5/31 Bernd : > I would like to propose something like this as a patch against > [...] > lNet to make the TLSelectEventer work the same way on all > supported platforms Almindor committed it to trunk :-) Now we can have non-LCL TCP servers with up to 1023 concurrent connection

[fpc-pascal] [Patch] there is a small bug in fcl-image imterpolation

2012-06-09 Thread Bernd
with colBlack which is (0,0,0,$) it must start with colTransparent which is (0,0,0,0) After applying this patch I can now properly scale images with alpha channel. Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

[fpc-pascal] Re: [Patch] there is a small bug in fcl-image imterpolation

2012-06-10 Thread Bernd
2012/6/9 Bernd : > It makes it > impossible to scale any image with alpha channel (the colors are fine > but the alpha channel will be messed up completely. I have made a minimal demo program to demonstrate the bug and filed a bug: http://bugs.freepascal.org/view.php

[fpc-pascal] fpmake question

2012-06-14 Thread Bernd
is is supposed to work. Run; end; end. now (while in the core folder) from the console I do fppkg build and this happens: bernd@t40:~/proj/git_torchat_laz/src/core\ $ fppkg build /usr/bin/ld: warning: link.res contains output sections; did you forget -T? Start building package core for targe

Re: [fpc-pascal] fpmake question

2012-06-14 Thread Bernd
Ok, I'm slowly making progress. The Targets.AddUnit() method needs the unit file name (with extension). But there is another problem. fpmake is slwwww. bernd@t40:~/proj/git_torchat_laz/src/core\ $ time fppkg build Start building package torchat-core for target i386-

[fpc-pascal] header translation question, 64 bit problem

2012-06-16 Thread Bernd
n 64 bit? Pointers should be ok, but what is with int and Integer and what is with enums? And are there maybe also certain compiler switches that influence it? What might be wrong? Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://l

Re: [fpc-pascal] header translation question, 64 bit problem

2012-06-17 Thread Bernd
Thank you all for the valuable info. I have now changed everything to use only the types from ctypes, cint for int and culong for unsigned long. Once my tester on the other side of the atlantic wakes up I can test it. 2012/6/17 Florian Klämpfl : > Am 17.06.2012 01:02, schrieb Be

Re: [fpc-pascal] header translation question, 64 bit problem

2012-06-17 Thread Bernd
2012/6/17 Jonas Maebe : > And if you use {$packrecords c}, then FPC is guaranteed to use the same > alignment as C compilers (aka what the platform ABI specifies). Done :-) https://github.com/prof7bit/TorChat/blob/torchat2/src/purple/purple.pas ___ fpc

Re: [fpc-pascal] header translation question, 64 bit problem

2012-06-17 Thread Bernd
2012/6/17 Bernd : > 2012/6/17 Jonas Maebe : > >> And if you use {$packrecords c}, then FPC is guaranteed to use the same >> alignment as C compilers (aka what the platform ABI specifies). > > Done :-) > https://github.com/prof7bit/TorChat/blob/torchat2/src/purple/purple

Re: [fpc-pascal] header translation question, 64 bit problem

2012-06-17 Thread Bernd
2012/6/17 Michalis Kamburelis : > Indexed is false by default in FPC >= 2.6.1, see "BTW" and notes in > http://bugs.freepascal.org/view.php?id=21835 Ah, then this mystery is also solved. I instructed the person who helped me to install the .deb packages from freepascal because Ubuntu only has 2.4

Re: [fpc-pascal] Dynamically Execute method

2012-06-18 Thread Bernd
2012/6/18 ik : > Hi, > > I'm playing a bit with the notion of execute a method dynamically on demand. > I'ved created the following PoC: > https://gist.github.com/2950789 Souldn't this be Exec: procedure of object; instead of only procedure? Imho one pointer alone can not be enough, it should ne

Re: [fpc-pascal] Converting from seconds to TTime: easiest way?

2012-06-20 Thread Bernd
2012/6/20 : > Try > > > > MyTTime := HugeNumberOfSecondsInteger / (3600 * 24); MyTTime := HugeNumberOfSecondsInteger / SecsPerDay; The predefined constants from SysUtils look nicer. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lis

Re: [fpc-pascal] Creating video files

2012-06-21 Thread Bernd
2012/6/20 Krzysztof : > Ffmpeg looks similar like Mencoder project. So I have some solutions > for output encoding, but there is a problem how to send frames to this > encoders. Mencoder can encode video from series of PNG files, but > can't find similar option in ffmpeg. ffmpeg can read a stream

[fpc-pascal] record helper types in 2.6

2012-06-28 Thread Bernd
as(77,32) Fatal: Syntax error, ":" expected but "FOR" found I have stripped down the example to the bare minimum, so the line numbers do not match but in the original file (77,32) points to the "for" in the first line of the t

Re: [fpc-pascal] record helper types in 2.6

2012-06-28 Thread Bernd
tly enough for me at the beginning, so I simply did not see it, although I scanned the document diagonally up and down at least three times. I should try to read more slowly. Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://list

[fpc-pascal] Header translation, argument list, array of const?

2012-06-29 Thread Bernd
ass 0 instead of this list? Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: Header translation, argument list, array of const?

2012-06-29 Thread Bernd
2012/6/29 Bernd : > and I call it with [] as the last parameter should I leave it as it is and simply pass [nil] to it to make a null-terminated list? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mail

Re: [fpc-pascal] Header translation, argument list, array of const?

2012-06-30 Thread Bernd
2012/6/30 Sven Barth : > Your explanation is very nice and mostly correct, but in case of external > cdecl functions in FPC the "varargs" modifier and a "array of const" > parameter imply the same C compatible parameter passing in the compiler. See > also here: > http://freepascal.org/docs-html/re

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

[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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[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] 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

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 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/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:/

[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] 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

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] 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 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-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

[fpc-pascal] redirecting stdout

2010-07-17 Thread Bernd
amongst other things messes around with stdout/stdin) seems to be undocumented voodoo magic to me. Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] redirecting stdout

2010-07-18 Thread Bernd
2010/7/18 Sven Barth : > Also you can try unit StreamIO (in fcl-base) which allows you to use Streams > as TextFiles (you can also look at it to learn how to implement your own > text driver). This looks more promising, streams seem to be a more high level implementation of such concepts. I'm cur

Re: [fpc-pascal] redirecting stdout

2010-07-18 Thread Bernd
OK, I got it working now. Just in case somebody else is googling for something like this: first I define a class TDebugStream that will later replace the standard output: Type TDebugStream = class(TStream) function Write(const Buffer; Count : Longint) : Longint; override; end; implementa

Re: [fpc-pascal] redirecting stdout

2010-07-18 Thread Bernd
2010/7/18 Michael Van Canneyt : > I think that simply > > AssignStream(Output,S); > Rewrite(Output); > > Probably would work as well. Yes, you are of course right, this is simpler. I just forgot to simplify it after I was initially playing around and experimenting with a separate file and without

[fpc-pascal] Re: [Lazarus] Lazarus 0.9.30 released

2011-03-28 Thread Bernd
2011/3/28 Mattias Gaertner : > > The Lazarus team is glad to announce the 0.9.30 release. This release > is based on fpc 2.4.2. Somebody should notify heise.de, it seems they have missed it. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org htt

[fpc-pascal] nested macros in C headers

2011-04-23 Thread Bernd
Hi, I found this: http://pastebin.com/T4jkeE6F in a zip file called vfp.tar.bz4 somewhere on the web, it seems not maintained since ages but obviously it must have compiled at some time in the past. I am tying to see whether I can hack a quick and dirty program that is able to open an v4l device

Re: [fpc-pascal] nested macros in C headers

2011-04-24 Thread Bernd
fuscated kernel headers into something readable and usable is really not a trivial task at all. Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] nested macros in C headers

2011-04-24 Thread Bernd
2011/4/24 Paulo Costa : > the TSdpoVideo4L2 component has the V4L2 translated... Thanks. This is interesting. I saw this before but didn't look deeper into it after I read "UVC compliant USB cameras" in the wiki, this seemed to imply for me that it would only work with the subset of cameras that

Re: [fpc-pascal] nested macros in C headers

2011-04-30 Thread Bernd
searching for the same problem. It also contains a class with some methods that demonstrates how to open the cam and grab images, I have used it in this current form to sucessfully grab streaming images from an old QuickCam Express that uses the qc-usb driver on kernel 2.6.24. Bernd { Implements t

Re: [fpc-pascal] nested macros in C headers

2011-05-03 Thread Bernd
pen(), v4l2_ioctl(), v4l2_mmap() etc. and all existing (known) V4L2 cameras could then be set to BGR24 and would deliver uncompressed 24bit BGR video. If I have some time next weekend I will make a patch against SdpoVideo4L2 (with an ifdef) that allows enabling this functionality. Be

[fpc-pascal] Shootout: k-nucleotide implementation (was: Which programming language is fastest?)

2011-05-08 Thread Bernd
27;t have much time for this today anymore, I will continue later. Also I doubt they will ever accept it. I only wanted to know why on earth the C++ version can be so fast and why the existing Pascal version is so slow and how fast this problem can be solved at all. Bernd kn2.lpr Description

[fpc-pascal] missing stacktrace - why?

2011-07-04 Thread Bernd
nd; begin try bar; except on E: Exception do begin writeln(E.ToString, ': ', E.Message); DumpExceptionBackTrace(StdOut); end; end; end. if I compile with -gl and no optimizations and execute this then it will dump a stack trace to the console: bernd@

[fpc-pascal] getting UTC time

2011-07-10 Thread Bernd
use windows. There must be a simple function in the RTL to get the current time (in UTC) that works on all platforms, I am sure I must be missing something, such a function surely exists in a modern runtime library in the year 2011, doesn't it?

[fpc-pascal] how to test if a file is open to write?

2011-07-13 Thread Bernd
Because I have no idea how to do this properly (It has been a hundred years since I last used this form of file IO in Pascal) I have done the following hack, just to get it running somehow but now I wonder what would be the proper way to do this. How can I do something like a hypothetical IsOpen(St

Re: [fpc-pascal] how to test if a file is open to write?

2011-07-15 Thread Bernd
Only the console problem made me realize again that it seems I have completely forgotten everything I ever knew about the File and Text types and their internal mechanisms. Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freep

[fpc-pascal] [semi-off-topic] some C questions arising while using h2pas

2011-07-15 Thread Bernd
fits into my Pascal brain) how would the C compiler or linker know from where exactly to import these functions? Where is this information, how are these C folks doing these things, what kind of magic have they going on? confused, Bernd ___ fpc-pascal

Re: [fpc-pascal] how to test if a file is open to write?

2011-07-15 Thread Bernd
2011/7/15 Sven Barth : > Hmm... I don't know whether I understand your intension correctly, but do > you know about the unit "IOStream"? I know about streams and use all sorts of streams every day, but what i don't know very much about is the old pascal-ish way of handling files that I have not u

Re: [fpc-pascal] [semi-off-topic] some C questions arising while using h2pas

2011-07-15 Thread Bernd
m currently experimenting with my own header translations. Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] operator overloading and counting references / creating / destoying anonymous instances

2011-07-28 Thread Bernd
_add(a,a,a) without allocating more than one number handle)? Bernd _ ¹ I depend on OpenSSL already anyways, so I thought why not make use of its bignum too when I need it. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.free

[fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-28 Thread Bernd
2011/7/28 Bernd : > And also maybe does some > clever and elegant pattern exist that would enable me to simply reuse > the instance of A (if an initialized object exists already on the left > side of the assignment) For example (pseudocode, not sure if this is allowed): operator + (

[fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-28 Thread Bernd
2011/7/28 Bernd : > operator + (a,b: IBigNum):IBigNum; > begin >  if not assigned(Result) then >    Result := TBigNum.Create; >  BN_add(Result.BN, a.BN, b.BN); > end; > > Am I allowed to access the Result in this way? I have done only a few > experiments and at one ti

[fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-28 Thread Bernd
2011/7/28 Bernd : > I have tried making > use of Interface and TInterfacedObject and this seems to do what I > want: for example when witing A := A + B the + operator would return a > new instance and the reference counting would then automatically call > the destructor of A when

[fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-29 Thread Bernd
user of that unit would have many WTF-moments when debugging the unexpected strange behavior in his code and all the efforts of making it look and behave natural would effectively be nullified by such a problem. Bernd ___ fpc-pascal maillist - fpc

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-29 Thread Bernd
2011/7/29 Jürgen Hestermann : > Bernd schrieb: >> Occasionally I hear other people mentioning operator overloading as a >> must-have feature of any decent language but I wonder what real-world >> problems they are actually solving with it. > > I think operator overloa

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-30 Thread Bernd
2011/7/30 Florian Klaempfl : > The automatic constructor/destructor concept of C++ causes the same > overhead. And the overhead for a function or operator overloading based > approach is the same imo. Or do you have any example where a function > based approach performs better? Overloaded operator

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-30 Thread Bernd
2011/7/30 Florian Klämpfl : > This is exactly what ref. counting solves? Did you read my other mail > regarding your problem with ref. counting? Yes, of course Ref counting "solves" it (in the sense that it can all be made to work as expected and not leak memory) and your suggestion of checking t

Re: [fpc-pascal] operator overloading and counting references / creating / destoying anonymous instances

2011-07-31 Thread Bernd
2011/7/31 Honza : > 2011/7/28 Bernd : >> ¹ I depend on OpenSSL already anyways, so I thought why not make use >> of its bignum too when I need it. > > I hope you're aware of the FPC GMP bindings: > > http://wiki.freepascal.org/gmp It seems the author fought with t

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-05 Thread Bernd
2011/10/25 : >> targethread.queue( >>  procedure(targetobject:ttargetobject;a:integer;b:someobject;c:string) >>             begin >>               targetobject.destinationprocedure(a,b,c); >>             end; >> >> Note how common this looks compared to the original. > > One point is that you cou

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-05 Thread Bernd
2011/10/25 Marco van de Voort : > Equivalent solution with anon functions: > > targethread.queue( >   procedure(targetobject:ttargetobject;a:integer;b:someobject;c:string) >              begin >                targetobject.destinationprocedure(a,b,c); >              end; shouldn't this be targeth

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-05 Thread Bernd
2011/11/5 Michael Van Canneyt : > Procedure SomeOuter; > > Var >  d,e,f : SomeType; > >  Procedure > SomeInner(targetobject:ttargetobject;a:integer;b:someobject;c:string) >   begin >      targetobject.destinationprocedure(a,b,c); >   end; > > begin >  Targethread.queue(@SomeInner(aobject,d,e,f)); >

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-06 Thread Bernd
2011/11/6 Michael Van Canneyt : > I am not against closure functionality, although I highly doubt it is *that* > useful as some people make it out to be. Even so, I use it in my Javascript > programming. I'm also not entirely sure about the necessity of closures in OP, but I must admit I am not t

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-06 Thread Bernd
2011/11/6 Florian Klämpfl : > It would be probably more clear to write and this more pascalish: > > Procedure SomeOuter; > > Var >  d,e,f : SomeType; > >  Lambda Procedure > SomeInner(targetobject:ttargetobject;a:integer;b:someobject;c:string) >  begin >     targetobject.destinationprocedure(a,b,c)

Re: [fpc-pascal] using functions from units & main programme

2011-11-18 Thread Bernd
dden). In your main program you would declare a class TFred derived from TJim and override fna. Then when you make an instance of TFred and call Fred.fnb the code of fnb would automatically use the fna method of TFred. Bernd ___ fpc-pascal mail

Re: [fpc-pascal] using functions from units & main programme

2011-11-19 Thread Bernd
specializing the behavior of some generic library code). Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-24 Thread Bernd
2.6.0 (no more RC needed) create tags/release_2_6_0 in fixes_2_6 change version to 2.6.1 fix bugs... so that the fixes branch always at any time has the highest version number of this branch, higher than everything released from this branch so far? Bernd _

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-24 Thread Bernd
2011/11/24 Jonas Maebe : >> The branch fixes_2_6 still has the version 2.5.1. shouldn't this be >> set to 2.6.0-RC1.1? > > No. Only releases have even version numbers (RC or not). Thats why I wrote RC1.1 to solve this dilemma, to give it an odd number between RC1 and RC2.

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-24 Thread Bernd
ing more consistent. Initially I really thought I had gotten something wrong when I started using the 2_6 branch and it installed itself into the old 2.5.1 directory, i intuitively expected the 2_6 branch would also carry a 2.6 version number. Bernd ___ fp

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-26 Thread Bernd
nk all the time, only during the last few months I had some problems with it, some revisions didn't even compile on my system due to some major work going on in the RTL and I finally decided to change down a gear and stay with the latest stable branch

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-26 Thread Bernd
>> and I finally decided to change down a gear and stay with the >> latest stable branch for a while. > > That makes sense, but you are in a wrong branch then. I wanted to switch down one gear, not two. What would be the correct 2.6 stabilizing/soon-to-become-stable branch if this is the wrong one

[fpc-pascal] i386: strange code generated in simple for loop

2011-12-03 Thread Bernd
Hello, I have observed something I do not understand. The following is a series of for-loops and the generated code looks strange to me. There always appears an inc followed by a dec and what is even more bizarre is the code in between it: sometimes it inserts a mov %esi,%esi, sometimes lea0x0(

  1   2   3   >