Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
dc88a87f
Unverified
Commit
dc88a87f
authored
Apr 23, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time.c: `time_t` may be unsigned on some platforms.
parent
1a82bab1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mrbgems/mruby-time/src/time.c
mrbgems/mruby-time/src/time.c
+2
-2
No files found.
mrbgems/mruby-time/src/time.c
View file @
dc88a87f
...
@@ -334,7 +334,7 @@ time_alloc_time(mrb_state *mrb, time_t sec, time_t usec, enum mrb_timezone timez
...
@@ -334,7 +334,7 @@ time_alloc_time(mrb_state *mrb, time_t sec, time_t usec, enum mrb_timezone timez
tm
=
(
struct
mrb_time
*
)
mrb_malloc
(
mrb
,
sizeof
(
struct
mrb_time
));
tm
=
(
struct
mrb_time
*
)
mrb_malloc
(
mrb
,
sizeof
(
struct
mrb_time
));
tm
->
sec
=
sec
;
tm
->
sec
=
sec
;
tm
->
usec
=
usec
;
tm
->
usec
=
usec
;
if
(
tm
->
usec
<
0
)
{
if
(
MRB_TIME_T_UINT
&&
tm
->
usec
<
0
)
{
long
sec2
=
(
long
)
NDIV
(
tm
->
usec
,
1000000
);
/* negative div */
long
sec2
=
(
long
)
NDIV
(
tm
->
usec
,
1000000
);
/* negative div */
tm
->
usec
-=
sec2
*
1000000
;
tm
->
usec
-=
sec2
*
1000000
;
tm
->
sec
+=
sec2
;
tm
->
sec
+=
sec2
;
...
@@ -462,7 +462,7 @@ time_mktime(mrb_state *mrb, mrb_int ayear, mrb_int amonth, mrb_int aday,
...
@@ -462,7 +462,7 @@ time_mktime(mrb_state *mrb, mrb_int ayear, mrb_int amonth, mrb_int aday,
struct
tm
nowtime
=
{
0
};
struct
tm
nowtime
=
{
0
};
#if MRB_INT_MAX > INT_MAX
#if MRB_INT_MAX > INT_MAX
#define OUTINT(x) (
INT_MIN > (x
) || (x) > INT_MAX)
#define OUTINT(x) (
((MRB_TIME_T_UINT ? 0 : INT_MIN) > (x)
) || (x) > INT_MAX)
#else
#else
#define OUTINT(x) 0
#define OUTINT(x) 0
#endif
#endif
...
...
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