(ctx context.Context, what string)
| 280 | } |
| 281 | |
| 282 | func (tmplContext *BulkTemplateContext) binExtractInt40(ctx context.Context, what string) (value int64) { |
| 283 | bin, success := tmplContext.binExtract(ctx, what, 5) |
| 284 | if !success { |
| 285 | return |
| 286 | } |
| 287 | // Sign extend from 40 bits |
| 288 | value = int64(bin[0]) |
| 289 | value = value | (int64(bin[1]) << 8) |
| 290 | value = value | (int64(bin[2]) << 16) |
| 291 | value = value | (int64(bin[3]) << 24) |
| 292 | value = value | (int64(int8(bin[4])) << 32) // Sign extend from byte 4 |
| 293 | return value |
| 294 | } |
| 295 | |
| 296 | func (tmplContext *BulkTemplateContext) binExtractUint40(ctx context.Context, what string) (value uint64) { |
| 297 | bin, success := tmplContext.binExtract(ctx, what, 5) |
no test coverage detected