diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-23 22:42:03 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-23 22:42:03 +0000 |
commit | 3813fda44adcea486b7308423a699f63d79273ee (patch) | |
tree | f515b454cfaea4806d0d307c1d19f1e3081482d1 /src/target/image.c | |
parent | aea6815462d3302f7f8b6576f59320d5f5985642 (diff) | |
download | riscv-openocd-3813fda44adcea486b7308423a699f63d79273ee.zip riscv-openocd-3813fda44adcea486b7308423a699f63d79273ee.tar.gz riscv-openocd-3813fda44adcea486b7308423a699f63d79273ee.tar.bz2 |
- Fixes '==' whitespace
- Replace ')\(==\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/image.c')
-rw-r--r-- | src/target/image.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/target/image.c b/src/target/image.c index 2ce03b8..d8c0cfc 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -34,11 +34,11 @@ /* convert ELF header field to host endianness */ #define field16(elf,field)\ - ((elf->endianness==ELFDATA2LSB)? \ + ((elf->endianness == ELFDATA2LSB)? \ le_to_h_u16((uint8_t*)&field):be_to_h_u16((uint8_t*)&field)) #define field32(elf,field)\ - ((elf->endianness==ELFDATA2LSB)? \ + ((elf->endianness == ELFDATA2LSB)? \ le_to_h_u32((uint8_t*)&field):be_to_h_u32((uint8_t*)&field)) static int autodetect_image_type(image_t *image, char *url) @@ -55,7 +55,7 @@ static int autodetect_image_type(image_t *image, char *url) } retval = fileio_read(&fileio, 9, buffer, &read_bytes); - if (retval==ERROR_OK) + if (retval == ERROR_OK) { if (read_bytes != 9) { @@ -68,7 +68,7 @@ static int autodetect_image_type(image_t *image, char *url) return retval; /* check header against known signatures */ - if (strncmp((char*)buffer,ELFMAG,SELFMAG)==0) + if (strncmp((char*)buffer,ELFMAG,SELFMAG) == 0) { LOG_DEBUG("ELF image detected."); image->type = IMAGE_ELF; @@ -382,7 +382,7 @@ static int image_elf_read_headers(image_t *image) } elf->segment_count = field16(elf,elf->header->e_phnum); - if (elf->segment_count==0) + if (elf->segment_count == 0) { LOG_ERROR("invalid ELF file, no program headers"); return ERROR_IMAGE_FORMAT_ERROR; |