mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 23:52:26 +00:00
Typer fixes: the recipient no longer releases the caller, and a duplicate call to strlen and piece of arithmetic is corrected.
This commit is contained in:
parent
2d02c23574
commit
212ae60622
@ -15,7 +15,7 @@ Typer::Typer(const char *string, int delay, int frequency, Delegate *delegate) :
|
|||||||
counter_(-delay), frequency_(frequency), string_pointer_(0), delegate_(delegate), phase_(0) {
|
counter_(-delay), frequency_(frequency), string_pointer_(0), delegate_(delegate), phase_(0) {
|
||||||
size_t string_size = strlen(string) + 3;
|
size_t string_size = strlen(string) + 3;
|
||||||
string_ = (char *)malloc(string_size);
|
string_ = (char *)malloc(string_size);
|
||||||
snprintf(string_, strlen(string) + 3, "%c%s%c", Typer::BeginString, string, Typer::EndString);
|
snprintf(string_, string_size, "%c%s%c", Typer::BeginString, string, Typer::EndString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Typer::update(int duration) {
|
void Typer::update(int duration) {
|
||||||
|
@ -51,7 +51,6 @@ class TypeRecipient: public Typer::Delegate {
|
|||||||
|
|
||||||
void typer_reset(Typer *typer) {
|
void typer_reset(Typer *typer) {
|
||||||
clear_all_keys();
|
clear_all_keys();
|
||||||
typer_.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user