target/register: Use 'bool' data type 51/4951/2
authorMarc Schink <openocd-dev@marcschink.de>
Tue, 26 Feb 2019 13:00:30 +0000 (14:00 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 6 Mar 2019 16:09:44 +0000 (16:09 +0000)
Change-Id: I3633ced9cb2bfe6afb0ef49aa42fd1b54f155a66
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4951
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/target/register.c

index 8506414..5352d2f 100644 (file)
@@ -88,8 +88,8 @@ void register_cache_invalidate(struct reg_cache *cache)
        for (unsigned n = cache->num_regs; n != 0; n--, reg++) {
                if (reg->exist == false)
                        continue;
-               reg->valid = 0;
-               reg->dirty = 0;
+               reg->valid = false;
+               reg->dirty = false;
        }
 }
 
@@ -100,8 +100,8 @@ static int register_get_dummy_core_reg(struct reg *reg)
 
 static int register_set_dummy_core_reg(struct reg *reg, uint8_t *buf)
 {
-       reg->dirty = 1;
-       reg->valid = 1;
+       reg->dirty = true;
+       reg->valid = true;
 
        return ERROR_OK;
 }