[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gambas-bugtracker] Bug #3143: Structure size calculations seem off , varptr to structure do not return a pointer to data area
[Thread Prev] | [Thread Next]
- Subject: [Gambas-bugtracker] Bug #3143: Structure size calculations seem off , varptr to structure do not return a pointer to data area
- From: <bugtracker@xxxxxxxxxxxxxx>
- Date: Thu, 19 Feb 2026 21:34:32 GMT
- To: brian@xxxxxxxxxxxxxxxx,bugtracker@xxxxxxxxxxxxxxxxxxxxxx
http://gambaswiki.org/bugtracker/edit?object=BUG.3143&from=L21haW4- Comment #4 by Benoît MINISINI: > since assigning a pointer to a structure, varptr returns the actual address of the structure data. What are you talking about? Where did you see that? > And since structures are an interface for c programs, would it not be more proper to have a structure created with new, return the data address with varptr as well, as in most cases > you are working with the actual structure. > and it would be consistent in all cases. VarPtr() is for returning the address of the data held by a variable. The only case where this address matches the contents of a structure is for structures embedded into an object. Otherwise, structures are Gambas object, and so their address is different from the address of their contents. Only 'Object.Data()' can return the contents of a Gambas object, according to if it is a structure or not, or something else. > I would not have to redefine memcpy as an example 6 times once for each structure, rather I could actually use a pointer datatype.. I don't understand what you are talking about with 'memcpy'. ----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----
| [Gambas-bugtracker] Bug #3143: Structure size calculations seem off , varptr to structure do not return a pointer to data area | <bugtracker@xxxxxxxxxxxxxx> |