amos 9d633e9e67 Batch 15 (20261023-C-hwe-scale-15): 320 HWE-derived repair tasks
One user-space repair task per eligible HWE debug-diag / compile-deploy base
ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content
filter. Each ships a public spec with a check-to-basis table, at least two
defects with single-fix fixtures, a symptom-masking fixture and an alternative
correct implementation. Claude re-checked all 320: structure, the HWE quality
items and trace6 Docker calibration receipts against current digests
(320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120
ad-hoc family names; the next batch maps them to the canonical list.
The batch's 1,256-line progress log stays in its factory report and the
36-local branch batch15-hwe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:55:56 +08:00

39 lines
1.1 KiB
C

#include "descriptor.h"
uint32_t wire_u32(const unsigned char *bytes) {
uint32_t value = 0;
unsigned index;
for (index = 0; index < 4; ++index) {
value |= (uint32_t)bytes[index] << (8 * index);
}
return value;
}
uint64_t wire_u64(const unsigned char *bytes) {
uint64_t value = 0;
unsigned index;
for (index = 0; index < 8; ++index) {
value |= (uint64_t)bytes[index] << (8 * index);
}
return value;
}
void wire_put32(unsigned char *bytes, uint32_t value) {
unsigned index;
for (index = 0; index < 4; ++index) {
bytes[index] = (unsigned char)(value >> (8 * index));
}
}
void wire_put64(unsigned char *bytes, uint64_t value) {
unsigned index;
for (index = 0; index < 8; ++index) {
bytes[index] = (unsigned char)(value >> (8 * index));
}
}
uint32_t descriptor_checksum(const unsigned char *bytes, size_t length) {
uint32_t value = UINT32_C(2166136261);
size_t index;
for (index = 0; index < length; ++index) {
value ^= bytes[index];
value *= UINT32_C(16777619);
}
return value;
}