This is an automated email from the ASF dual-hosted git repository.
gangwu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push:
new c05df7533 ORC-1461: Mark `Int128::getHighBits()` and
`Int128::getLowBits()` as `const`
c05df7533 is described below
commit c05df7533c9811afce101058ac1bef1092a85823
Author: Valentin Lorentz <[email protected]>
AuthorDate: Fri Jul 7 13:04:01 2023 +0800
ORC-1461: Mark `Int128::getHighBits()` and `Int128::getLowBits()` as `const`
### What changes were proposed in this pull request?
These two accessors do not mutate the state, so they can be tagged as
`const` to indicate this into callers.
### Why are the changes needed?
Same motivation as #1558: I am writing a Rust binding, and the methods not
being `const` give me extra constraints.
### How was this patch tested?
`make test` passes.
Closes #1560 from progval/int128-const-accessors.
Authored-by: Valentin Lorentz <[email protected]>
Signed-off-by: Gang Wu <[email protected]>
---
c++/include/orc/Int128.hh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/c++/include/orc/Int128.hh b/c++/include/orc/Int128.hh
index 81cee0538..7c88e49c8 100644
--- a/c++/include/orc/Int128.hh
+++ b/c++/include/orc/Int128.hh
@@ -325,14 +325,14 @@ namespace orc {
/**
* Get the high bits of the twos complement representation of the number.
*/
- int64_t getHighBits() {
+ int64_t getHighBits() const {
return highbits;
}
/**
* Get the low bits of the twos complement representation of the number.
*/
- uint64_t getLowBits() {
+ uint64_t getLowBits() const {
return lowbits;
}