Page MenuHomePhabricator

[64-bit ints] Move `{Add,Sub}Int63Overflow(Emulated)` impl to cpp file
ClosedPublic

Authored by tobias_ruck on Oct 25 2024, 07:48.

Details

Summary

Currently, importing these generates a lot of warning: unused function, so we move the impl to their own cpp files, and turn intmath.h into just a normal header file without impl.

Test Plan

ninja check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested changes to this revision.Oct 25 2024, 12:37
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/script/intmath.cpp
1 ↗(On Diff #50425)

Macro whatyearisit:

4 ↗(On Diff #50425)

nope

10 ↗(On Diff #50425)

move it first:

#include <script/intmath.h>

#include <cstdlib>
#include <limits>
26 ↗(On Diff #50425)

This probably never worked to begin with, because you're missing the config include snippet:

#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
60 ↗(On Diff #50425)

dito

src/script/intmath.h
7 ↗(On Diff #50425)

I don't think you need this one, but you might want cstdint

This revision now requires changes to proceed.Oct 25 2024, 12:37
This revision is now accepted and ready to land.Thu, Dec 5, 10:09