Skip to content

Commit

Permalink
Fixed: Character and string handling
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 20923f2 commit 170fe98
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doomsday/apps/client/CMakeLists.txt
Expand Up @@ -327,9 +327,9 @@ if (APPLE AND NOT IOS)
heretic
hexen
)
# if (TARGET audio_fmod)
# deng_install_bundle_deps (client fmodex)
# endif ()
if (TARGET audio_fmod)
deng_install_bundle_deps (client fmodex)
endif ()

# Plugins are bundled inside the client app. We'll run macdeployqt on the
# installed app before the plugins are there so it won't do unnecessary
Expand Down
12 changes: 12 additions & 0 deletions doomsday/libs/core/include/de/data/string.h
Expand Up @@ -121,6 +121,18 @@ struct DE_PUBLIC mb_iterator {
mb_iterator(const char *p) : cur{p}, start{p} {}
mb_iterator(const char *p, const char *start) : cur{p}, start{start} {}
mb_iterator(const String &str);
mb_iterator(const mb_iterator &other)
: cur(other.cur)
, start(other.start)
{}

mb_iterator &operator=(const mb_iterator &other)
{
cur = other.cur;
start = other.start;
mb = other.mb;
return *this;
}

operator const char *() const { return cur; }
Char operator*() const;
Expand Down
2 changes: 2 additions & 0 deletions doomsday/libs/core/src/data/string.cpp
Expand Up @@ -1171,6 +1171,8 @@ Char mb_iterator::operator*() const

Char mb_iterator::decode(const char **end) const
{
if (*cur == 0) return {};

uint32_t ch = 0;
int rc = decodeBytes_MultibyteChar(cur, strnlen(cur, 8), &ch);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/gui/CMakeLists.txt
Expand Up @@ -131,7 +131,7 @@ endif ()

deng_link_libraries (libgui PUBLIC DengComms)
target_link_libraries (libgui
PUBLIC glbinding
PUBLIC glbinding::glbinding
PRIVATE SDL2 SDL2_ttf stb assimp
)
if (WIN32)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/gui/src/text/font_richformat.cpp
Expand Up @@ -141,7 +141,7 @@ DE_PIMPL_NOREF(Font::RichFormat)
break;

case 'T':
stack.last().tabStop = de::max(-1, *iter - 'a');
stack.last().tabStop = de::max(-1, int(*iter - 'a'));
// Note: _E(T`): tabStop -1, i.e., switch to untabbed
break;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/dshell/src/cursesapp.cpp
Expand Up @@ -367,7 +367,7 @@ DE_PIMPL(CursesApp)
}
else
{
keyStr.append(Char(key));
keyStr.append(Char(uint32_t(key)));
}
}

Expand Down

0 comments on commit 170fe98

Please sign in to comment.