From: David B. <dbr...@us...> - 2009-11-16 23:51:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via b6e0f2e1c32930b10403d26d39e71225573bcba9 (commit) from 66300d59661c94bd54a5ff5eff83f20c3217d99d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b6e0f2e1c32930b10403d26d39e71225573bcba9 Author: David Brownell <dbr...@us...> Date: Mon Nov 16 14:50:07 2009 -0800 binarybuffer: regression fix The "improve inline binarybuffer helpers" mis-handled bytes with the high bit set; treat them as unsigned, not signed. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index 460d017..6275eaf 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -41,7 +41,8 @@ static inline void buf_set_u32(void *_buffer, unsigned first, unsigned num, uint32_t value) { - char *buffer = (char *)_buffer; + uint8_t *buffer = (uint8_t *)_buffer; + if ((num == 32) && (first == 0)) { buffer[3] = (value >> 24) & 0xff; buffer[2] = (value >> 16) & 0xff; @@ -69,7 +70,8 @@ static inline void buf_set_u32(void *_buffer, static inline uint32_t buf_get_u32(const void *_buffer, unsigned first, unsigned num) { - char *buffer = (char *)_buffer; + uint8_t *buffer = (uint8_t *)_buffer; + if ((num == 32) && (first == 0)) { return (((uint32_t)buffer[3]) << 24) | (((uint32_t)buffer[2]) << 16) | ----------------------------------------------------------------------- Summary of changes: src/helper/binarybuffer.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |