mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-16 00:19:27 +00:00
8312121: Fix -Wconversion warnings in tribool.hpp
Reviewed-by: dlong, dholmes
This commit is contained in:
parent
a3d67231a7
commit
47c4b992b4
@ -32,6 +32,7 @@
|
||||
#include "c1/c1_Runtime1.hpp"
|
||||
#include "c1/c1_ValueType.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
#include "compiler/compilerDirectives.hpp"
|
||||
#include "interpreter/linkResolver.hpp"
|
||||
#include "jfr/support/jfrIntrinsics.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,7 +26,8 @@
|
||||
#define SHARE_C1_C1_COMPILER_HPP
|
||||
|
||||
#include "compiler/abstractCompiler.hpp"
|
||||
#include "compiler/compilerDirectives.hpp"
|
||||
|
||||
class DirectiveSet;
|
||||
|
||||
// There is one instance of the Compiler per CompilerThread.
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "jvm_constants.h"
|
||||
#include "jvm_io.h"
|
||||
#include "runtime/vm_version.hpp"
|
||||
#include "utilities/tribool.hpp"
|
||||
#include "utilities/xmlstream.hpp"
|
||||
|
||||
// These are flag-matching functions:
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/signature.hpp"
|
||||
#include "utilities/tribool.hpp"
|
||||
#include "utilities/xmlstream.hpp"
|
||||
|
||||
|
||||
|
||||
@ -40,11 +40,15 @@ class TriBool{
|
||||
|
||||
public:
|
||||
TriBool() : _value(0) {}
|
||||
TriBool(bool value) : _value(((u1)value) | 2) {}
|
||||
TriBool(bool value) : _value(value) {
|
||||
// set to not-default in separate step to avoid conversion warnings
|
||||
_value |= 2;
|
||||
}
|
||||
TriBool(const TriBool& o): _value(o._value) {}
|
||||
|
||||
TriBool& operator=(bool value) {
|
||||
_value = ((u1)value) | 2;
|
||||
_value = value;
|
||||
_value |= 2; // set to not-default
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -73,7 +77,8 @@ class TriBoolArray {
|
||||
|
||||
TriBoolAssigner& operator=(bool newval) {
|
||||
_slot ^= ((u1)_value) << _offset; // reset the tribool
|
||||
_value = (u1)newval| 2;
|
||||
_value = newval;
|
||||
_value |= 2; // set to not-default
|
||||
_slot |= ((u1)_value) << _offset;
|
||||
return *this;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user