all: Fix unconstrained_Conversion's whose types have different sizes.
This commit is contained in:
@@ -6,7 +6,6 @@ with
|
|||||||
|
|
||||||
interfaces.C.Strings,
|
interfaces.C.Strings,
|
||||||
|
|
||||||
ada.unchecked_Conversion,
|
|
||||||
ada.unchecked_Deallocation,
|
ada.unchecked_Deallocation,
|
||||||
ada.Finalization;
|
ada.Finalization;
|
||||||
|
|
||||||
@@ -23,7 +22,6 @@ is
|
|||||||
--- Utility
|
--- Utility
|
||||||
--
|
--
|
||||||
|
|
||||||
function to_Flag is new ada.unchecked_Conversion (FT_Kerning_Mode, C.unsigned);
|
|
||||||
procedure deallocate is new ada.Unchecked_Deallocation (float_Array, float_Array_view);
|
procedure deallocate is new ada.Unchecked_Deallocation (float_Array, float_Array_view);
|
||||||
|
|
||||||
|
|
||||||
@@ -248,7 +246,7 @@ is
|
|||||||
Self.Err := FT_Get_Kerning (Self.ftFace,
|
Self.Err := FT_Get_Kerning (Self.ftFace,
|
||||||
C.unsigned (index1),
|
C.unsigned (index1),
|
||||||
C.unsigned (index2),
|
C.unsigned (index2),
|
||||||
to_Flag (ft_Kerning_unfitted),
|
ft_Kerning_unfitted'enum_Rep,
|
||||||
kernAdvance'unchecked_Access);
|
kernAdvance'unchecked_Access);
|
||||||
if Self.Err /= 0
|
if Self.Err /= 0
|
||||||
then
|
then
|
||||||
@@ -323,7 +321,7 @@ is
|
|||||||
loop
|
loop
|
||||||
Self.Err := FT_Get_Kerning (Self.ftFace,
|
Self.Err := FT_Get_Kerning (Self.ftFace,
|
||||||
i, j,
|
i, j,
|
||||||
to_Flag (ft_Kerning_unfitted),
|
ft_Kerning_unfitted'enum_Rep,
|
||||||
kernAdvance'unchecked_Access);
|
kernAdvance'unchecked_Access);
|
||||||
if Self.Err /= 0
|
if Self.Err /= 0
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ is
|
|||||||
|
|
||||||
type GLvoid_access is access all GLvoid;
|
type GLvoid_access is access all GLvoid;
|
||||||
|
|
||||||
function to_GL is new ada.unchecked_Conversion (attribute.data_Kind, gl.GLenum); -- TODO: Address different sizes warning.
|
|
||||||
function to_GL is new ada.unchecked_Conversion (storage_Offset, GLvoid_access);
|
function to_GL is new ada.unchecked_Conversion (storage_Offset, GLvoid_access);
|
||||||
begin
|
begin
|
||||||
Tasks.check;
|
Tasks.check;
|
||||||
@@ -109,7 +108,7 @@ is
|
|||||||
|
|
||||||
glVertexAttribPointer (Index => Self.gl_Location,
|
glVertexAttribPointer (Index => Self.gl_Location,
|
||||||
Size => Self.Size,
|
Size => Self.Size,
|
||||||
the_Type => to_GL (Self.data_Kind),
|
the_Type => Self.data_Kind'enum_Rep,
|
||||||
Normalized => Self.Normalized,
|
Normalized => Self.Normalized,
|
||||||
Stride => Self.vertex_Stride,
|
Stride => Self.vertex_Stride,
|
||||||
Ptr => to_GL (Self.Offset));
|
Ptr => to_GL (Self.Offset));
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ with
|
|||||||
GL,
|
GL,
|
||||||
system.storage_Elements;
|
system.storage_Elements;
|
||||||
|
|
||||||
|
|
||||||
package openGL.Attribute
|
package openGL.Attribute
|
||||||
--
|
--
|
||||||
-- Models an openGL shader attribute.
|
-- Models an openGL shader attribute.
|
||||||
@@ -76,6 +77,7 @@ private
|
|||||||
Normalized : gl.GLboolean;
|
Normalized : gl.GLboolean;
|
||||||
end record;
|
end record;
|
||||||
|
|
||||||
|
|
||||||
for data_Kind use (GL_BYTE => 16#1400#,
|
for data_Kind use (GL_BYTE => 16#1400#,
|
||||||
GL_UNSIGNED_BYTE => 16#1401#,
|
GL_UNSIGNED_BYTE => 16#1401#,
|
||||||
GL_SHORT => 16#1402#,
|
GL_SHORT => 16#1402#,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
with
|
with
|
||||||
ada.unchecked_Deallocation,
|
ada.unchecked_Deallocation;
|
||||||
ada.unchecked_Conversion;
|
|
||||||
|
|
||||||
package body openGL.Font
|
package body openGL.Font
|
||||||
is
|
is
|
||||||
@@ -232,13 +232,12 @@ is
|
|||||||
Spacing : in Vector_3 := Origin_3D;
|
Spacing : in Vector_3 := Origin_3D;
|
||||||
Mode : in fontImpl.RenderMode := fontImpl.RENDER_ALL) return Vector_3
|
Mode : in fontImpl.RenderMode := fontImpl.RENDER_ALL) return Vector_3
|
||||||
is
|
is
|
||||||
function to_Integer is new ada.Unchecked_Conversion (fontImpl.RenderMode, Integer);
|
|
||||||
begin
|
begin
|
||||||
return Self.impl.Render (Text,
|
return Self.impl.Render (Text,
|
||||||
Length,
|
Length,
|
||||||
Position,
|
Position,
|
||||||
Spacing,
|
Spacing,
|
||||||
to_Integer (Mode));
|
Mode'enum_Rep);
|
||||||
end check_Glyphs;
|
end check_Glyphs;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ with
|
|||||||
GL.lean,
|
GL.lean,
|
||||||
GL.Pointers,
|
GL.Pointers,
|
||||||
|
|
||||||
freetype_c.Binding,
|
freetype_c.Binding;
|
||||||
ada.unchecked_Conversion;
|
|
||||||
|
|
||||||
package body openGL.FontImpl.Texture
|
package body openGL.FontImpl.Texture
|
||||||
is
|
is
|
||||||
@@ -167,8 +167,6 @@ is
|
|||||||
use GL,
|
use GL,
|
||||||
GL.Binding;
|
GL.Binding;
|
||||||
|
|
||||||
function to_Integer is new ada.unchecked_Conversion (fontImpl.RenderMode, Integer);
|
|
||||||
|
|
||||||
Tmp : Vector_3;
|
Tmp : Vector_3;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@@ -180,9 +178,11 @@ is
|
|||||||
|
|
||||||
GlyphImpl.texture.ResetActiveTexture;
|
GlyphImpl.texture.ResetActiveTexture;
|
||||||
|
|
||||||
Tmp := FontImpl.item (Self.all).Render (Text, Length,
|
Tmp := FontImpl.item (Self.all).Render (Text,
|
||||||
Position, Spacing,
|
Length,
|
||||||
to_Integer (Mode));
|
Position,
|
||||||
|
Spacing,
|
||||||
|
Mode'enum_Rep);
|
||||||
return Tmp;
|
return Tmp;
|
||||||
end Render;
|
end Render;
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,13 @@ with
|
|||||||
gel. any_Joint,
|
gel. any_Joint,
|
||||||
gel.World,
|
gel.World,
|
||||||
|
|
||||||
ada.Tags,
|
ada.unchecked_Deallocation;
|
||||||
ada.unchecked_Deallocation,
|
|
||||||
ada.unchecked_Conversion;
|
|
||||||
|
|
||||||
package body gel.Sprite
|
package body gel.Sprite
|
||||||
is
|
is
|
||||||
use ada.Tags,
|
use linear_Algebra_3D;
|
||||||
linear_Algebra_3D;
|
|
||||||
|
|
||||||
|
|
||||||
procedure log (Message : in String)
|
procedure log (Message : in String)
|
||||||
@@ -1149,43 +1148,4 @@ is
|
|||||||
end program_Parameters;
|
end program_Parameters;
|
||||||
|
|
||||||
|
|
||||||
-----------
|
|
||||||
--- Utility
|
|
||||||
--
|
|
||||||
|
|
||||||
function to_Hash (Self : in ada.Tags.Tag) return ada.Containers.Hash_type
|
|
||||||
is
|
|
||||||
function Converted is new ada.unchecked_Conversion (ada.Tags.Tag, ada.Containers.Hash_type);
|
|
||||||
begin
|
|
||||||
return Converted (Self);
|
|
||||||
end to_Hash;
|
|
||||||
pragma Unreferenced (to_Hash);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- protected
|
|
||||||
-- body safe_Matrix_4x4
|
|
||||||
-- is
|
|
||||||
-- function Value return Matrix_4x4
|
|
||||||
-- is
|
|
||||||
-- begin
|
|
||||||
-- return the_Value;
|
|
||||||
-- end Value;
|
|
||||||
--
|
|
||||||
-- procedure Value_is (Now : in Matrix_4x4)
|
|
||||||
-- is
|
|
||||||
-- begin
|
|
||||||
-- the_Value := Now;
|
|
||||||
-- end Value_is;
|
|
||||||
--
|
|
||||||
-- procedure Site_is (Now : in Vector_3)
|
|
||||||
-- is
|
|
||||||
-- begin
|
|
||||||
-- the_Value (4, 1) := Now (1);
|
|
||||||
-- the_Value (4, 2) := Now (2);
|
|
||||||
-- the_Value (4, 3) := Now (3);
|
|
||||||
-- end Site_is;
|
|
||||||
-- end safe_Matrix_4x4;
|
|
||||||
|
|
||||||
|
|
||||||
end gel.Sprite;
|
end gel.Sprite;
|
||||||
|
|||||||
@@ -1082,8 +1082,8 @@ is
|
|||||||
function to_Hash is new ada.unchecked_Conversion (impact_Filter, ada.Containers.Hash_type);
|
function to_Hash is new ada.unchecked_Conversion (impact_Filter, ada.Containers.Hash_type);
|
||||||
function to_Hash is new ada.unchecked_Conversion (impact_Response, ada.Containers.Hash_type);
|
function to_Hash is new ada.unchecked_Conversion (impact_Response, ada.Containers.Hash_type);
|
||||||
begin
|
begin
|
||||||
return to_Hash (Self.Filter)
|
return to_Hash (Self.Filter) / 2
|
||||||
+ to_Hash (Self.Response);
|
+ to_Hash (Self.Response) / 2;
|
||||||
end Hash;
|
end Hash;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user