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
d46ca257
Commit
d46ca257
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
Fix some int casting that failed on 64 bit architecture.
parent
8c2b333a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/sequence.c
+2
-2
2 additions, 2 deletions
py/sequence.c
unix/file.c
+1
-1
1 addition, 1 deletion
unix/file.c
unix/socket.c
+1
-1
1 addition, 1 deletion
unix/socket.c
with
4 additions
and
4 deletions
py/sequence.c
+
2
−
2
View file @
d46ca257
...
...
@@ -155,7 +155,7 @@ mp_obj_t mp_seq_index_obj(const mp_obj_t *items, uint len, uint n_args, const mp
}
}
for
(
uint
i
=
start
;
i
<
stop
;
i
++
)
{
for
(
machine_
uint
_t
i
=
start
;
i
<
stop
;
i
++
)
{
if
(
mp_obj_equal
(
items
[
i
],
value
))
{
// Common sense says this cannot overflow small int
return
MP_OBJ_NEW_SMALL_INT
(
i
);
...
...
@@ -166,7 +166,7 @@ mp_obj_t mp_seq_index_obj(const mp_obj_t *items, uint len, uint n_args, const mp
}
mp_obj_t
mp_seq_count_obj
(
const
mp_obj_t
*
items
,
uint
len
,
mp_obj_t
value
)
{
uint
count
=
0
;
machine_
uint
_t
count
=
0
;
for
(
uint
i
=
0
;
i
<
len
;
i
++
)
{
if
(
mp_obj_equal
(
items
[
i
],
value
))
{
count
++
;
...
...
This diff is collapsed.
Click to expand it.
unix/file.c
+
1
−
1
View file @
d46ca257
...
...
@@ -50,7 +50,7 @@ static MP_DEFINE_CONST_FUN_OBJ_1(fdfile_close_obj, fdfile_close);
static
mp_obj_t
fdfile_fileno
(
mp_obj_t
self_in
)
{
mp_obj_fdfile_t
*
self
=
self_in
;
return
MP_OBJ_NEW_SMALL_INT
(
self
->
fd
);
return
MP_OBJ_NEW_SMALL_INT
(
(
machine_int_t
)
self
->
fd
);
}
static
MP_DEFINE_CONST_FUN_OBJ_1
(
fdfile_fileno_obj
,
fdfile_fileno
);
...
...
This diff is collapsed.
Click to expand it.
unix/socket.c
+
1
−
1
View file @
d46ca257
...
...
@@ -86,7 +86,7 @@ static MP_DEFINE_CONST_FUN_OBJ_1(socket_close_obj, socket_close);
static
mp_obj_t
socket_fileno
(
mp_obj_t
self_in
)
{
mp_obj_socket_t
*
self
=
self_in
;
return
MP_OBJ_NEW_SMALL_INT
(
self
->
fd
);
return
MP_OBJ_NEW_SMALL_INT
(
(
machine_int_t
)
self
->
fd
);
}
static
MP_DEFINE_CONST_FUN_OBJ_1
(
socket_fileno_obj
,
socket_fileno
);
...
...
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