src/share/vm/runtime/commandLineFlagRangeList.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
8112746_open Cdiff src/share/vm/runtime/commandLineFlagRangeList.cpp
src/share/vm/runtime/commandLineFlagRangeList.cpp
Print this page
*** 30,39 ****
--- 30,48 ----
#include "runtime/commandLineFlagRangeList.hpp"
#include "runtime/os.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/macros.hpp"
+ static void print_range_error_if_needed(bool verbose, const char* msg, ...) {
+ if (verbose) {
+ va_list listPointer;
+ va_start(listPointer, msg);
+ jio_fprintf(defaultStream::error_stream(), msg, listPointer);
+ va_end(listPointer);
+ }
+ }
+
class CommandLineFlagRange_int : public CommandLineFlagRange {
int _min;
int _max;
public:
*** 42,56 ****
_min=min, _max=max;
}
Flag::Error check_int(int value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! if (verbose == true) {
! jio_fprintf(defaultStream::error_stream(),
! "int %s=%d is outside the allowed range [ %d ... %d ]\n",
name(), value, _min, _max);
- }
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
--- 51,62 ----
_min=min, _max=max;
}
Flag::Error check_int(int value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! print_range_error_if_needed(verbose, "int %s=%d is outside the allowed range [ %d ... %d ]\n",
name(), value, _min, _max);
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
*** 70,84 ****
_min=min, _max=max;
}
Flag::Error check_intx(intx value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! if (verbose == true) {
! jio_fprintf(defaultStream::error_stream(),
! "intx %s=" INTX_FORMAT " is outside the allowed range [ " INTX_FORMAT " ... " INTX_FORMAT " ]\n",
name(), value, _min, _max);
- }
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
--- 76,87 ----
_min=min, _max=max;
}
Flag::Error check_intx(intx value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! print_range_error_if_needed(verbose, "intx %s="INTX_FORMAT" is outside the allowed range [ "INTX_FORMAT" ... "INTX_FORMAT" ]\n",
name(), value, _min, _max);
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
*** 98,112 ****
_min=min, _max=max;
}
Flag::Error check_uint(uint value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! if (verbose == true) {
! jio_fprintf(defaultStream::error_stream(),
! "uintx %s=%u is outside the allowed range [ %u ... %u ]\n",
name(), value, _min, _max);
- }
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
--- 101,112 ----
_min=min, _max=max;
}
Flag::Error check_uint(uint value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! print_range_error_if_needed(verbose, "uint %s=%u is outside the allowed range [ %u ... %u ]\n",
name(), value, _min, _max);
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
*** 126,140 ****
_min=min, _max=max;
}
Flag::Error check_uintx(uintx value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! if (verbose == true) {
! jio_fprintf(defaultStream::error_stream(),
! "uintx %s=" UINTX_FORMAT " is outside the allowed range [ " UINTX_FORMAT " ... " UINTX_FORMAT " ]\n",
name(), value, _min, _max);
- }
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
--- 126,137 ----
_min=min, _max=max;
}
Flag::Error check_uintx(uintx value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! print_range_error_if_needed(verbose, "uintx %s="UINTX_FORMAT" is outside the allowed range [ "UINTX_FORMAT" ... "UINTX_FORMAT" ]\n",
name(), value, _min, _max);
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
*** 154,168 ****
_min=min, _max=max;
}
Flag::Error check_uint64_t(uint64_t value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! if (verbose == true) {
! jio_fprintf(defaultStream::error_stream(),
! "uint64_t %s=" UINT64_FORMAT " is outside the allowed range [ " UINT64_FORMAT " ... " UINT64_FORMAT " ]\n",
name(), value, _min, _max);
- }
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
--- 151,162 ----
_min=min, _max=max;
}
Flag::Error check_uint64_t(uint64_t value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! print_range_error_if_needed(verbose, "uint64_t %s="UINT64_FORMAT" is outside the allowed range [ "UINT64_FORMAT" ... "UINT64_FORMAT" ]\n",
name(), value, _min, _max);
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
*** 182,196 ****
_min=min, _max=max;
}
Flag::Error check_size_t(size_t value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! if (verbose == true) {
! jio_fprintf(defaultStream::error_stream(),
! "size_t %s=" SIZE_FORMAT " is outside the allowed range [ " SIZE_FORMAT " ... " SIZE_FORMAT " ]\n",
name(), value, _min, _max);
- }
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
--- 176,187 ----
_min=min, _max=max;
}
Flag::Error check_size_t(size_t value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! print_range_error_if_needed(verbose, "size_t %s="SIZE_FORMAT" is outside the allowed range [ "SIZE_FORMAT" ... "SIZE_FORMAT" ]\n",
name(), value, _min, _max);
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
*** 210,224 ****
_min=min, _max=max;
}
Flag::Error check_double(double value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! if (verbose == true) {
! jio_fprintf(defaultStream::error_stream(),
! "double %s=%f is outside the allowed range [ %f ... %f ]\n",
name(), value, _min, _max);
- }
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
--- 201,212 ----
_min=min, _max=max;
}
Flag::Error check_double(double value, bool verbose = true) {
if ((value < _min) || (value > _max)) {
! print_range_error_if_needed(verbose, "double %s=%f is outside the allowed range [ %f ... %f ]\n",
name(), value, _min, _max);
return Flag::OUT_OF_BOUNDS;
} else {
return Flag::SUCCESS;
}
}
src/share/vm/runtime/commandLineFlagRangeList.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File