Add new coding style rules and fix appeared issues.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-05-12 19:17:07 +03:00
parent ca12c16607
commit 9763a93df3
89 changed files with 1152 additions and 626 deletions
+22 -22
View File
@@ -131,14 +131,14 @@ libc_printf_uint_to_string (uintmax_t value, /**< integer value */
char *str_p = str_buffer_end;
*--str_p = '\0';
LIBC_ASSERT(radix >= 2);
LIBC_ASSERT (radix >= 2);
if ((radix & (radix - 1)) != 0)
{
/*
* Radix is not power of 2. Only 32-bit numbers are supported in this mode.
*/
LIBC_ASSERT((value >> 32) == 0);
LIBC_ASSERT ((value >> 32) == 0);
uint32_t value_lo = (uint32_t) value;
@@ -157,7 +157,7 @@ libc_printf_uint_to_string (uintmax_t value, /**< integer value */
{
shift++;
LIBC_ASSERT(shift <= 32);
LIBC_ASSERT (shift <= 32);
}
uint32_t value_lo = (uint32_t) value;
@@ -180,7 +180,7 @@ libc_printf_uint_to_string (uintmax_t value, /**< integer value */
*--str_p = '0';
}
LIBC_ASSERT(str_p >= buffer_p && str_p < str_buffer_end);
LIBC_ASSERT (str_p >= buffer_p && str_p < str_buffer_end);
return str_p;
} /* libc_printf_uint_to_string */
@@ -197,7 +197,7 @@ libc_printf_write_d_i (FILE *stream, /**< stream pointer */
libc_printf_arg_length_type_t length, /**< field's length type */
uint32_t width) /**< minimum field width to output */
{
LIBC_ASSERT((flags & LIBC_PRINTF_ARG_FLAG_SHARP) == 0);
LIBC_ASSERT ((flags & LIBC_PRINTF_ARG_FLAG_SHARP) == 0);
bool is_signed = true;
uintmax_t value = 0;
@@ -261,7 +261,7 @@ libc_printf_write_d_i (FILE *stream, /**< stream pointer */
case LIBC_PRINTF_ARG_LENGTH_TYPE_HIGHL:
{
LIBC_UNREACHABLE();
LIBC_UNREACHABLE ();
}
}
@@ -312,12 +312,12 @@ libc_printf_write_d_i (FILE *stream, /**< stream pointer */
* @return updated va_list
*/
static void
libc_printf_write_u_o_x_X(FILE *stream, /**< stream pointer */
char specifier, /**< specifier (u, o, x, X) */
va_list* args_list_p, /**< args' list */
libc_printf_arg_flags_mask_t flags, /**< field's flags */
libc_printf_arg_length_type_t length, /**< field's length type */
uint32_t width) /**< minimum field width to output */
libc_printf_write_u_o_x_X (FILE *stream, /**< stream pointer */
char specifier, /**< specifier (u, o, x, X) */
va_list* args_list_p, /**< args' list */
libc_printf_arg_flags_mask_t flags, /**< field's flags */
libc_printf_arg_length_type_t length, /**< field's length type */
uint32_t width) /**< minimum field width to output */
{
uintmax_t value = 0;
@@ -373,7 +373,7 @@ libc_printf_write_u_o_x_X(FILE *stream, /**< stream pointer */
case LIBC_PRINTF_ARG_LENGTH_TYPE_HIGHL:
{
LIBC_UNREACHABLE();
LIBC_UNREACHABLE ();
}
}
@@ -393,7 +393,7 @@ libc_printf_write_u_o_x_X(FILE *stream, /**< stream pointer */
}
else
{
LIBC_ASSERT(specifier == 'o');
LIBC_ASSERT (specifier == 'o');
}
}
}
@@ -433,7 +433,7 @@ libc_printf_write_u_o_x_X(FILE *stream, /**< stream pointer */
default:
{
LIBC_UNREACHABLE();
LIBC_UNREACHABLE ();
}
}
@@ -627,7 +627,7 @@ vfprintf (FILE *stream, /**< stream pointer */
case 'x':
case 'X':
{
libc_printf_write_u_o_x_X(stream, *format_iter_p, &args_copy, flags, length, width);
libc_printf_write_u_o_x_X (stream, *format_iter_p, &args_copy, flags, length, width);
break;
}
@@ -702,12 +702,12 @@ vfprintf (FILE *stream, /**< stream pointer */
}
else
{
libc_printf_write_u_o_x_X(stream,
'x',
&args_copy,
flags | LIBC_PRINTF_ARG_FLAG_SHARP,
LIBC_PRINTF_ARG_LENGTH_TYPE_Z,
width);
libc_printf_write_u_o_x_X (stream,
'x',
&args_copy,
flags | LIBC_PRINTF_ARG_FLAG_SHARP,
LIBC_PRINTF_ARG_LENGTH_TYPE_Z,
width);
}
break;
}
+7 -7
View File
@@ -31,7 +31,7 @@ FILE *stdin = (FILE*) 0;
FILE *stdout = (FILE*) 1;
FILE *stderr = (FILE*) 2;
LIBC_UNREACHABLE_STUB_FOR(void abort (void))
LIBC_UNREACHABLE_STUB_FOR (void abort (void))
#ifdef __GNUC__
/*
@@ -42,10 +42,10 @@ LIBC_UNREACHABLE_STUB_FOR(void abort (void))
*/
#define CALL_PRAGMA(x) _Pragma (#x)
CALL_PRAGMA(GCC diagnostic push)
CALL_PRAGMA(GCC diagnostic ignored "-Wpragmas")
CALL_PRAGMA(GCC push_options)
CALL_PRAGMA(GCC optimize ("-fno-tree-loop-distribute-patterns"))
CALL_PRAGMA (GCC diagnostic push)
CALL_PRAGMA (GCC diagnostic ignored "-Wpragmas")
CALL_PRAGMA (GCC push_options)
CALL_PRAGMA (GCC optimize ("-fno-tree-loop-distribute-patterns"))
#endif /* __GNUC__ */
/**
@@ -146,8 +146,8 @@ memmove (void *s1, /**< destination */
} /* memmove */
#ifdef __GNUC__
CALL_PRAGMA(GCC pop_options)
CALL_PRAGMA(GCC diagnostic pop)
CALL_PRAGMA (GCC pop_options)
CALL_PRAGMA (GCC diagnostic pop)
#endif /* __GNUC__ */
/** Compare two strings. return an integer less than, equal to, or greater than zero
+9 -9
View File
@@ -40,7 +40,7 @@
#endif /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */
#include "jerry-libc-defs.h"
LIBC_UNREACHABLE_STUB_FOR(int raise (int sig_no __attr_unused___))
LIBC_UNREACHABLE_STUB_FOR (int raise (int sig_no __attr_unused___))
/**
* Exit program with ERR_SYSCALL if syscall_ret_val is negative
@@ -70,7 +70,7 @@ syscall_1 (long int syscall_no, /**< syscall number */
{
long int ret = syscall_1_asm (syscall_no, arg1);
LIBC_EXIT_ON_ERROR(ret);
LIBC_EXIT_ON_ERROR (ret);
return ret;
} /* syscall_1 */
@@ -87,7 +87,7 @@ syscall_2 (long int syscall_no, /**< syscall number */
{
long int ret = syscall_2_asm (syscall_no, arg1, arg2);
LIBC_EXIT_ON_ERROR(ret);
LIBC_EXIT_ON_ERROR (ret);
return ret;
} /* syscall_2 */
@@ -105,7 +105,7 @@ syscall_3 (long int syscall_no, /**< syscall number */
{
long int ret = syscall_3_asm (syscall_no, arg1, arg2, arg3);
LIBC_EXIT_ON_ERROR(ret);
LIBC_EXIT_ON_ERROR (ret);
return ret;
} /* syscall_3 */
@@ -169,8 +169,8 @@ fopen (const char *path, /**< file path */
bool create_if_not_exist = false;
bool position_at_end = false;
LIBC_ASSERT(path != NULL && mode != NULL);
LIBC_ASSERT(mode[1] == '+' || mode[1] == '\0');
LIBC_ASSERT (path != NULL && mode != NULL);
LIBC_ASSERT (mode[1] == '+' || mode[1] == '\0');
switch (mode[0])
{
@@ -196,13 +196,13 @@ fopen (const char *path, /**< file path */
if (mode[1] == '+')
{
/* Not supported */
LIBC_UNREACHABLE();
LIBC_UNREACHABLE ();
}
break;
}
default:
{
LIBC_UNREACHABLE();
LIBC_UNREACHABLE ();
}
}
@@ -218,7 +218,7 @@ fopen (const char *path, /**< file path */
}
else
{
LIBC_ASSERT(may_read && may_write);
LIBC_ASSERT (may_read && may_write);
flags = O_RDWR;
}