Fix old-style function definitions and enable warning. (#1651)
Function definitions with no parameters should always use the void keyword to allow the compiler to catch invalid calls of those functions at compile time. Enable -Wold-style-definition to catch this early in the future. Fixes #1649. JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
This commit is contained in:
@@ -84,7 +84,7 @@ bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
|
||||
/**
|
||||
* Curie BSP implementation of jerry_port_get_current_time.
|
||||
*/
|
||||
double jerry_port_get_current_time ()
|
||||
double jerry_port_get_current_time (void)
|
||||
{
|
||||
uint32_t uptime_ms = get_uptime_ms ();
|
||||
uint32_t epoch_time = uptime_to_epoch (uptime_ms);
|
||||
|
||||
@@ -50,7 +50,7 @@ bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
|
||||
/**
|
||||
* Default implementation of jerry_port_get_current_time.
|
||||
*/
|
||||
double jerry_port_get_current_time ()
|
||||
double jerry_port_get_current_time (void)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
struct timeval tv;
|
||||
|
||||
@@ -36,7 +36,7 @@ void jerry_port_default_set_abort_on_fail (bool flag) /**< new value of 'abort o
|
||||
* @return true - if 'abort on fail' flag is set,
|
||||
* false - otherwise.
|
||||
*/
|
||||
bool jerry_port_default_is_abort_on_fail ()
|
||||
bool jerry_port_default_is_abort_on_fail (void)
|
||||
{
|
||||
return abort_on_fail;
|
||||
} /* jerry_port_default_is_abort_on_fail */
|
||||
|
||||
@@ -79,7 +79,7 @@ jerry_port_get_time_zone (jerry_time_zone_t *tz_p) /**< timezone pointer */
|
||||
* @return current timer's counter value in microseconds
|
||||
*/
|
||||
double
|
||||
jerry_port_get_current_time ()
|
||||
jerry_port_get_current_time (void)
|
||||
{
|
||||
return (double) us_ticker_read ();
|
||||
} /* jerry_port_get_current_time */
|
||||
|
||||
@@ -93,7 +93,7 @@ jerry_port_get_time_zone (jerry_time_zone_t *tz_p) /**< timezone pointer */
|
||||
* @return current timer's counter value in microseconds
|
||||
*/
|
||||
double
|
||||
jerry_port_get_current_time ()
|
||||
jerry_port_get_current_time (void)
|
||||
{
|
||||
return (double) us_ticker_read ();
|
||||
} /* jerry_port_get_current_time */
|
||||
|
||||
@@ -304,7 +304,7 @@ jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
|
||||
* @return 0
|
||||
*/
|
||||
double
|
||||
jerry_port_get_current_time ()
|
||||
jerry_port_get_current_time (void)
|
||||
{
|
||||
return 0;
|
||||
} /* jerry_port_get_current_time */
|
||||
|
||||
@@ -65,7 +65,7 @@ void jerry_port_fatal (jerry_fatal_code_t code)
|
||||
* @return current timer's counter value in milliseconds
|
||||
*/
|
||||
double
|
||||
jerry_port_get_current_time ()
|
||||
jerry_port_get_current_time (void)
|
||||
{
|
||||
int64_t ms = k_uptime_get();
|
||||
return (double) ms;
|
||||
|
||||
Reference in New Issue
Block a user