/haiku/src/add-ons/kernel/network/protocols/ipv6/ |
H A D | ipv6_utils.h | 25 uint32 sum = 0; in compute_wordsum() local 28 sum += *buffer++; in compute_wordsum() 32 return sum; in compute_wordsum() 42 uint32 sum = checksum; in ipv6_checksum() local 47 sum += compute_wordsum((uint8*)source, sizeof(in6_addr)); in ipv6_checksum() 48 sum += compute_wordsum((uint8*)destination, sizeof(in6_addr)); in ipv6_checksum() 49 sum += compute_wordsum((uint8*)&length, sizeof(uint16)); in ipv6_checksum() 50 sum += compute_wordsum((uint8*)&protocol, sizeof(uint16)); in ipv6_checksum() 52 while (sum >> 16) in ipv6_checksum() 53 sum = (sum & 0xffff) + (sum >> 16); in ipv6_checksum() [all …]
|
/haiku/src/bin/network/ping/ |
H A D | utils.c | 46 int nleft, sum; in in_cksum() local 55 sum = 0; in in_cksum() 67 sum += data; in in_cksum() 76 sum += last.us; in in_cksum() 80 sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ in in_cksum() 81 sum += (sum >> 16); /* add carry */ in in_cksum() 82 answer = ~sum; /* truncate to 16 bits */ in in_cksum()
|
/haiku/src/libs/mapm/ |
H A D | mapmrsin.c | 65 M_APM sum, term, tmp2, tmp7, tmp8; in M_raw_sin() local 69 sum = M_get_stack_var(); in M_raw_sin() 75 m_apm_copy(sum, xx); in M_raw_sin() 105 m_apm_subtract(tmp7, sum, term); in M_raw_sin() 106 m_apm_copy(sum, tmp7); in M_raw_sin() 110 m_apm_add(tmp7, sum, term); in M_raw_sin() 111 m_apm_copy(sum, tmp7); in M_raw_sin() 118 m_apm_round(rr, places, sum); in M_raw_sin() 129 M_APM sum, term, tmp7, tmp8, tmp9; in M_raw_cos() local 133 sum = M_get_stack_var(); in M_raw_cos() [all …]
|
H A D | mapm_cpi.c | 112 M_APM tmp1, tmp2, a0, b0, c0, a1, b1, sum, pow_2; in M_calculate_PI_AGM() local 122 sum = M_get_stack_var(); in M_calculate_PI_AGM() 128 m_apm_copy(sum, MM_One); in M_calculate_PI_AGM() 153 m_apm_subtract(tmp1, sum, tmp2); in M_calculate_PI_AGM() 154 m_apm_round(sum, dplaces, tmp1); in M_calculate_PI_AGM() 168 m_apm_divide(tmp1, dplaces, tmp2, sum); in M_calculate_PI_AGM()
|
H A D | mapm_lg3.c | 165 M_APM tmp1, tmp2, tmp3, tmp4, tmpC2, sum, pow_2, tmpA0, tmpB0; in M_log_AGM_R_func() local 175 sum = M_get_stack_var(); in M_log_AGM_R_func() 188 m_apm_multiply(sum, MM_0_5, tmp3); in M_log_AGM_R_func() 212 m_apm_add(tmp3, sum, tmp1); in M_log_AGM_R_func() 218 m_apm_round(sum, dplaces, tmp3); in M_log_AGM_R_func()
|
/haiku/src/tools/fixup_amiga_boot_checksum/ |
H A D | fixup_amiga_boot_checksum.c | 13 uint32_t sum; in main() local 29 for (sum = 0, i = 0; i < (BB_SIZE)/sizeof(uint32_t); i++) { in main() 30 uint32_t old = sum; in main() 32 sum += ntohl(*p++); in main() 34 if (sum < old) in main() 35 sum++; in main() 37 sum = ~sum; in main() 40 ((uint32_t *)bootblock)[1] = htonl(sum); in main()
|
/haiku/src/kits/interface/layouter/ |
H A D | ComplexLayouter.cpp | 347 SumItem& sum = sums[i + 1]; in Layout() local 348 TRACE("[%ld] minc = %4ld, maxc = %4ld\n", i + 1, sum.min, sum.max); in Layout() 472 SumItem& sum = fSums[i + 1]; in _AddOptimizerConstraints() local 478 int32 baseMax = sum.max - constraint->min; in _AddOptimizerConstraints() 479 bool minRedundant = (sumMin < sum.min && baseMax > base.max); in _AddOptimizerConstraints() 482 int32 baseMin = sum.min - constraint->effectiveMax; in _AddOptimizerConstraints() 483 bool maxRedundant = (sumMax > sum.max && baseMin < base.min); in _AddOptimizerConstraints() 593 SumItem& sum = fSums[i + 1]; in _ValidateLayout() local 594 sum.min = 0; in _ValidateLayout() 595 sum.max = maxSum += fUnlimited; in _ValidateLayout() [all …]
|
H A D | LayoutOptimizer.cpp | 148 double sum = 0; in multiply_matrix_vector() local 150 sum += A[i][k] * x[k]; in multiply_matrix_vector() 151 y[i] = sum; in multiply_matrix_vector() 165 double sum = 0; in multiply_matrices() local 167 sum += a[i][k] * b[k][j]; in multiply_matrices() 168 c[i][j] = sum; in multiply_matrices() 310 double sum = b[i]; in solve() local 312 sum -= a[index][j] * b[j]; in solve() 314 b[i] = sum / a[index][i]; in solve() 442 double sum = 0; in qr_decomposition() local [all …]
|
/haiku/src/bin/pc/ |
H A D | pc.c | 448 ULONG val, sum = 0; in logical_or_expr() local 452 sum = logical_and_expr(str); in logical_or_expr() 461 sum = (val || sum); in logical_or_expr() 464 return sum; in logical_or_expr() 472 ULONG val, sum = 0; in logical_and_expr() local 476 sum = or_expr(str); in logical_and_expr() 485 sum = (val && sum); in logical_and_expr() 488 return sum; in logical_and_expr() 495 ULONG val, sum = 0; in or_expr() local 499 sum = xor_expr(str); in or_expr() [all …]
|
/haiku/src/system/kernel/debug/ |
H A D | gdb.cpp | 89 int sum; in gdb_reply() local 98 sum = 0; in gdb_reply() 100 sum += sReply[i]; in gdb_reply() 102 sum %= 256; in gdb_reply() 104 sprintf(sReply + len, "#%02x", sum); in gdb_reply() 127 int sum = 0; in gdb_regreply() local 129 sum += sReply[i]; in gdb_regreply() 130 sum %= 256; in gdb_regreply() 134 "#%02x", sum); in gdb_regreply() 149 int sum; in gdb_memreply() local [all …]
|
/haiku/src/libs/agg/src/ |
H A D | agg_image_filters.cpp | 57 int sum = 0; in normalize() local 61 sum += m_weight_array[j * image_subpixel_scale + i]; in normalize() 64 if(sum == image_filter_scale) break; in normalize() 66 double k = double(image_filter_scale) / double(sum); in normalize() 67 sum = 0; in normalize() 70 sum += m_weight_array[j * image_subpixel_scale + i] = in normalize() 74 sum -= image_filter_scale; in normalize() 75 int inc = (sum > 0) ? -1 : 1; in normalize() 77 for(j = 0; j < m_diameter && sum; j++) in normalize() 85 sum += inc; in normalize()
|
/haiku/src/tools/fixup_next_boot_floppy/ |
H A D | fixup_next_boot_floppy.c | 30 uint32_t sum = 0; in checksum_16() local 32 sum += B2H16(*p++); in checksum_16() 34 sum = (sum & 0x0ffff) + (sum >> 16); in checksum_16() 35 if (sum > 65535) in checksum_16() 36 sum -= 65535; in checksum_16() 37 return sum; in checksum_16() 44 uint16_t sum; in main() local 118 sum = checksum_16((uint16_t *)&disklabel, SUM_CNT); in main() 119 fprintf(stderr, "checksum: 0x%04x\n", sum); in main() 120 disklabel.dl_un.DL_v3_checksum = H2B16(sum); in main()
|
/haiku/src/tools/fixup_tos_boot_checksum/ |
H A D | fixup_tos_boot_checksum.c | 11 uint16_t sum; in main() local 21 for (sum = 0, i = 0; i < (512-2)/2; i++) { in main() 25 sum += v; in main() 27 sum = 0x1234 - sum /*+ 1*/; in main() 30 *p++ = (uint8_t)(sum >> 8); in main() 31 *p++ = (uint8_t)sum; in main()
|
/haiku/src/system/libroot/posix/musl/math/ |
H A D | fmal.c | 84 struct dd sum; in add_adjusted() local 87 sum = dd_add(a, b); in add_adjusted() 88 if (sum.lo != 0) { in add_adjusted() 89 u.f = sum.hi; in add_adjusted() 91 sum.hi = nextafterl(sum.hi, INFINITY * sum.lo); in add_adjusted() 93 return (sum.hi); in add_adjusted() 103 struct dd sum; in add_and_denormalize() local 107 sum = dd_add(a, b); in add_and_denormalize() 119 if (sum.lo != 0) { in add_and_denormalize() 120 u.f = sum.hi; in add_and_denormalize() [all …]
|
/haiku/src/tests/system/network/icmp/ |
H A D | big_datagram.cpp | 37 u_int32_t sum; in cksum() local 38 for (sum = 0; nwords > 0; nwords--) in cksum() 39 sum += *(buf++); in cksum() 40 sum = (sum >> 16) + (sum & 0xffff); in cksum() 41 sum += (sum >> 16); in cksum() 42 return ~sum; in cksum()
|
/haiku/src/add-ons/kernel/drivers/network/wlan/atheroswifi/dev/ath/ath_hal/ |
H A D | ah_eeprom_v1.c | 29 uint32_t sum; in v1EepromGet() local 36 sum = 0; in v1EepromGet() 45 sum += eeval; in v1EepromGet() 49 if (sum == 0 || sum == 0xffff*3) { in v1EepromGet() 116 uint32_t sum; in ath_hal_v1EepromAttach() local 159 sum = 0; in ath_hal_v1EepromAttach() 163 sum ^= athvals[i]; in ath_hal_v1EepromAttach() 165 if (sum != 0xffff) { in ath_hal_v1EepromAttach() 167 __func__, sum); in ath_hal_v1EepromAttach()
|
H A D | ah_eeprom_v4k.c | 36 uint32_t sum; in v4kEepromGet() local 45 sum = 0; in v4kEepromGet() 49 sum += pBase->macAddr[i]; in v4kEepromGet() 51 if (sum == 0 || sum == 0xffff*3) { in v4kEepromGet() 287 uint32_t sum; in ath_hal_v4kEepromAttach() local 356 sum = 0; in ath_hal_v4kEepromAttach() 358 sum ^= eep_data[w]; in ath_hal_v4kEepromAttach() 361 if (sum != 0xffff) { in ath_hal_v4kEepromAttach() 363 "Bad EEPROM checksum 0x%x (Len=%u)\n", sum, len); in ath_hal_v4kEepromAttach()
|
H A D | ah_eeprom_9287.c | 35 uint32_t sum; in v9287EepromGet() local 44 sum = 0; in v9287EepromGet() 48 sum += pBase->macAddr[i]; in v9287EepromGet() 50 if (sum == 0 || sum == 0xffff*3) { in v9287EepromGet() 297 uint32_t sum; in ath_hal_9287EepromAttach() local 367 sum = 0; in ath_hal_9287EepromAttach() 369 sum ^= eep_data[w]; in ath_hal_9287EepromAttach() 371 if (sum != 0xffff) { in ath_hal_9287EepromAttach() 373 "Bad EEPROM checksum 0x%x (Len=%u)\n", sum, len); in ath_hal_9287EepromAttach()
|
H A D | ah_eeprom_v14.c | 34 uint32_t sum; in v14EepromGet() local 46 sum = 0; in v14EepromGet() 50 sum += pBase->macAddr[i]; in v14EepromGet() 52 if (sum == 0 || sum == 0xffff*3) { in v14EepromGet() 340 uint32_t sum; in ath_hal_v14EepromAttach() local 407 sum = 0; in ath_hal_v14EepromAttach() 409 sum ^= eep_data[w]; in ath_hal_v14EepromAttach() 411 if (sum != 0xffff) { in ath_hal_v14EepromAttach() 413 "Bad EEPROM checksum 0x%x (Len=%u)\n", sum, len); in ath_hal_v14EepromAttach()
|
/haiku/src/add-ons/kernel/drivers/network/wlan/realtekwifi/dev/rtwn/usb/ |
H A D | rtwn_usb_reg.h | 23 uint16_t sum = 0; in rtwn_usb_calc_tx_checksum() local 28 sum ^= ((uint16_t *)buf)[i]; in rtwn_usb_calc_tx_checksum() 30 return (sum); /* NB: already little endian. */ in rtwn_usb_calc_tx_checksum()
|
/haiku/headers/private/kernel/arch/riscv64/ |
H A D | arch_cpu.h | 22 SetBitsSstatus(SstatusReg{.sum = 1}.val); in arch_cpu_enable_user_access() 29 ClearBitsSstatus(SstatusReg{.sum = 1}.val); in arch_cpu_disable_user_access()
|
/haiku/src/apps/mediaplayer/support/ |
H A D | StackBlurFilter.cpp | 441 unsigned sum; in _Filter8() local 466 sum = sum_in = sum_out = 0; in _Filter8() 473 sum += pix * (i + 1); in _Filter8() 481 sum += pix * (rx + 1 - i); in _Filter8() 492 *dst_pix_ptr = (sum * mul_sum) >> shr_sum; in _Filter8() 495 sum -= sum_out; in _Filter8() 511 sum += sum_in; in _Filter8() 534 sum = sum_in = sum_out = 0; in _Filter8() 541 sum += pix * (i + 1); in _Filter8() 549 sum += pix * (ry + 1 - i); in _Filter8() [all …]
|
/haiku/src/libs/linprog/ |
H A D | LayoutOptimizer.cpp | 162 double sum = 0; in multiply_matrix_vector() local 164 sum += A[i][k] * x[k]; in multiply_matrix_vector() 165 y[i] = sum; in multiply_matrix_vector() 179 double sum = 0; in multiply_matrices() local 181 sum += a[i][k] * b[k][j]; in multiply_matrices() 182 c[i][j] = sum; in multiply_matrices() 285 double sum = b[i]; in solve() local 287 sum -= a[index][j] * b[j]; in solve() 291 b[i] = sum / a[index][i]; in solve() 420 double sum = 0; in qr_decomposition() local [all …]
|
/haiku/src/tests/system/libroot/posix/ |
H A D | memalign_test.cpp | 16 sum(addr_t address) in sum() function 26 *((uint8 *)address + i) = sum((addr_t)address + i); in write_test_pattern() 34 if (*((uint8 *)address + i) != sum((addr_t)address + i)) { in verify_test_pattern() 37 sum((addr_t)address + i)); in verify_test_pattern()
|
/haiku/src/add-ons/kernel/network/stack/ |
H A D | utility.cpp | 105 uint32 sum = 0; in compute_checksum() local 110 sum += *buffer++; in compute_checksum() 117 sum += *(uint8*)buffer; in compute_checksum() 122 sum += *(uint16*)ordered; in compute_checksum() 126 while (sum >> 16) { in compute_checksum() 127 sum = (sum & 0xffff) + (sum >> 16); in compute_checksum() 130 return sum; in compute_checksum()
|