mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-29 21:20:23 +02:00
Update to v098r10 release.
byuu says: Changelog: - synchronized tomoko, loki, icarus with extensive changes to nall (118KiB diff)
This commit is contained in:
@@ -4,7 +4,7 @@ namespace nall {
|
||||
|
||||
auto string::downcase() -> string& {
|
||||
char* p = get();
|
||||
for(unsigned n = 0; n < size(); n++) {
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
if(p[n] >= 'A' && p[n] <= 'Z') p[n] += 0x20;
|
||||
}
|
||||
return *this;
|
||||
@@ -12,7 +12,7 @@ auto string::downcase() -> string& {
|
||||
|
||||
auto string::qdowncase() -> string& {
|
||||
char* p = get();
|
||||
for(unsigned n = 0, quoted = 0; n < size(); n++) {
|
||||
for(uint n = 0, quoted = 0; n < size(); n++) {
|
||||
if(p[n] == '\"') quoted ^= 1;
|
||||
if(!quoted && p[n] >= 'A' && p[n] <= 'Z') p[n] += 0x20;
|
||||
}
|
||||
@@ -21,7 +21,7 @@ auto string::qdowncase() -> string& {
|
||||
|
||||
auto string::upcase() -> string& {
|
||||
char* p = get();
|
||||
for(unsigned n = 0; n < size(); n++) {
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
if(p[n] >= 'a' && p[n] <= 'z') p[n] -= 0x20;
|
||||
}
|
||||
return *this;
|
||||
@@ -29,18 +29,18 @@ auto string::upcase() -> string& {
|
||||
|
||||
auto string::qupcase() -> string& {
|
||||
char* p = get();
|
||||
for(unsigned n = 0, quoted = 0; n < size(); n++) {
|
||||
for(uint n = 0, quoted = 0; n < size(); n++) {
|
||||
if(p[n] == '\"') quoted ^= 1;
|
||||
if(!quoted && p[n] >= 'a' && p[n] <= 'z') p[n] -= 0x20;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto string::transform(rstring from, rstring to) -> string& {
|
||||
auto string::transform(string_view from, string_view to) -> string& {
|
||||
if(from.size() != to.size() || from.size() == 0) return *this; //patterns must be the same length
|
||||
char* p = get();
|
||||
for(unsigned n = 0; n < size(); n++) {
|
||||
for(unsigned s = 0; s < from.size(); s++) {
|
||||
for(uint n = 0; n < size(); n++) {
|
||||
for(uint s = 0; s < from.size(); s++) {
|
||||
if(p[n] == from[s]) {
|
||||
p[n] = to[s];
|
||||
break;
|
||||
|
Reference in New Issue
Block a user