target/mips: Use 'bool' data type
[openocd.git] / src / target / mips32.c
index 9ac2507a3479518f72db6116ce22d69c296731b7..d9d8ba975e163c73b9e2b996ecfd735d163b3816 100644 (file)
@@ -190,8 +190,8 @@ static int mips32_set_core_reg(struct reg *reg, uint8_t *buf)
                return ERROR_TARGET_NOT_HALTED;
 
        buf_set_u32(reg->value, 0, 32, value);
                return ERROR_TARGET_NOT_HALTED;
 
        buf_set_u32(reg->value, 0, 32, value);
-       reg->dirty = 1;
-       reg->valid = 1;
+       reg->dirty = true;
+       reg->valid = true;
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
@@ -208,8 +208,8 @@ static int mips32_read_core_reg(struct target *target, unsigned int num)
 
        reg_value = mips32->core_regs[num];
        buf_set_u32(mips32->core_cache->reg_list[num].value, 0, 32, reg_value);
 
        reg_value = mips32->core_regs[num];
        buf_set_u32(mips32->core_cache->reg_list[num].value, 0, 32, reg_value);
-       mips32->core_cache->reg_list[num].valid = 1;
-       mips32->core_cache->reg_list[num].dirty = 0;
+       mips32->core_cache->reg_list[num].valid = true;
+       mips32->core_cache->reg_list[num].dirty = false;
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
@@ -227,8 +227,8 @@ static int mips32_write_core_reg(struct target *target, unsigned int num)
        reg_value = buf_get_u32(mips32->core_cache->reg_list[num].value, 0, 32);
        mips32->core_regs[num] = reg_value;
        LOG_DEBUG("write core reg %i value 0x%" PRIx32 "", num , reg_value);
        reg_value = buf_get_u32(mips32->core_cache->reg_list[num].value, 0, 32);
        mips32->core_regs[num] = reg_value;
        LOG_DEBUG("write core reg %i value 0x%" PRIx32 "", num , reg_value);
-       mips32->core_cache->reg_list[num].valid = 1;
-       mips32->core_cache->reg_list[num].dirty = 0;
+       mips32->core_cache->reg_list[num].valid = true;
+       mips32->core_cache->reg_list[num].dirty = false;
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
@@ -336,12 +336,12 @@ struct reg_cache *mips32_build_reg_cache(struct target *target)
 
                if (mips32_regs[i].flag == MIPS32_GDB_DUMMY_FP_REG) {
                        reg_list[i].value = mips32_gdb_dummy_fp_value;
 
                if (mips32_regs[i].flag == MIPS32_GDB_DUMMY_FP_REG) {
                        reg_list[i].value = mips32_gdb_dummy_fp_value;
-                       reg_list[i].valid = 1;
+                       reg_list[i].valid = true;
                        reg_list[i].arch_info = NULL;
                        register_init_dummy(&reg_list[i]);
                } else {
                        reg_list[i].value = calloc(1, 4);
                        reg_list[i].arch_info = NULL;
                        register_init_dummy(&reg_list[i]);
                } else {
                        reg_list[i].value = calloc(1, 4);
-                       reg_list[i].valid = 0;
+                       reg_list[i].valid = false;
                        reg_list[i].type = &mips32_reg_type;
                        reg_list[i].arch_info = &arch_info[i];
 
                        reg_list[i].type = &mips32_reg_type;
                        reg_list[i].arch_info = &arch_info[i];
 
@@ -352,7 +352,7 @@ struct reg_cache *mips32_build_reg_cache(struct target *target)
                                LOG_ERROR("unable to allocate reg type list");
                }
 
                                LOG_ERROR("unable to allocate reg type list");
                }
 
-               reg_list[i].dirty = 0;
+               reg_list[i].dirty = false;
 
                reg_list[i].group = mips32_regs[i].group;
                reg_list[i].number = i;
 
                reg_list[i].group = mips32_regs[i].group;
                reg_list[i].number = i;
@@ -532,8 +532,8 @@ int mips32_run_algorithm(struct target *target, int num_mem_params,
                                mips32->core_cache->reg_list[i].name, context[i]);
                        buf_set_u32(mips32->core_cache->reg_list[i].value,
                                        0, 32, context[i]);
                                mips32->core_cache->reg_list[i].name, context[i]);
                        buf_set_u32(mips32->core_cache->reg_list[i].value,
                                        0, 32, context[i]);
-                       mips32->core_cache->reg_list[i].valid = 1;
-                       mips32->core_cache->reg_list[i].dirty = 1;
+                       mips32->core_cache->reg_list[i].valid = true;
+                       mips32->core_cache->reg_list[i].dirty = true;
                }
        }
 
                }
        }
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)