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
8152373d
Commit
8152373d
authored
May 10, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2219 from kyab/fix_msvc_warning_time.c
Pacify MSVC warnings for time.c
parents
c302b86f
4a05dce4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
mrbgems/mruby-time/src/time.c
mrbgems/mruby-time/src/time.c
+9
-9
No files found.
mrbgems/mruby-time/src/time.c
View file @
8152373d
...
...
@@ -201,14 +201,14 @@ time_alloc(mrb_state *mrb, double sec, double usec, enum mrb_timezone timezone)
tm
=
(
struct
mrb_time
*
)
mrb_malloc
(
mrb
,
sizeof
(
struct
mrb_time
));
tm
->
sec
=
(
time_t
)
sec
;
tm
->
usec
=
(
sec
-
tm
->
sec
)
*
1.0e6
+
usec
;
tm
->
usec
=
(
time_t
)((
sec
-
tm
->
sec
)
*
1.0e6
+
usec
)
;
while
(
tm
->
usec
<
0
)
{
tm
->
sec
--
;
tm
->
usec
+=
1
.0e6
;
tm
->
usec
+=
1
000000
;
}
while
(
tm
->
usec
>
1
.0e6
)
{
while
(
tm
->
usec
>
1
000000
)
{
tm
->
sec
++
;
tm
->
usec
-=
1
.0e6
;
tm
->
usec
-=
1
000000
;
}
tm
->
timezone
=
timezone
;
mrb_time_update_datetime
(
tm
);
...
...
@@ -301,7 +301,7 @@ time_mktime(mrb_state *mrb, mrb_int ayear, mrb_int amonth, mrb_int aday,
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"Not a valid time."
);
}
return
time_alloc
(
mrb
,
nowsecs
,
ausec
,
timezone
);
return
time_alloc
(
mrb
,
(
double
)
nowsecs
,
ausec
,
timezone
);
}
/* 15.2.19.6.2 */
...
...
@@ -381,7 +381,7 @@ mrb_time_plus(mrb_state *mrb, mrb_value self)
mrb_get_args
(
mrb
,
"f"
,
&
f
);
tm
=
DATA_GET_PTR
(
mrb
,
self
,
&
mrb_time_type
,
struct
mrb_time
);
return
mrb_time_make
(
mrb
,
mrb_obj_class
(
mrb
,
self
),
(
double
)
tm
->
sec
+
f
,
tm
->
usec
,
tm
->
timezone
);
return
mrb_time_make
(
mrb
,
mrb_obj_class
(
mrb
,
self
),
(
double
)
tm
->
sec
+
f
,
(
double
)
tm
->
usec
,
tm
->
timezone
);
}
static
mrb_value
...
...
@@ -402,7 +402,7 @@ mrb_time_minus(mrb_state *mrb, mrb_value self)
}
else
{
mrb_get_args
(
mrb
,
"f"
,
&
f
);
return
mrb_time_make
(
mrb
,
mrb_obj_class
(
mrb
,
self
),
(
double
)
tm
->
sec
-
f
,
tm
->
usec
,
tm
->
timezone
);
return
mrb_time_make
(
mrb
,
mrb_obj_class
(
mrb
,
self
),
(
double
)
tm
->
sec
-
f
,
(
double
)
tm
->
usec
,
tm
->
timezone
);
}
}
...
...
@@ -666,7 +666,7 @@ mrb_time_to_i(mrb_state *mrb, mrb_value self)
struct
mrb_time
*
tm
;
tm
=
DATA_GET_PTR
(
mrb
,
self
,
&
mrb_time_type
,
struct
mrb_time
);
return
mrb_fixnum_value
(
tm
->
sec
);
return
mrb_fixnum_value
(
(
mrb_int
)
tm
->
sec
);
}
/* 15.2.19.7.26 */
...
...
@@ -677,7 +677,7 @@ mrb_time_usec(mrb_state *mrb, mrb_value self)
struct
mrb_time
*
tm
;
tm
=
DATA_GET_PTR
(
mrb
,
self
,
&
mrb_time_type
,
struct
mrb_time
);
return
mrb_fixnum_value
(
tm
->
usec
);
return
mrb_fixnum_value
(
(
mrb_int
)
tm
->
usec
);
}
/* 15.2.19.7.27 */
...
...
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