py: Adjust some spaces in code style/format, purely for consistency.

This commit is contained in:
Damien George 2015-04-09 15:29:54 +00:00
parent df1637c580
commit 4dea922610
12 changed files with 47 additions and 52 deletions

View File

@ -646,8 +646,7 @@ void asm_x64_push_local(asm_x64_t *as, int local_num) {
asm_x64_push_disp(as, ASM_X64_REG_RBP, asm_x64_local_offset_from_ebp(as, local_num));
}
void asm_x64_push_local_addr(asm_x64_t *as, int local_num, int temp_r64)
{
void asm_x64_push_local_addr(asm_x64_t *as, int local_num, int temp_r64) {
asm_x64_mov_r64_r64(as, temp_r64, ASM_X64_REG_RBP);
asm_x64_add_i32_to_r32(as, asm_x64_local_offset_from_ebp(as, local_num), temp_r64);
asm_x64_push_r64(as, temp_r64);
@ -657,16 +656,14 @@ void asm_x64_push_local_addr(asm_x64_t *as, int local_num, int temp_r64)
/*
can't use these because code might be relocated when resized
void asm_x64_call(asm_x64_t *as, void* func)
{
void asm_x64_call(asm_x64_t *as, void* func) {
asm_x64_sub_i32_from_r32(as, 8, ASM_X64_REG_RSP);
asm_x64_write_byte_1(as, OPCODE_CALL_REL32);
asm_x64_write_word32(as, func - (void*)(as->code_cur + 4));
asm_x64_mov_r64_r64(as, ASM_X64_REG_RSP, ASM_X64_REG_RBP);
}
void asm_x64_call_i1(asm_x64_t *as, void* func, int i1)
{
void asm_x64_call_i1(asm_x64_t *as, void* func, int i1) {
asm_x64_sub_i32_from_r32(as, 8, ASM_X64_REG_RSP);
asm_x64_sub_i32_from_r32(as, 12, ASM_X64_REG_RSP);
asm_x64_push_i32(as, i1);

View File

@ -1174,8 +1174,7 @@ void mpz_xor_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
/* computes dest = lhs * rhs
can have dest, lhs, rhs the same
*/
void mpz_mul_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs)
{
void mpz_mul_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
if (lhs->len == 0 || rhs->len == 0) {
mpz_set_from_int(dest, 0);
return;

View File

@ -36,7 +36,7 @@ typedef struct _mp_obj_str_t {
const byte *data;
} mp_obj_str_t;
#define MP_DEFINE_STR_OBJ(obj_name, str) mp_obj_str_t obj_name = {{&mp_type_str}, 0, sizeof(str) - 1, (const byte*)str};
#define MP_DEFINE_STR_OBJ(obj_name, str) mp_obj_str_t obj_name = {{&mp_type_str}, 0, sizeof(str) - 1, (const byte*)str}
// use this macro to extract the string hash
#define GET_STR_HASH(str_obj_in, str_hash) \

View File

@ -107,8 +107,7 @@ mp_uint_t utf8_ptr_to_index(const byte *s, const byte *ptr) {
}
// TODO: Rename to str_charlen
mp_uint_t unichar_charlen(const char *str, mp_uint_t len)
{
mp_uint_t unichar_charlen(const char *str, mp_uint_t len) {
#if MICROPY_PY_BUILTINS_STR_UNICODE
mp_uint_t charlen = 0;
for (const char *top = str + len; str < top; ++str) {