mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-31 03:19:48 +02:00
Update to v099r14 release.
byuu says: Changelog: - (u)int(max,ptr) abbreviations removed; use _t suffix now [didn't feel like they were contributing enough to be worth it] - cleaned up nall::integer,natural,real functionality - toInteger, toNatural, toReal for parsing strings to numbers - fromInteger, fromNatural, fromReal for creating strings from numbers - (string,Markup::Node,SQL-based-classes)::(integer,natural,real) left unchanged - template<typename T> numeral(T value, long padding, char padchar) -> string for print() formatting - deduces integer,natural,real based on T ... cast the value if you want to override - there still exists binary,octal,hex,pointer for explicit print() formatting - lstring -> string_vector [but using lstring = string_vector; is declared] - would be nice to remove the using lstring eventually ... but that'd probably require 10,000 lines of changes >_> - format -> string_format [no using here; format was too ambiguous] - using integer = Integer<sizeof(int)*8>; and using natural = Natural<sizeof(uint)*8>; declared - for consistency with boolean. These three are meant for creating zero-initialized values implicitly (various uses) - R65816::io() -> idle() and SPC700::io() -> idle() [more clear; frees up struct IO {} io; naming] - SFC CPU, PPU, SMP use struct IO {} io; over struct (Status,Registers) {} (status,registers); now - still some CPU::Status status values ... they didn't really fit into IO functionality ... will have to think about this more - SFC CPU, PPU, SMP now use step() exclusively instead of addClocks() calling into step() - SFC CPU joypad1_bits, joypad2_bits were unused; killed them - SFC PPU CGRAM moved into PPU::Screen; since nothing else uses it - SFC PPU OAM moved into PPU::Object; since nothing else uses it - the raw uint8[544] array is gone. OAM::read() constructs values from the OAM::Object[512] table now - this avoids having to determine how we want to sub-divide the two OAM memory sections - this also eliminates the OAM::synchronize() functionality - probably more I'm forgetting The FPS fluctuations are driving me insane. This WIP went from 128fps to 137fps. Settled on 133.5fps for the final build. But nothing I changed should have affected performance at all. This level of fluctuation makes it damn near impossible to know whether I'm speeding things up or slowing things down with changes.
This commit is contained in:
@@ -2,16 +2,20 @@
|
||||
|
||||
namespace nall {
|
||||
|
||||
auto string::integer() const -> intmax {
|
||||
return nall::integer(data());
|
||||
auto string::integer() const -> intmax_t {
|
||||
return toInteger(data());
|
||||
}
|
||||
|
||||
auto string::natural() const -> uintmax {
|
||||
return nall::natural(data());
|
||||
auto string::natural() const -> uintmax_t {
|
||||
return toNatural(data());
|
||||
}
|
||||
|
||||
auto string::hex() const -> uintmax_t {
|
||||
return toHex(data());
|
||||
}
|
||||
|
||||
auto string::real() const -> double {
|
||||
return nall::real(data());
|
||||
return toReal(data());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -33,42 +33,42 @@ template<> struct stringify<char> {
|
||||
//signed integers
|
||||
|
||||
template<> struct stringify<signed char> {
|
||||
stringify(signed char source) { integer(_data, source); }
|
||||
stringify(signed char source) { fromInteger(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[2 + sizeof(signed char) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<signed short> {
|
||||
stringify(signed short source) { integer(_data, source); }
|
||||
stringify(signed short source) { fromInteger(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[2 + sizeof(signed short) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<signed int> {
|
||||
stringify(signed int source) { integer(_data, source); }
|
||||
stringify(signed int source) { fromInteger(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[2 + sizeof(signed int) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<signed long> {
|
||||
stringify(signed long source) { integer(_data, source); }
|
||||
stringify(signed long source) { fromInteger(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[2 + sizeof(signed long) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<signed long long> {
|
||||
stringify(signed long long source) { integer(_data, source); }
|
||||
stringify(signed long long source) { fromInteger(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[2 + sizeof(signed long long) * 3];
|
||||
};
|
||||
|
||||
template<uint Bits> struct stringify<Integer<Bits>> {
|
||||
stringify(Integer<Bits> source) { integer(_data, source); }
|
||||
stringify(Integer<Bits> source) { fromInteger(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[2 + sizeof(int64_t) * 3];
|
||||
@@ -77,42 +77,42 @@ template<uint Bits> struct stringify<Integer<Bits>> {
|
||||
//unsigned integers
|
||||
|
||||
template<> struct stringify<unsigned char> {
|
||||
stringify(unsigned char source) { natural(_data, source); }
|
||||
stringify(unsigned char source) { fromNatural(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[1 + sizeof(unsigned char) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<unsigned short> {
|
||||
stringify(unsigned short source) { natural(_data, source); }
|
||||
stringify(unsigned short source) { fromNatural(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[1 + sizeof(unsigned short) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<unsigned int> {
|
||||
stringify(unsigned int source) { natural(_data, source); }
|
||||
stringify(unsigned int source) { fromNatural(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[1 + sizeof(unsigned int) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<unsigned long> {
|
||||
stringify(unsigned long source) { natural(_data, source); }
|
||||
stringify(unsigned long source) { fromNatural(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[1 + sizeof(unsigned long) * 3];
|
||||
};
|
||||
|
||||
template<> struct stringify<unsigned long long> {
|
||||
stringify(unsigned long long source) { natural(_data, source); }
|
||||
stringify(unsigned long long source) { fromNatural(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[1 + sizeof(unsigned long long) * 3];
|
||||
};
|
||||
|
||||
template<uint Bits> struct stringify<Natural<Bits>> {
|
||||
stringify(Natural<Bits> source) { natural(_data, source); }
|
||||
stringify(Natural<Bits> source) { fromNatural(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[1 + sizeof(uint64_t) * 3];
|
||||
@@ -121,28 +121,28 @@ template<uint Bits> struct stringify<Natural<Bits>> {
|
||||
//floating-point
|
||||
|
||||
template<> struct stringify<float> {
|
||||
stringify(float source) { real(_data, source); }
|
||||
stringify(float source) { fromReal(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[256];
|
||||
};
|
||||
|
||||
template<> struct stringify<double> {
|
||||
stringify(double source) { real(_data, source); }
|
||||
stringify(double source) { fromReal(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[256];
|
||||
};
|
||||
|
||||
template<> struct stringify<long double> {
|
||||
stringify(long double source) { real(_data, source); }
|
||||
stringify(long double source) { fromReal(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[256];
|
||||
};
|
||||
|
||||
template<uint Bits> struct stringify<Real<Bits>> {
|
||||
stringify(Real<Bits> source) { real(_data, source); }
|
||||
stringify(Real<Bits> source) { fromReal(_data, source); }
|
||||
auto data() const -> const char* { return _data; }
|
||||
auto size() const -> uint { return strlen(_data); }
|
||||
char _data[256];
|
||||
|
@@ -30,7 +30,7 @@ template<typename T, typename... P> auto string::append(const T& value, P&&... p
|
||||
return append(forward<P>(p)...);
|
||||
}
|
||||
|
||||
template<typename... P> auto string::append(const nall::format& value, P&&... p) -> string& {
|
||||
template<typename... P> auto string::append(const nall::string_format& value, P&&... p) -> string& {
|
||||
format(value);
|
||||
return append(forward<P>(p)...);
|
||||
}
|
||||
|
@@ -6,9 +6,9 @@ auto string::date(time_t timestamp) -> string {
|
||||
if(timestamp == 0) timestamp = ::time(nullptr);
|
||||
tm* info = localtime(×tamp);
|
||||
return {
|
||||
nall::natural(1900 + info->tm_year, 4L), "-",
|
||||
nall::natural(1 + info->tm_mon, 2L), "-",
|
||||
nall::natural(info->tm_mday, 2L)
|
||||
numeral(1900 + info->tm_year, 4L), "-",
|
||||
numeral(1 + info->tm_mon, 2L), "-",
|
||||
numeral(info->tm_mday, 2L)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ auto string::time(time_t timestamp) -> string {
|
||||
if(timestamp == 0) timestamp = ::time(nullptr);
|
||||
tm* info = localtime(×tamp);
|
||||
return {
|
||||
nall::natural(info->tm_hour, 2L), ":",
|
||||
nall::natural(info->tm_min, 2L), ":",
|
||||
nall::natural(info->tm_sec, 2L)
|
||||
numeral(info->tm_hour, 2L), ":",
|
||||
numeral(info->tm_min, 2L), ":",
|
||||
numeral(info->tm_sec, 2L)
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -37,7 +37,7 @@ inline auto evaluateExpression(Node* node) -> string {
|
||||
}
|
||||
|
||||
inline auto evaluateInteger(Node* node) -> int64_t {
|
||||
if(node->type == Node::Type::Literal) return nall::integer(node->literal);
|
||||
if(node->type == Node::Type::Literal) return toInteger(node->literal);
|
||||
|
||||
#define p(n) evaluateInteger(node->link[n])
|
||||
switch(node->type) {
|
||||
@@ -99,7 +99,7 @@ inline auto integer(const string& expression) -> maybe<int64_t> {
|
||||
}
|
||||
|
||||
inline auto evaluateReal(Node* node) -> long double {
|
||||
if(node->type == Node::Type::Literal) return nall::real(node->literal);
|
||||
if(node->type == Node::Type::Literal) return toReal(node->literal);
|
||||
|
||||
#define p(n) evaluateReal(node->link[n])
|
||||
switch(node->type) {
|
||||
|
@@ -5,7 +5,7 @@ namespace nall {
|
||||
//nall::format is a vector<string> of parameters that can be applied to a string
|
||||
//each {#} token will be replaced with its appropriate format parameter
|
||||
|
||||
auto string::format(const nall::format& params) -> type& {
|
||||
auto string::format(const nall::string_format& params) -> type& {
|
||||
auto size = (int)this->size();
|
||||
auto data = (char*)memory::allocate(size);
|
||||
memory::copy(data, this->data(), size);
|
||||
@@ -32,7 +32,7 @@ auto string::format(const nall::format& params) -> type& {
|
||||
};
|
||||
if(!isNumeric(&data[x + 1], &data[y - 1])) { x++; continue; }
|
||||
|
||||
uint index = nall::natural(&data[x + 1]);
|
||||
uint index = toNatural(&data[x + 1]);
|
||||
if(index >= params.size()) { x++; continue; }
|
||||
|
||||
uint sourceSize = y - x;
|
||||
@@ -59,12 +59,12 @@ auto string::format(const nall::format& params) -> type& {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T, typename... P> auto format::append(const T& value, P&&... p) -> format& {
|
||||
template<typename T, typename... P> auto string_format::append(const T& value, P&&... p) -> string_format& {
|
||||
vector<string>::append(value);
|
||||
return append(forward<P>(p)...);
|
||||
}
|
||||
|
||||
auto format::append() -> format& {
|
||||
auto string_format::append() -> string_format& {
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -78,9 +78,10 @@ template<typename... P> auto print(FILE* fp, P&&... p) -> void {
|
||||
fwrite(s.data(), 1, s.size(), fp);
|
||||
}
|
||||
|
||||
auto integer(intmax value, long precision, char padchar) -> string {
|
||||
/*
|
||||
auto integer(intmax_t value, long precision, char padchar) -> string {
|
||||
string buffer;
|
||||
buffer.resize(1 + sizeof(intmax) * 3);
|
||||
buffer.resize(1 + sizeof(intmax_t) * 3);
|
||||
char* p = buffer.get();
|
||||
|
||||
bool negative = value < 0;
|
||||
@@ -97,9 +98,9 @@ auto integer(intmax value, long precision, char padchar) -> string {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
auto natural(uintmax value, long precision, char padchar) -> string {
|
||||
auto natural(uintmax_t value, long precision, char padchar) -> string {
|
||||
string buffer;
|
||||
buffer.resize(sizeof(uintmax) * 3);
|
||||
buffer.resize(sizeof(uintmax_t) * 3);
|
||||
char* p = buffer.get();
|
||||
|
||||
uint size = 0;
|
||||
@@ -112,10 +113,17 @@ auto natural(uintmax value, long precision, char padchar) -> string {
|
||||
if(precision) buffer.size(precision, padchar);
|
||||
return buffer;
|
||||
}
|
||||
*/
|
||||
|
||||
auto hex(uintmax value, long precision, char padchar) -> string {
|
||||
template<typename T> auto numeral(T value, long precision, char padchar) -> string {
|
||||
string buffer{value};
|
||||
if(precision) buffer.size(precision, padchar);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
auto hex(uintmax_t value, long precision, char padchar) -> string {
|
||||
string buffer;
|
||||
buffer.resize(sizeof(uintmax) * 2);
|
||||
buffer.resize(sizeof(uintmax_t) * 2);
|
||||
char* p = buffer.get();
|
||||
|
||||
uint size = 0;
|
||||
@@ -130,9 +138,9 @@ auto hex(uintmax value, long precision, char padchar) -> string {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
auto octal(uintmax value, long precision, char padchar) -> string {
|
||||
auto octal(uintmax_t value, long precision, char padchar) -> string {
|
||||
string buffer;
|
||||
buffer.resize(sizeof(uintmax) * 3);
|
||||
buffer.resize(sizeof(uintmax_t) * 3);
|
||||
char* p = buffer.get();
|
||||
|
||||
uint size = 0;
|
||||
@@ -146,9 +154,9 @@ auto octal(uintmax value, long precision, char padchar) -> string {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
auto binary(uintmax value, long precision, char padchar) -> string {
|
||||
auto binary(uintmax_t value, long precision, char padchar) -> string {
|
||||
string buffer;
|
||||
buffer.resize(sizeof(uintmax) * 8);
|
||||
buffer.resize(sizeof(uintmax_t) * 8);
|
||||
char* p = buffer.get();
|
||||
|
||||
uint size = 0;
|
||||
@@ -164,19 +172,21 @@ auto binary(uintmax value, long precision, char padchar) -> string {
|
||||
|
||||
template<typename T> auto pointer(const T* value, long precision) -> string {
|
||||
if(value == nullptr) return "(nullptr)";
|
||||
return {"0x", hex((uintptr)value, precision)};
|
||||
return {"0x", hex((uintptr_t)value, precision)};
|
||||
}
|
||||
|
||||
auto pointer(uintptr value, long precision) -> string {
|
||||
auto pointer(uintptr_t value, long precision) -> string {
|
||||
if(value == 0) return "(nullptr)";
|
||||
return {"0x", hex(value, precision)};
|
||||
}
|
||||
|
||||
/*
|
||||
auto real(long double value) -> string {
|
||||
string temp;
|
||||
temp.resize(real(nullptr, value));
|
||||
real(temp.get(), value);
|
||||
temp.resize(fromReal(nullptr, value));
|
||||
fromReal(temp.get(), value);
|
||||
return temp;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace nall {
|
||||
|
||||
auto lstring::operator==(const lstring& source) const -> bool {
|
||||
auto string_vector::operator==(const string_vector& source) const -> bool {
|
||||
if(this == &source) return true;
|
||||
if(size() != source.size()) return false;
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
@@ -11,50 +11,50 @@ auto lstring::operator==(const lstring& source) const -> bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto lstring::operator!=(const lstring& source) const -> bool {
|
||||
auto string_vector::operator!=(const string_vector& source) const -> bool {
|
||||
return !operator==(source);
|
||||
}
|
||||
|
||||
auto lstring::isort() -> lstring& {
|
||||
auto string_vector::isort() -> type& {
|
||||
sort([](const string& x, const string& y) {
|
||||
return memory::icompare(x.data(), x.size(), y.data(), y.size()) < 0;
|
||||
});
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename... P> auto lstring::append(const string& data, P&&... p) -> lstring& {
|
||||
template<typename... P> auto string_vector::append(const string& data, P&&... p) -> type& {
|
||||
vector::append(data);
|
||||
append(forward<P>(p)...);
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto lstring::append() -> lstring& {
|
||||
auto string_vector::append() -> type& {
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto lstring::find(string_view source) const -> maybe<uint> {
|
||||
auto string_vector::find(string_view source) const -> maybe<uint> {
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
if(operator[](n).equals(source)) return n;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
auto lstring::ifind(string_view source) const -> maybe<uint> {
|
||||
auto string_vector::ifind(string_view source) const -> maybe<uint> {
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
if(operator[](n).iequals(source)) return n;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
auto lstring::match(string_view pattern) const -> lstring {
|
||||
lstring result;
|
||||
auto string_vector::match(string_view pattern) const -> type {
|
||||
string_vector result;
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
if(operator[](n).match(pattern)) result.append(operator[](n));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
auto lstring::merge(string_view separator) const -> string {
|
||||
auto string_vector::merge(string_view separator) const -> string {
|
||||
string output;
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
output.append(operator[](n));
|
||||
@@ -63,7 +63,7 @@ auto lstring::merge(string_view separator) const -> string {
|
||||
return output;
|
||||
}
|
||||
|
||||
auto lstring::strip() -> lstring& {
|
||||
auto string_vector::strip() -> type& {
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
operator[](n).strip();
|
||||
}
|
||||
|
@@ -59,8 +59,8 @@ struct Node {
|
||||
|
||||
auto text() const -> string { return value().strip(); }
|
||||
auto boolean() const -> bool { return text() == "true"; }
|
||||
auto integer() const -> intmax { return text().integer(); }
|
||||
auto natural() const -> uintmax { return text().natural(); }
|
||||
auto integer() const -> intmax_t { return text().integer(); }
|
||||
auto natural() const -> uintmax_t { return text().natural(); }
|
||||
auto real() const -> double { return text().real(); }
|
||||
|
||||
auto setName(const string& name = "") -> Node& { shared->_name = name; return *this; }
|
||||
|
@@ -68,7 +68,7 @@ auto tokenize(const char* s, const char* p) -> bool {
|
||||
return !*p;
|
||||
}
|
||||
|
||||
auto tokenize(lstring& list, const char* s, const char* p) -> bool {
|
||||
auto tokenize(string_vector& list, const char* s, const char* p) -> bool {
|
||||
while(*s) {
|
||||
if(*p == '*') {
|
||||
const char* b = s;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace nall {
|
||||
|
||||
template<bool Insensitive, bool Quoted>
|
||||
auto lstring::_split(string_view source, string_view find, long limit) -> lstring& {
|
||||
auto string_vector::_split(string_view source, string_view find, long limit) -> string_vector& {
|
||||
reset();
|
||||
if(limit <= 0 || find.size() == 0) return *this;
|
||||
|
||||
@@ -33,9 +33,9 @@ auto lstring::_split(string_view source, string_view find, long limit) -> lstrin
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto string::split(string_view on, long limit) const -> lstring { return lstring()._split<0, 0>(*this, on, limit); }
|
||||
auto string::isplit(string_view on, long limit) const -> lstring { return lstring()._split<1, 0>(*this, on, limit); }
|
||||
auto string::qsplit(string_view on, long limit) const -> lstring { return lstring()._split<0, 1>(*this, on, limit); }
|
||||
auto string::iqsplit(string_view on, long limit) const -> lstring { return lstring()._split<1, 1>(*this, on, limit); }
|
||||
auto string::split(string_view on, long limit) const -> string_vector { return string_vector()._split<0, 0>(*this, on, limit); }
|
||||
auto string::isplit(string_view on, long limit) const -> string_vector { return string_vector()._split<1, 0>(*this, on, limit); }
|
||||
auto string::qsplit(string_view on, long limit) const -> string_vector { return string_vector()._split<0, 1>(*this, on, limit); }
|
||||
auto string::iqsplit(string_view on, long limit) const -> string_vector { return string_vector()._split<1, 1>(*this, on, limit); }
|
||||
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ auto slice(string_view self, int offset, int length) -> string {
|
||||
return result;
|
||||
}
|
||||
|
||||
auto integer(char* result, intmax value) -> char* {
|
||||
auto fromInteger(char* result, intmax_t value) -> char* {
|
||||
bool negative = value < 0;
|
||||
if(negative) value = -value;
|
||||
|
||||
@@ -111,7 +111,7 @@ auto integer(char* result, intmax value) -> char* {
|
||||
return result;
|
||||
}
|
||||
|
||||
auto natural(char* result, uintmax value) -> char* {
|
||||
auto fromNatural(char* result, uintmax_t value) -> char* {
|
||||
char buffer[64];
|
||||
uint size = 0;
|
||||
|
||||
@@ -129,7 +129,7 @@ auto natural(char* result, uintmax value) -> char* {
|
||||
//using sprintf is certainly not the most ideal method to convert
|
||||
//a double to a string ... but attempting to parse a double by
|
||||
//hand, digit-by-digit, results in subtle rounding errors.
|
||||
auto real(char* result, long double value) -> uint {
|
||||
auto fromReal(char* result, long double value) -> uint {
|
||||
char buffer[256];
|
||||
#ifdef _WIN32
|
||||
//Windows C-runtime does not support long double via sprintf()
|
||||
|
Reference in New Issue
Block a user