In x64 the code must be:
Code: Select all
l.l=$FFFFFF85
i.i=$FFFFFFFFFFFFFF85
Debug l
Debug i
Code: Select all
l.l=$FFFFFF85
i.i=$FFFFFFFFFFFFFF85
Debug l
Debug i
Months ago I ran into the problem with PB6-x64 in which the values returned by #PB_Any were vastly different to the 32-bit compiler. In my source code I changed most of the .l to .i and it mostly worked. The only problems I ran into involved special structures or includes developed by others. The problem I had with the PDF code was one example but I have managed to work around that and there were few structure issues.BarryG wrote: Wed Nov 10, 2021 6:56 am Just to double-check: I only code with 32-bit PureBasic for now, so is there anything wrong with me changing all my ".l" variables to ".i" with the 32-bit version (for when the time comes to switch to 64-bit)? Or is there no point with the 32-bit version?
(And before anyone asks: a lot of my users still run 32-bit Windows, so it's not an option for me to compile only as 64-bit right now).
Code: Select all
Structure ScanAllTypes ;-!PB Datatypes
; Allows 1 Define for all datatypes to be scanned.
; Define *p.ScanAllTypes = @somevariable or *somememory
; Consider as a StructureUnion. Takes no memory and overflow is not checked.
; Ex. *p\d[i] ; 'i' can be incremented in a loop without compiler error.
; ; Type, Bytes, Min, Max, C Type
b.b[0] ; Byte, 1, -128, 127, char, bool(C++)
a.a[0] ; Ascii, 1, 0, 255, unsigned char, UCHAR, BYTE
c.c[0] ; Character, 2, 0, 65535, unsigned short, USHORT
u.u[0] ; Unicode, 2, 0, 65535, unsigned short, USHORT
w.w[0] ; Word, 2, -32768, 32767, short, VB6 integer
l.l[0] ; Long, 4, -2147483648, 2147483647, long, int (long & $FFFFFFFF = unsigned)
;;ul.ul[0] ; ULong, 4, 0, 4294967295, unsigned long, unsigned int, DWORD(C++)
i.i[0] ; Integer, 4, -2147483648, 2147483647, long, int(x86 or 32-bit),sizeof*
;i.i[0] ; Integer, 8, -9223372036854775808, 9223372036854775807, long long(x64 or 64-bit),sizeof*
q.q[0] ; Quad, 8, -9223372036854775808, 9223372036854775807, long long
;;uq.uq[0] ; UQuad, 8, 0, 18446744073709551615, unsigned long long, ULONGLONG
f.f[0] ; Float, 4, -1.175494e-38, 3.402823e+38, float (6 decimal places)
d.d[0] ; Double, 8, -2.2250738585072013e-308, 1.7976931348623157e+308, double (15 decimal places)
;;ld.ld[0] ; LDouble, 10, -3.4e-4932, 1.1e+4932,long double(19 decimal places)
;;s.s ; String$, 2/char + 2 for chr(0), , wchar_t, TCHAR
;s.s[0] ; FAIL, -> *p = @x$, *p\s[0] = IMA ERROR.
s.s{1}[0] ; {FixedLen}, 2/char, , char *, char var[] <-- Convert to Ascii
ss.s[0] ; Scan String array.
;s.s[0] ; FAIL, -> *p = @x$(), *p\s[1], *p\s[2], etc.
;s.s[0] ; OK, -> *p = @x$, *p\s[1], *p\s[2], etc.
;ss.s[0] ; OK, -> *p = @x$(), *p\ss[1], *p\ss[2], etc.
EndStructure