Changeset 49ff5f3 in mainline for boot/generic/src
- Timestamp:
- 2012-04-18T20:55:21Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7769ec9
- Parents:
- e895352 (diff), 63920b0 (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. - Location:
- boot/generic/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/memstr.c
re895352 r49ff5f3 51 51 } 52 52 53 /** Move memory block with possible overlapping. 54 * 55 * Copy cnt bytes from src address to dst address. The source 56 * and destination memory areas may overlap. 57 * 58 * @param dst Destination address to copy to. 59 * @param src Source address to copy from. 60 * @param cnt Number of bytes to copy. 61 * 62 * @return Destination address. 63 * 64 */ 65 void *memmove(void *dst, const void *src, size_t cnt) 66 { 67 /* Nothing to do? */ 68 if (src == dst) 69 return dst; 70 71 /* Non-overlapping? */ 72 if ((dst >= src + cnt) || (src >= dst + cnt)) 73 return memcpy(dst, src, cnt); 74 75 uint8_t *dp; 76 const uint8_t *sp; 77 78 /* Which direction? */ 79 if (src > dst) { 80 /* Forwards. */ 81 dp = dst; 82 sp = src; 83 84 while (cnt-- != 0) 85 *dp++ = *sp++; 86 } else { 87 /* Backwards. */ 88 dp = dst + (cnt - 1); 89 sp = src + (cnt - 1); 90 91 while (cnt-- != 0) 92 *dp-- = *sp--; 93 } 94 95 return dst; 96 } 97 53 98 /** @} 54 99 */ -
boot/generic/src/printf_core.c
re895352 r49ff5f3 210 210 /* Print leading spaces. */ 211 211 size_t strw = str_length(str); 212 if ( precision == 0)212 if ((precision == 0) || (precision > strw)) 213 213 precision = strw; 214 214 -
boot/generic/src/str.c
re895352 r49ff5f3 100 100 #include <str.h> 101 101 #include <errno.h> 102 103 /** Check the condition if wchar_t is signed */ 104 #ifdef WCHAR_IS_UNSIGNED 105 #define WCHAR_SIGNED_CHECK(cond) (true) 106 #else 107 #define WCHAR_SIGNED_CHECK(cond) (cond) 108 #endif 102 109 103 110 /** Byte mask consisting of lowest @n bits (out of 8) */ … … 198 205 * code was invalid. 199 206 */ 200 int chr_encode( wchar_t ch, char *str, size_t *offset, size_t size)207 int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size) 201 208 { 202 209 if (*offset >= size) … … 325 332 bool ascii_check(wchar_t ch) 326 333 { 327 if ( (ch >= 0) && (ch <= 127))334 if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127)) 328 335 return true; 329 336 … … 338 345 bool chr_check(wchar_t ch) 339 346 { 340 if ( (ch >= 0) && (ch <= 1114111))347 if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111)) 341 348 return true; 342 349 -
boot/generic/src/version.c
re895352 r49ff5f3 32 32 33 33 static const char *project = "HelenOS bootloader"; 34 static const char *copyright = "Copyright (c) 2001-2011 HelenOS project";34 static const char *copyright = STRING(COPYRIGHT); 35 35 static const char *release = STRING(RELEASE); 36 36 static const char *name = STRING(NAME);
Note:
See TracChangeset
for help on using the changeset viewer.
