Recover the exact error-buffer publication shape, preserve Berth declaration formatting, admit the 10/10 translation unit, and retire only the stale _error compiler-tie park.
Byte-exact, all four functions, whole object. Source was a pure skeleton with
no code; status MISSING work now NonMatching -> Matching.
An iterative quicksort for 2-byte and 4-byte elements with a 30-deep bounds
stack and a selection-sort cutoff at 8. The two code_* symbols are the
selection sorts and take hi in EAX under VC7's custom convention for statics.
The comparator takes values, not pointers, and the zero-extension in the target
pins the 2-byte element type to word rather than short.
Five source-shape findings, each read off the disassembly:
- the swap loads both elements then stores to *best first, which is
temp = *best; *best = *hi; *hi = temp - the mirror of the natural form. That
alone made both selection sorts exact.
- element_count and size are unsigned: the target uses jb, ja and shr where
signed types give jl, jg and sar.
- the source writes lo+1 < j, not the algebraically identical lo < j-1, which
reverses the lea and cmp operands.
- the larger-partition test compares raw byte differences. On word pointers
every element-count form makes MSVC emit two sars or cancel them and mask,
costing 16 bytes; only an explicit byte-basis comparison gives the plain dec.
j-1-lo >= hi-i, j-lo > hi-i and the byte form are integer-identical and only
the last matches.
- depth = 0 is assigned before hi; the reverse order swaps the two stores.
Both qsort bodies went exact from the same five fixes, which is good evidence
the shapes are right rather than coincidental.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* work on breakable_surfaces.c
* squashme asdf
* word
* more
* Correctness changes
Move types definitions to where we know they are, fix includes and formatting, fix bad defines
* Missed this include
* Scoped if
* More
* MAXIMUM_NUMBER_OF_MATERIAL_TYPES
* Enum correctness
---------
Co-authored-by: punpckhdq <121350336+punpckhdq@users.noreply.github.com>
* wip objects.c work
* objects_disconnect_from_structure_bsp
* match more functions
* more objects work
* objects_update work
- 93.42% matching
* match matrix4x3_transform_point
* more objects work
- fix duplicate symbol name at 1870800
* match object_choose_random_change_colors
* match object_update
* objects_garbage_collection work
* match object_set_position
* more object work
* match objects_update
* more object work
* match object_select_random_region_permutations_by_variant
* objects_in_sphere work
99.90% match
* object name list calls
* match objects_in_sphere
* misc matches
* match structure_bsp_definitions object
* match objects_in_clusters_by_indices
* more object work
* match `edit_text_handle_key`
* mark edit_text as matching
* misc changes
- match get_next_character
- match data section in objects.c
* object_export_function_values work
* match object_compute_function_values
* match object_get_orientation
* added functions and adjust formatting
* fix profile macros
* formatting changes
* more formatting
* more formatting
---------
Co-authored-by: punpckhdq <121350336+punpckhdq@users.noreply.github.com>
* various cseries functions
* Match most of cseries
Formatting and correctness
* csstrlen returns unsigned long
---------
Co-authored-by: punpckhdq <121350336+punpckhdq@users.noreply.github.com>
* misc changes and additions
formatting changes and add structs/constants for terminal work
* match write_to_error_file and add error_global_data
* console work
* requested changes
* terminal work
100% match all terminal functions
* Formatting
---------
Co-authored-by: punpckhdq <121350336+punpckhdq@users.noreply.github.com>
* debug_keys work
* requested changes
* prototypes and mark debug_keys as matching
* Formatting
---------
Co-authored-by: punpckhdq <121350336+punpckhdq@users.noreply.github.com>