Changeset 8565a42 in mainline for boot/generic/src/memstr.c
- Timestamp:
- 2018-03-02T20:34:50Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1a81f69, d5e5fd1
- Parents:
- 3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
- git-committer:
- GitHub <noreply@…> (2018-03-02 20:34:50)
- File:
-
- 1 edited
-
boot/generic/src/memstr.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/memstr.c
r3061bc1 r8565a42 46 46 uint8_t *dp = (uint8_t *) dst; 47 47 const uint8_t *sp = (uint8_t *) src; 48 48 49 49 while (cnt-- != 0) 50 50 *dp++ = *sp++; 51 51 52 52 return dst; 53 53 } … … 67 67 { 68 68 uint8_t *dp = (uint8_t *) dst; 69 69 70 70 while (cnt-- != 0) 71 71 *dp++ = val; 72 72 73 73 return dst; 74 74 } … … 91 91 if (src == dst) 92 92 return dst; 93 93 94 94 /* Non-overlapping? */ 95 95 if ((dst >= src + cnt) || (src >= dst + cnt)) 96 96 return memcpy(dst, src, cnt); 97 97 98 98 uint8_t *dp; 99 99 const uint8_t *sp; 100 100 101 101 /* Which direction? */ 102 102 if (src > dst) { … … 104 104 dp = dst; 105 105 sp = src; 106 106 107 107 while (cnt-- != 0) 108 108 *dp++ = *sp++; … … 111 111 dp = dst + (cnt - 1); 112 112 sp = src + (cnt - 1); 113 113 114 114 while (cnt-- != 0) 115 115 *dp-- = *sp--; 116 116 } 117 117 118 118 return dst; 119 119 }
Note:
See TracChangeset
for help on using the changeset viewer.
