|
@@ -9,13 +9,13 @@
|
|
|
|
|
|
void CharMan::validate(void) {
|
|
|
// Control buffer debugging output.
|
|
|
-#ifndef NO_BUFFER_DEBUG
|
|
|
+#ifndef NO_BUFFER_DEBUG
|
|
|
bool valid = true;
|
|
|
ZF_LOGE("validate: text_offsets %d", (int)text_offsets.size());
|
|
|
ZF_LOGE("validate work size %d, buffer size %d, text size %d",
|
|
|
(int)work.size(), (int)buffer.size(), (int)text.size());
|
|
|
|
|
|
- for (int x = 0; x < text_offsets.size(); ++x) {
|
|
|
+ for (int x = 0; x < (int)text_offsets.size(); ++x) {
|
|
|
int offset = text_offsets[x];
|
|
|
ZF_LOGE("%d : %d", x, offset);
|
|
|
|
|
@@ -36,12 +36,12 @@ void CharMan::validate(void) {
|
|
|
ZF_LOGE("* NOT VALID* Somethings hosed.");
|
|
|
diagnostics();
|
|
|
}
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
void CharMan::diagnostics(void) {
|
|
|
// Control buffer debugging output.
|
|
|
-#ifndef NO_BUFFER_DEBUG
|
|
|
+#ifndef NO_BUFFER_DEBUG
|
|
|
ZF_LOGV_MEM(buffer.data(), buffer.size(), "Buffer:");
|
|
|
ZF_LOGV_MEM(work.data(), work.size(), "Work:");
|
|
|
ZF_LOGV_MEM(text.data(), text.size(), "Text Buffer:");
|
|
@@ -69,7 +69,7 @@ void CharMan::diagnostics(void) {
|
|
|
// reset oss (if we need it)
|
|
|
oss.str(std::string());
|
|
|
oss.clear();
|
|
|
-#endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
void CharMan::regular_expressions(void) {
|
|
@@ -104,7 +104,7 @@ void CharMan::insert(int pos, std::string str) {
|
|
|
int len = str.size();
|
|
|
// What happens if pos is at the end of the buffer?
|
|
|
int idx;
|
|
|
- if (pos == text_offsets.size()) {
|
|
|
+ if (pos == (int)text_offsets.size()) {
|
|
|
// Ok, this is at the very end of the buffer, which is beyond what the
|
|
|
// vector is holding.
|
|
|
idx = this->text_offsets[pos - 1] + 1;
|
|
@@ -209,7 +209,6 @@ int CharMan::word_wrangler(std::pair<int, int> pos_len) {
|
|
|
Print some characters slowly. Delay.
|
|
|
*/
|
|
|
int CharMan::word_tangler(std::pair<int, int> pos_len) {
|
|
|
- int count = 0;
|
|
|
int p;
|
|
|
int len;
|
|
|
|
|
@@ -263,9 +262,9 @@ CharMan::CharMan(std::string &buffer, std::string &work, std::string &text,
|
|
|
regular_expressions();
|
|
|
ZF_LOGD("Found %d word groups", (int)pos_len.size());
|
|
|
if (pos_len.size() > 0) {
|
|
|
- for (int i = 0; i < pos_len.size(); ++i) {
|
|
|
+ for (int i = 0; i < (int)pos_len.size(); ++i) {
|
|
|
int active = 0;
|
|
|
- //if (random_activate((level + 1) / 2)) { // 8
|
|
|
+ // if (random_activate((level + 1) / 2)) { // 8
|
|
|
if (random_activate(level * 11)) { // level = 4, so it's 44
|
|
|
int c = word_mangler(pos_len[i]);
|
|
|
if (c) {
|
|
@@ -275,7 +274,7 @@ CharMan::CharMan(std::string &buffer, std::string &work, std::string &text,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //if (random_activate((level + 1) / 2)) { // 4
|
|
|
+ // if (random_activate((level + 1) / 2)) { // 4
|
|
|
if (random_activate(level * 11)) { // level = 4, so it's 44
|
|
|
if (word_wrangler(pos_len[i])) {
|
|
|
this->mangle_count++;
|
|
@@ -283,7 +282,7 @@ CharMan::CharMan(std::string &buffer, std::string &work, std::string &text,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (!active && random_activate(level)) { //level = 4, so it's 4
|
|
|
+ if (!active && random_activate(level)) { // level = 4, so it's 4
|
|
|
if (word_tangler(pos_len[i])) {
|
|
|
this->need_render = 1;
|
|
|
}
|