Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
6ed77bed
Commit
6ed77bed
authored
Feb 16, 2017
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/mpz: Change type of "base" args from mp_uint_t to unsigned int.
parent
eb90edb5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/mpz.c
+4
-4
4 additions, 4 deletions
py/mpz.c
py/mpz.h
+2
-2
2 additions, 2 deletions
py/mpz.h
with
6 additions
and
6 deletions
py/mpz.c
+
4
−
4
View file @
6ed77bed
...
@@ -705,7 +705,7 @@ mpz_t *mpz_from_float(mp_float_t val) {
...
@@ -705,7 +705,7 @@ mpz_t *mpz_from_float(mp_float_t val) {
}
}
#endif
#endif
mpz_t *mpz_from_str(const char *str, size_t len, bool neg,
mp_uint_
t base) {
mpz_t *mpz_from_str(const char *str, size_t len, bool neg,
unsigned in
t base) {
mpz_t *z = mpz_zero();
mpz_t *z = mpz_zero();
mpz_set_from_str(z, str, len, neg, base);
mpz_set_from_str(z, str, len, neg, base);
return z;
return z;
...
@@ -873,7 +873,7 @@ typedef uint32_t mp_float_int_t;
...
@@ -873,7 +873,7 @@ typedef uint32_t mp_float_int_t;
#endif
#endif
// returns number of bytes from str that were processed
// returns number of bytes from str that were processed
size_t
mpz_set_from_str
(
mpz_t
*
z
,
const
char
*
str
,
size_t
len
,
bool
neg
,
mp_uint_
t
base
)
{
size_t
mpz_set_from_str
(
mpz_t
*
z
,
const
char
*
str
,
size_t
len
,
bool
neg
,
unsigned
in
t
base
)
{
assert
(
base
<=
36
);
assert
(
base
<=
36
);
const
char
*
cur
=
str
;
const
char
*
cur
=
str
;
...
@@ -1676,7 +1676,7 @@ mp_float_t mpz_as_float(const mpz_t *i) {
...
@@ -1676,7 +1676,7 @@ mp_float_t mpz_as_float(const mpz_t *i) {
#if 0
#if 0
this function is unused
this function is unused
char *mpz_as_str(const mpz_t *i,
mp_uint_
t base) {
char *mpz_as_str(const mpz_t *i,
unsigned in
t base) {
char *s = m_new(char, mp_int_format_size(mpz_max_num_bits(i), base, NULL, '\0'));
char *s = m_new(char, mp_int_format_size(mpz_max_num_bits(i), base, NULL, '\0'));
mpz_as_str_inpl(i, base, NULL, 'a', '\0', s);
mpz_as_str_inpl(i, base, NULL, 'a', '\0', s);
return s;
return s;
...
@@ -1685,7 +1685,7 @@ char *mpz_as_str(const mpz_t *i, mp_uint_t base) {
...
@@ -1685,7 +1685,7 @@ char *mpz_as_str(const mpz_t *i, mp_uint_t base) {
// assumes enough space as calculated by mp_int_format_size
// assumes enough space as calculated by mp_int_format_size
// returns length of string, not including null byte
// returns length of string, not including null byte
size_t
mpz_as_str_inpl
(
const
mpz_t
*
i
,
mp_uint_
t
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
,
char
*
str
)
{
size_t
mpz_as_str_inpl
(
const
mpz_t
*
i
,
unsigned
in
t
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
,
char
*
str
)
{
if
(
str
==
NULL
)
{
if
(
str
==
NULL
)
{
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
py/mpz.h
+
2
−
2
View file @
6ed77bed
...
@@ -108,7 +108,7 @@ void mpz_set_from_ll(mpz_t *z, long long i, bool is_signed);
...
@@ -108,7 +108,7 @@ void mpz_set_from_ll(mpz_t *z, long long i, bool is_signed);
#if MICROPY_PY_BUILTINS_FLOAT
#if MICROPY_PY_BUILTINS_FLOAT
void
mpz_set_from_float
(
mpz_t
*
z
,
mp_float_t
src
);
void
mpz_set_from_float
(
mpz_t
*
z
,
mp_float_t
src
);
#endif
#endif
size_t
mpz_set_from_str
(
mpz_t
*
z
,
const
char
*
str
,
size_t
len
,
bool
neg
,
mp_uint_
t
base
);
size_t
mpz_set_from_str
(
mpz_t
*
z
,
const
char
*
str
,
size_t
len
,
bool
neg
,
unsigned
in
t
base
);
void
mpz_set_from_bytes
(
mpz_t
*
z
,
bool
big_endian
,
size_t
len
,
const
byte
*
buf
);
void
mpz_set_from_bytes
(
mpz_t
*
z
,
bool
big_endian
,
size_t
len
,
const
byte
*
buf
);
bool
mpz_is_zero
(
const
mpz_t
*
z
);
bool
mpz_is_zero
(
const
mpz_t
*
z
);
...
@@ -137,6 +137,6 @@ void mpz_as_bytes(const mpz_t *z, bool big_endian, size_t len, byte *buf);
...
@@ -137,6 +137,6 @@ void mpz_as_bytes(const mpz_t *z, bool big_endian, size_t len, byte *buf);
#if MICROPY_PY_BUILTINS_FLOAT
#if MICROPY_PY_BUILTINS_FLOAT
mp_float_t
mpz_as_float
(
const
mpz_t
*
z
);
mp_float_t
mpz_as_float
(
const
mpz_t
*
z
);
#endif
#endif
size_t
mpz_as_str_inpl
(
const
mpz_t
*
z
,
mp_uint_
t
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
,
char
*
str
);
size_t
mpz_as_str_inpl
(
const
mpz_t
*
z
,
unsigned
in
t
base
,
const
char
*
prefix
,
char
base_char
,
char
comma
,
char
*
str
);
#endif // __MICROPY_INCLUDED_PY_MPZ_H__
#endif // __MICROPY_INCLUDED_PY_MPZ_H__
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment