Changeset 1433ecda in mainline for uspace/lib/c/generic/mem.c
- Timestamp:
 - 2018-04-04T15:42:37Z (8 years ago)
 - Branches:
 - lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
 - Children:
 - 2c4e1cc
 - Parents:
 - 47b2d7e3
 - File:
 - 
      
- 1 edited
 
- 
          
  uspace/lib/c/generic/mem.c (modified) (6 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/lib/c/generic/mem.c
r47b2d7e3 r1433ecda 54 54 word_size = sizeof(unsigned long); 55 55 fill = word_size - ((uintptr_t) dest & (word_size - 1)); 56 if (fill > n) fill = n; 56 if (fill > n) 57 fill = n; 57 58 58 59 pb = dest; … … 64 65 /* Compute remaining size. */ 65 66 n -= fill; 66 if (n == 0) return dest; 67 if (n == 0) 68 return dest; 67 69 68 70 n_words = n / word_size; … … 93 95 struct along { 94 96 unsigned long n; 95 } __attribute__ ((packed));97 } __attribute__((packed)); 96 98 97 99 static void *unaligned_memcpy(void *dst, const void *src, size_t n) … … 133 135 if (((uintptr_t) dst & (word_size - 1)) != 134 136 ((uintptr_t) src & (word_size - 1))) 135 return unaligned_memcpy(dst, src, n);137 return unaligned_memcpy(dst, src, n); 136 138 137 139 /* … … 143 145 mod = (uintptr_t) dst & (word_size - 1); 144 146 fill = word_size - mod; 145 if (fill > n) fill = n; 147 if (fill > n) 148 fill = n; 146 149 147 150 /* Copy the initial segment. */ … … 157 160 158 161 n -= fill; 159 if (n == 0) return dst; 162 if (n == 0) 163 return dst; 160 164 161 165 /* Pointers to aligned segment. */  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  