summaryrefslogtreecommitdiff
path: root/src/target/target_request.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-16 02:53:57 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-16 09:58:11 -0800
commita94748ec6da9bdc6e25a7f73bbea723b8b55fa33 (patch)
treec6aebc5e8f39d0918f9a88dd43e373ea9d28e210 /src/target/target_request.c
parentf0ce88b3af9a6090ac986160950d66317de5087e (diff)
downloadopenocd+libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.tar.gz
openocd+libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.tar.bz2
openocd+libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.tar.xz
openocd+libswd-a94748ec6da9bdc6e25a7f73bbea723b8b55fa33.zip
rename CEIL as DIV_ROUND_UP
Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
Diffstat (limited to 'src/target/target_request.c')
-rw-r--r--src/target/target_request.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/target/target_request.c b/src/target/target_request.c
index 72151555..be176ca3 100644
--- a/src/target/target_request.c
+++ b/src/target/target_request.c
@@ -40,10 +40,10 @@ static int charmsg_mode = 0;
static int target_asciimsg(struct target *target, uint32_t length)
{
- char *msg = malloc(CEIL(length + 1, 4) * 4);
+ char *msg = malloc(DIV_ROUND_UP(length + 1, 4) * 4);
struct debug_msg_receiver *c = target->dbgmsg;
- target->type->target_request_data(target, CEIL(length, 4), (uint8_t*)msg);
+ target->type->target_request_data(target, DIV_ROUND_UP(length, 4), (uint8_t*)msg);
msg[length] = 0;
LOG_DEBUG("%s", msg);
@@ -66,7 +66,7 @@ static int target_charmsg(struct target *target, uint8_t msg)
static int target_hexmsg(struct target *target, int size, uint32_t length)
{
- uint8_t *data = malloc(CEIL(length * size, 4) * 4);
+ uint8_t *data = malloc(DIV_ROUND_UP(length * size, 4) * 4);
char line[128];
int line_len;
struct debug_msg_receiver *c = target->dbgmsg;
@@ -74,7 +74,7 @@ static int target_hexmsg(struct target *target, int size, uint32_t length)
LOG_DEBUG("size: %i, length: %i", (int)size, (int)length);
- target->type->target_request_data(target, CEIL(length * size, 4), (uint8_t*)data);
+ target->type->target_request_data(target, DIV_ROUND_UP(length * size, 4), (uint8_t*)data);
line_len = 0;
for (i = 0; i < length; i++)