Changeset 44ecf89 in mainline
- Timestamp:
- 2013-05-18T21:11:29Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- acdb5bac
- Parents:
- eef14771
- Location:
- uspace
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cmp/cmp.c
reef14771 r44ecf89 107 107 108 108 if (offset[0] != offset[1] || 109 bcmp(buffer[0], buffer[1], offset[0])) {109 memcmp(buffer[0], buffer[1], offset[0]) != 0) { 110 110 rc = 1; 111 111 goto end; -
uspace/lib/bithenge/src/blob.c
reef14771 r44ecf89 477 477 if (rc != EOK) 478 478 return rc; 479 if (size_a != size_b || bcmp(buffer_a, buffer_b, size_a)) {479 if (size_a != size_b || memcmp(buffer_a, buffer_b, size_a) != 0) { 480 480 *out = false; 481 481 return EOK; -
uspace/lib/c/generic/mem.c
reef14771 r44ecf89 224 224 * @param s1 Pointer to the first area to compare. 225 225 * @param s2 Pointer to the second area to compare. 226 * @param len Size of the first area in bytes. Both areas must have227 * the same length.228 * 229 * @return If len is 0, return zero. If the areas match, return230 * zero. Otherwise return non-zero.231 * 232 */ 233 int bcmp(const void *s1, const void *s2, size_t len)226 * @param len Size of the areas in bytes. 227 * 228 * @return Zero if areas have the same contents. If they differ, 229 * the sign of the result is the same as the sign of the 230 * difference of the first pair of different bytes. 231 * 232 */ 233 int memcmp(const void *s1, const void *s2, size_t len) 234 234 { 235 235 uint8_t *u1 = (uint8_t *) s1; 236 236 uint8_t *u2 = (uint8_t *) s2; 237 238 for (; (len != 0) && (*u1++ == *u2++); len--); 239 240 return len; 237 size_t i; 238 239 for (i = 0; i < len; i++) { 240 if (*u1 != *u2) 241 return (int)(*u1) - (int)(*u2); 242 ++u1; 243 ++u2; 244 } 245 246 return 0; 241 247 } 242 248 -
uspace/lib/c/include/mem.h
reef14771 r44ecf89 45 45 __attribute__ ((optimize("-fno-tree-loop-distribute-patterns"))); 46 46 extern void *memmove(void *, const void *, size_t); 47 48 extern int bcmp(const void *, const void *, size_t); 47 extern int memcmp(const void *, const void *, size_t); 49 48 50 49 #endif -
uspace/lib/ext4/libext4_directory.c
reef14771 r44ecf89 725 725 name_len) { 726 726 /* Compare names */ 727 if ( bcmp((uint8_t *) name, dentry->name, name_len) == 0) {727 if (memcmp((uint8_t *) name, dentry->name, name_len) == 0) { 728 728 *res_entry = dentry; 729 729 return EOK; -
uspace/lib/nic/src/nic_addr_db.c
reef14771 r44ecf89 70 70 nic_addr_entry_t *entry = member_to_inst(item, nic_addr_entry_t, link); 71 71 72 return 0 == bcmp(entry->addr, key->addr, entry->len);72 return memcmp(entry->addr, key->addr, entry->len) == 0; 73 73 } 74 74 -
uspace/lib/posix/source/strings.c
reef14771 r44ecf89 131 131 int posix_bcmp(const void *mem1, const void *mem2, size_t n) 132 132 { 133 return bcmp(mem1, mem2, n);133 return memcmp(mem1, mem2, n); 134 134 } 135 135 -
uspace/srv/fs/cdfs/cdfs_ops.c
reef14771 r44ecf89 660 660 */ 661 661 if ((vol_desc->type != VOL_DESC_PRIMARY) || 662 ( bcmp(vol_desc->standard_ident, CDFS_STANDARD_IDENT, 5) != 0) ||662 (memcmp(vol_desc->standard_ident, CDFS_STANDARD_IDENT, 5) != 0) || 663 663 (vol_desc->version != 1)) { 664 664 block_put(block); -
uspace/srv/fs/fat/fat_directory.c
reef14771 r44ecf89 516 516 return false; 517 517 case FAT_DENTRY_VALID: 518 if ( bcmp(de->name, d->name,519 FAT_NAME_LEN + FAT_EXT_LEN) ==0)518 if (memcmp(de->name, d->name, 519 FAT_NAME_LEN + FAT_EXT_LEN) == 0) 520 520 return true; 521 521 break; -
uspace/srv/fs/fat/fat_ops.c
reef14771 r44ecf89 651 651 d = (fat_dentry_t *) b->data; 652 652 if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) || 653 ( bcmp(d->name, FAT_NAME_DOT, FAT_NAME_LEN)) == 0) {653 (memcmp(d->name, FAT_NAME_DOT, FAT_NAME_LEN)) == 0) { 654 654 memset(d, 0, sizeof(fat_dentry_t)); 655 655 memcpy(d->name, FAT_NAME_DOT, FAT_NAME_LEN); … … 661 661 d++; 662 662 if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) || 663 ( bcmp(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN) == 0)) {663 (memcmp(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN) == 0)) { 664 664 memset(d, 0, sizeof(fat_dentry_t)); 665 665 memcpy(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN); … … 1042 1042 info = (fat32_fsinfo_t *) b->data; 1043 1043 1044 if ( bcmp(info->sig1, FAT32_FSINFO_SIG1, sizeof(info->sig1))||1045 bcmp(info->sig2, FAT32_FSINFO_SIG2, sizeof(info->sig2))||1046 bcmp(info->sig3, FAT32_FSINFO_SIG3, sizeof(info->sig3))) {1044 if (memcmp(info->sig1, FAT32_FSINFO_SIG1, sizeof(info->sig1)) != 0 || 1045 memcmp(info->sig2, FAT32_FSINFO_SIG2, sizeof(info->sig2)) != 0 || 1046 memcmp(info->sig3, FAT32_FSINFO_SIG3, sizeof(info->sig3)) != 0) { 1047 1047 (void) block_put(b); 1048 1048 return EINVAL; -
uspace/srv/fs/mfs/mfs_dentry.c
reef14771 r44ecf89 178 178 179 179 if (name_len == d_name_len && 180 !bcmp(d_info.d_name, d_name, name_len)) {180 memcmp(d_info.d_name, d_name, name_len) == 0) { 181 181 182 182 d_info.d_inum = 0; -
uspace/srv/fs/mfs/mfs_ops.c
reef14771 r44ecf89 452 452 453 453 if (comp_size == dentry_name_size && 454 !bcmp(component, d_info.d_name, dentry_name_size)) {454 memcmp(component, d_info.d_name, dentry_name_size) == 0) { 455 455 /* Hit! */ 456 456 mfs_node_core_get(rfn, mnode->instance, -
uspace/srv/fs/udf/udf_volume.c
reef14771 r44ecf89 262 262 * and Descriptor char set field. 263 263 */ 264 if (( bcmp((uint8_t *) pvd[i].volume_id,264 if ((memcmp((uint8_t *) pvd[i].volume_id, 265 265 (uint8_t *) desc->volume_id, 32) == 0) && 266 ( bcmp((uint8_t *) pvd[i].volume_set_id,266 (memcmp((uint8_t *) pvd[i].volume_set_id, 267 267 (uint8_t *) desc->volume_set_id, 128) == 0) && 268 ( bcmp((uint8_t *) &pvd[i].descriptor_charset,268 (memcmp((uint8_t *) &pvd[i].descriptor_charset, 269 269 (uint8_t *) &desc->descriptor_charset, 64) == 0) && 270 270 (FLE32(desc->sequence_number) > FLE32(pvd[i].sequence_number))) { … … 301 301 * Logic Volume Identifier and Descriptor char set field. 302 302 */ 303 if (( bcmp((uint8_t *) lvd[i].logical_volume_id,303 if ((memcmp((uint8_t *) lvd[i].logical_volume_id, 304 304 (uint8_t *) desc->logical_volume_id, 128) == 0) && 305 ( bcmp((uint8_t *) &lvd[i].charset,305 (memcmp((uint8_t *) &lvd[i].charset, 306 306 (uint8_t *) &desc->charset, 64) == 0) && 307 307 (FLE32(desc->sequence_number) > FLE32(lvd[i].sequence_number))) {
Note:
See TracChangeset
for help on using the changeset viewer.