Commit e05f8c7
committed
use FPC LEtoN/BEtoN intrinsics for wire-to-native reads
Replace the hand-rolled {$IFDEF HASHLIB_LITTLE_ENDIAN} branches in the six
private read-side helpers with FPC's dedicated, self-endian-aware RTL
intrinsics:
LeToNativeUInt16/32/64 -> LEtoN
BeToNativeUInt16/32/64 -> BEtoN
The intrinsic is used on FPC; Delphi keeps the existing fallback verbatim
via {$ELSE}. Generated little-endian code is unchanged (LEtoN/BEtoN are the
identity on LE hosts, a bswap on BE) -- this is an idiomatic/clarity change
that drops these functions' reliance on the HASHLIB_LITTLE_ENDIAN define and
defers the endianness decision to the RTL. All Read* overloads route through
these helpers, so the whole read path is covered transitively.1 parent ba4d0a9 commit e05f8c7
1 file changed
Lines changed: 42 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
| 148 | + | |
| 149 | + | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | | - | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
157 | | - | |
158 | | - | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
160 | 167 | | |
161 | | - | |
| 168 | + | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
166 | | - | |
167 | | - | |
| 174 | + | |
| 175 | + | |
168 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
169 | 180 | | |
170 | | - | |
| 181 | + | |
| 182 | + | |
171 | 183 | | |
172 | 184 | | |
173 | 185 | | |
174 | 186 | | |
175 | | - | |
176 | | - | |
| 187 | + | |
| 188 | + | |
177 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
178 | 193 | | |
179 | | - | |
| 194 | + | |
| 195 | + | |
180 | 196 | | |
181 | 197 | | |
182 | 198 | | |
183 | 199 | | |
184 | | - | |
185 | | - | |
| 200 | + | |
| 201 | + | |
186 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
187 | 206 | | |
188 | | - | |
| 207 | + | |
| 208 | + | |
189 | 209 | | |
190 | 210 | | |
191 | 211 | | |
192 | 212 | | |
193 | | - | |
194 | | - | |
| 213 | + | |
| 214 | + | |
195 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
196 | 219 | | |
197 | | - | |
| 220 | + | |
| 221 | + | |
198 | 222 | | |
199 | 223 | | |
200 | 224 | | |
| |||
0 commit comments