Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b05d3be2
Commit
b05d3be2
authored
Oct 26, 2009
by
Eric Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue removing _PyOS_double_to_string, as mentioned in issue 7117.
parent
cfaf79c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
Modules/cPickle.c
Modules/cPickle.c
+22
-8
No files found.
Modules/cPickle.c
View file @
b05d3be2
...
@@ -1170,15 +1170,29 @@ save_float(Picklerobject *self, PyObject *args)
...
@@ -1170,15 +1170,29 @@ save_float(Picklerobject *self, PyObject *args)
return
-
1
;
return
-
1
;
}
}
else
{
else
{
char
c_str
[
250
];
int
result
=
-
1
;
c_str
[
0
]
=
FLOAT
;
char
*
buf
=
NULL
;
_PyOS_double_to_string
(
c_str
+
1
,
sizeof
(
c_str
)
-
2
,
x
,
'g'
,
char
op
=
FLOAT
;
17
,
0
,
NULL
);
/* Extend the formatted string with a newline character */
strcat
(
c_str
,
"
\n
"
);
if
(
self
->
write_func
(
self
,
c_str
,
strlen
(
c_str
))
<
0
)
if
(
self
->
write_func
(
self
,
&
op
,
1
)
<
0
)
return
-
1
;
goto
done
;
buf
=
PyOS_double_to_string
(
x
,
'g'
,
17
,
0
,
NULL
);
if
(
!
buf
)
{
PyErr_NoMemory
();
goto
done
;
}
if
(
self
->
write_func
(
self
,
buf
,
strlen
(
buf
))
<
0
)
goto
done
;
if
(
self
->
write_func
(
self
,
"
\n
"
,
1
)
<
0
)
goto
done
;
result
=
0
;
done:
PyMem_Free
(
buf
);
return
result
;
}
}
return
0
;
return
0
;
...
...
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