Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
2b755564
Commit
2b755564
authored
Aug 11, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export large constants
R=r DELTA=37 (31 added, 4 deleted, 2 changed) OCL=14089 CL=14089
parent
cbaca0be
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
6 deletions
+33
-6
src/cmd/gc/export.c
src/cmd/gc/export.c
+1
-1
src/cmd/gc/go.h
src/cmd/gc/go.h
+1
-0
src/cmd/gc/lex.c
src/cmd/gc/lex.c
+1
-0
src/cmd/gc/mparith1.c
src/cmd/gc/mparith1.c
+29
-0
src/cmd/gc/subr.c
src/cmd/gc/subr.c
+1
-5
No files found.
src/cmd/gc/export.c
View file @
2b755564
...
...
@@ -78,7 +78,7 @@ dumpexportconst(Sym *s)
case
CTINT
:
case
CTSINT
:
case
CTUINT
:
Bprint
(
bout
,
"
0x%llux
\n
"
,
mpgetfix
(
n
->
val
.
u
.
xval
)
);
Bprint
(
bout
,
"
%B
\n
"
,
n
->
val
.
u
.
xval
);
break
;
case
CTBOOL
:
Bprint
(
bout
,
"0x%llux
\n
"
,
n
->
val
.
u
.
bval
);
...
...
src/cmd/gc/go.h
View file @
2b755564
...
...
@@ -487,6 +487,7 @@ void mpatofix(Mpint *a, char *s);
void
mpatoflt
(
Mpflt
*
a
,
char
*
s
);
void
mpmovefltfix
(
Mpint
*
a
,
Mpflt
*
b
);
void
mpmovefixflt
(
Mpflt
*
a
,
Mpint
*
b
);
int
Bconv
(
Fmt
*
);
/*
* mparith2.c
...
...
src/cmd/gc/lex.c
View file @
2b755564
...
...
@@ -52,6 +52,7 @@ mainlex(int argc, char *argv[])
fmtinstall
(
'N'
,
Nconv
);
// node pointer
fmtinstall
(
'Z'
,
Zconv
);
// escaped string
fmtinstall
(
'L'
,
Lconv
);
// line number
fmtinstall
(
'B'
,
Bconv
);
// big numbers
lexinit
();
lineno
=
1
;
...
...
src/cmd/gc/mparith1.c
View file @
2b755564
...
...
@@ -348,3 +348,32 @@ bad:
warn
(
"set ovf in mpatov: %s"
,
as
);
mpmovecfix
(
a
,
0
);
}
int
Bconv
(
Fmt
*
fp
)
{
char
buf
[
500
],
*
p
;
Mpint
*
xval
,
q
,
r
,
ten
;
int
f
;
xval
=
va_arg
(
fp
->
args
,
Mpint
*
);
mpmovefixfix
(
&
q
,
xval
);
f
=
0
;
if
(
mptestfix
(
&
q
)
<
0
)
{
f
=
1
;
mpnegfix
(
&
q
);
}
mpmovecfix
(
&
ten
,
10
);
p
=
&
buf
[
sizeof
(
buf
)];
*--
p
=
0
;
for
(;;)
{
mpdivmodfixfix
(
&
q
,
&
r
,
&
q
,
&
ten
);
*--
p
=
mpgetfix
(
&
r
)
+
'0'
;
if
(
mptestfix
(
&
q
)
<=
0
)
break
;
}
if
(
f
)
*--
p
=
'-'
;
return
fmtstrcpy
(
fp
,
p
);
}
src/cmd/gc/subr.c
View file @
2b755564
...
...
@@ -1053,13 +1053,9 @@ Nconv(Fmt *fp)
snprint
(
buf1
,
sizeof
(
buf1
),
"LITERAL-ctype=%d"
,
n
->
val
.
ctype
);
break
;
case
CTINT
:
snprint
(
buf1
,
sizeof
(
buf1
),
"I%lld"
,
mpgetfix
(
n
->
val
.
u
.
xval
));
break
;
case
CTSINT
:
snprint
(
buf1
,
sizeof
(
buf1
),
"S%lld"
,
mpgetfix
(
n
->
val
.
u
.
xval
));
break
;
case
CTUINT
:
snprint
(
buf1
,
sizeof
(
buf1
),
"
U%lld"
,
mpgetfix
(
n
->
val
.
u
.
xval
)
);
snprint
(
buf1
,
sizeof
(
buf1
),
"
I%B"
,
n
->
val
.
u
.
xval
);
break
;
case
CTFLT
:
snprint
(
buf1
,
sizeof
(
buf1
),
"F%g"
,
mpgetflt
(
n
->
val
.
u
.
fval
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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