-
Content Count
3586 -
Joined
-
Last visited
-
Days Won
176
Everything posted by David Heffernan
-
TimSort for Delphi without Generics
David Heffernan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
What is the advantage over Timsort? -
I'm not sure what you want to do. Do you want to read the XML quickly? Or do you want to read the XML without using CPU resources? Because it seems like you want to do both but of course you can do one or the other but not both.
-
TimSort for Delphi without Generics
David Heffernan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
What algorithm? -
No. This is of course easy to test using debugging techniques, trace logging etc. It's also documented in the language guide.
-
atomic setting of a double variable
David Heffernan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
@Stefan Glienke already explained that quadword reads/writes are atomic for aligned data. -
atomic setting of a double variable
David Heffernan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
This is true for all atomic memory operations. Is your argument that we should not use atomic memory operations? That can't be what you mean. Like all code, there are pre-conditions for it to work. In this case we require the memory to be aligned. Onus for that falls on the user. And it's clear that Thomas knows this. -
A class that returns different types of components
David Heffernan replied to Stano's topic in Algorithms, Data Structures and Class Design
No. The polymorphism applies to method dispatch, and not to the types. -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
No. It's not counting lines. It's counting warnings. The compiler emits two distinct warnings. For whatever reason they are identical. There's doubtless some internal quirk that explains it. -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
They are all counted correctly. Look in the screen shots. Count the items marked error, warning and hint. Compare to the totals reported. In every single case these match. I think in this case you need to pay a bit more attention to the detail. -
A class that returns different types of components
David Heffernan replied to Stano's topic in Algorithms, Data Structures and Class Design
A function's return type is defined at compile time. So whilst you might return objects of different types in the implementation, the type that you declare as the return value type is determined when ylthe code is compiled, and must be an ancestor of all possible types that are actually returned. This is strong typing in action. Types determined at compile time. That's how delphi is. Dynamic typing seems like what you are wanting here. But that isn't something that exists in Delphi. That's something that you find typically in lamguages like Python. -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
They are counting correctly. When it says 2 errors, there are 2 errors. When it says 3 warnings, there are 3 warnings. What you have noted is that there are sometimes duplicate warnings. But they are counted correctly. Tell me this, how does a duplicate warning have any discernible impact to any user? Why would it be a useful way to spend development resource on such trivialities? -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
The fact that you regard this topic as important. That you feel it's important to count errors beyond one. The fact that sometimes delphi emits two warnings for the same issue. None of these things matter. -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
Sure. But if that's all you read then you don't see the big picture. -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
Perhaps this explains the focus on tiny details and missing the bigger picture. We all know about the importance of attention to detail. Of course the compiler spitting out two warnings rather than one here is imperfect. But it has no impact on any user. It's trivial. Delphi has so many big issues and this is what gets people heated?! -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
The complete lack of perspective here is breathtaking. -
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
Leaving aside my sarcastic response above, I think a majority of Delphi users will not regard this as an issue. What happens here is that the compiler reaches a point where the errors which have been encountered so far mean that it decides to abort compilation of this unit. And it reports that decision as an error. It's been this way since the dawn of time. Nobody, but nobody, cares about precisely how many errors there are in their code. There are two states that matter: The code has no errors. The code has some errors. Were the compiler to do what you ask, and not write the "cannot compile unit" error, and report a single error, you would not know that there was but a single error. Because the compiler had given up and any errors that are present in the code which follows the point at which the compiler aborted, would not be counted. It is useful for the compiler to report counts of hints and warnings, since these values are meaningful. Counts of errors are, as I have shown above, are not. That this even has to be explained astounds me. -
Modern C++ projection would be wondrous. Get rid of all those macros!
-
1 error + 1 error = 3 errors? where is the extra one?
David Heffernan replied to c0d3r's topic in Delphi IDE and APIs
This is so important! We must leave no stone unturned in our battle to persuade Embarcadero to change this! -
Is it really that bad to Use boolean parameters to make your functions do two things?
David Heffernan replied to Mike Torrettinni's topic in General Help
It's as if the thread above never happened!!!! -
atomic setting of a double variable
David Heffernan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
Unless you have a performance bottleneck, this is the shrewd approach. -
atomic setting of a double variable
David Heffernan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
assembly - How do I atomically move a 64bit value in x86 ASM? - Stack Overflow is also relevant -
I'd read the documentation, which is here (E2217 Published field '%s' not a class or interface type (Delphi) - RAD Studio (embarcadero.com)) and which tells you what the problem is. There's a nuance here in that the section of the class declaration that does not specify visibility has published visibility in your environment. That's not always the case, I've forgotten what it depends upon, I think that there's a conditional. Anyway, the solution for you is to add the private keyword that it looks like you forgot, or deleted by mistake. Check in your revision control system. OK, and here's what I had forgotten. Again, I looked it up in the docs: Classes and Objects (Delphi) - RAD Studio (embarcadero.com) So you are clearly compiling the with {$M+}
- 4 replies
-
- delphi
- compiler error
-
(and 1 more)
Tagged with:
-
atomic setting of a double variable
David Heffernan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
What are you trying to do here? Are you trying to make an atomic assignment but ignore any race conditions? Where is the corresponding code that reads in an atomic fashion? No point having atomic writes if you don't pair them with atomic reads. You'll just suffer tearing on reading. For 64 bit code, reads and writes of aligned 64 bit values are already atomic. So plain Pascal assignment operators will do what you need. So long as your values are aligned. Can you be sure that they will be? Are local variables of type double aligned? It's quite an unusual thing to be doing, I know I've never had a need to do this with doubles. What is the motivation out of interest? -
Add support for High-DPI gdiScaling
David Heffernan replied to Tom Mueller's topic in Delphi IDE and APIs
Multiple Document Interface - Win32 apps | Microsoft Docs In practice we can see that MS have not updated MDI for a very long time. The window chrome for MDI child windows does not match the latest style. I mean, this is MS, it's not going away any time soon. -
Add support for High-DPI gdiScaling
David Heffernan replied to Tom Mueller's topic in Delphi IDE and APIs
If you want to submit a feature request to Embarcadero, do so here: https://quality.embarcadero.com/