Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
e0b0793e
Commit
e0b0793e
authored
May 22, 2016
by
yoogx
Browse files
* (Add_ULL_To_Name_Buffer): new function to print an unsigned
long long in any base.
parent
9a82469c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/core/common_files/ocarina-namet.adb
View file @
e0b0793e
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
6
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -97,6 +97,21 @@ package body Ocarina.Namet is
Add_Char_To_Name_Buffer
(
Character
'
Val
(
Character
'
Pos
(
'0'
)
+
V
rem
10
));
end
Add_Nat_To_Name_Buffer
;
----------------------------
-- Add_ULL_To_Name_Buffer --
----------------------------
procedure
Add_ULL_To_Name_Buffer
(
U
:
ULL
;
B
:
ULL
;
S
:
Integer
:=
1
)
is
Hex
:
constant
String
:=
"0123456789ABCDEF"
;
Q
:
constant
ULL
:=
U
/
B
;
R
:
constant
ULL
:=
U
mod
B
;
begin
if
Q
/=
0
or
else
S
>
1
then
Add_ULL_To_Name_Buffer
(
Q
,
B
,
S
-
1
);
end
if
;
Add_Char_To_Name_Buffer
(
Hex
(
Hex
'
First
+
Natural
(
R
)));
end
Add_ULL_To_Name_Buffer
;
----------------------------
-- Add_Str_To_Name_Buffer --
----------------------------
...
...
src/core/common_files/ocarina-namet.ads
View file @
e0b0793e
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-201
6
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -144,6 +144,13 @@ package Ocarina.Namet is
pragma
Inline
(
Set_Dnat_To_Name_Buffer
);
-- Equivalent to Name_Len := 0; followed by Add_Nat_To_Name_Buffer (V);
subtype
ULL
is
Unsigned_Long_Long
;
procedure
Add_ULL_To_Name_Buffer
(
U
:
ULL
;
B
:
ULL
;
S
:
Integer
:=
1
);
-- Add base B representation of U to the end of the string
-- currently stored in Name_Buffer, incrementing Name_Len as
-- required.
procedure
Add_Str_To_Name_Buffer
(
S
:
String
);
-- Add characters of string S to the end of the string currently stored
-- in the Name_Buffer, incrementing Name_Len by the length of the string.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment