Code: Select all
type hex_cube
dim as integer x 'pointing right/up
dim as integer y 'pointing left/up
dim as integer z 'pointing down
end type
type hex_offset
dim as integer row_, col_
end type
function hex_oddr_to_cube(ho as hex_offset) as hex_cube
dim as integer x = ho.col_ - (ho.row_ - (ho.row_ and 1)) \ 2
dim as integer y = ho.row_
dim as integer z = -(x + z)
return type<hex_cube>(x, y, z)
end function
Code: Select all
fbc64 -w all "test.bas" (in directory: /home/badidea/Desktop)
test.c: In function ‘HEX_ODDR_TO_CUBE’:
test.c:36:14: warning: ‘Z$1’ is used uninitialized in this function [-Wuninitialized]
Z$1 = -(X$1 + Z$1);
~~~~~^~~~~~
Compilation finished successfully.
Are there no 'uninitialized variable checks' possible with FreeBASIC itself?