diff options
author | Jacques Lucke <mail@jlucke.com> | 2018-10-18 16:43:06 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2018-10-18 16:43:06 +0300 |
commit | 41216d5ad4c722e2ad9f15c968af454fc7566d5e (patch) | |
tree | f68fe3e1dd32a2d651b6678a1783e165ce2e70c8 /source/blender/blenkernel/intern/text.c | |
parent | cfdd902d2d5d560262d1218861ad1a4469c5259f (diff) |
Cleanup: Remove more #if 0 blocks
Continuation of https://developer.blender.org/D3802
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3808
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 172 |
1 files changed, 0 insertions, 172 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index d512c4ac78e..5dc8d6133eb 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1472,178 +1472,6 @@ static void txt_undo_end(Text *UNUSED(text), TextUndoBuf *utxt) utxt->buf[undo_pos_end] = '\0'; } -/* Call once undo is done. */ -#ifndef NDEBUG - -#endif - -#if 0 /* UNUSED */ -static void dump_buffer(TextUndoBuf *utxt) -{ - int i = 0; - - while (i++ < utxt->undo_pos) printf("%d: %d %c\n", i, utxt->buf[i], utxt->buf[i]); -} - -/* Note: this function is outdated and must be updated if needed for future use */ -void txt_print_undo(Text *text) -{ - int i = 0; - int op; - const char *ops; - int linep, charp; - - dump_buffer(text); - - printf("---< Undo Buffer >---\n"); - - printf("UndoPosition is %d\n", utxt->pos); - - while (i <= utxt->pos) { - op = utxt->buf[i]; - - if (op == UNDO_INSERT_1) { - ops = "Insert ascii "; - } - else if (op == UNDO_INSERT_2) { - ops = "Insert 2 bytes "; - } - else if (op == UNDO_INSERT_3) { - ops = "Insert 3 bytes "; - } - else if (op == UNDO_INSERT_4) { - ops = "Insert unicode "; - } - else if (op == UNDO_BS_1) { - ops = "Backspace for ascii "; - } - else if (op == UNDO_BS_2) { - ops = "Backspace for 2 bytes "; - } - else if (op == UNDO_BS_3) { - ops = "Backspace for 3 bytes "; - } - else if (op == UNDO_BS_4) { - ops = "Backspace for unicode "; - } - else if (op == UNDO_DEL_1) { - ops = "Delete ascii "; - } - else if (op == UNDO_DEL_2) { - ops = "Delete 2 bytes "; - } - else if (op == UNDO_DEL_3) { - ops = "Delete 3 bytes "; - } - else if (op == UNDO_DEL_4) { - ops = "Delete unicode "; - } - else if (op == UNDO_DBLOCK) { - ops = "Delete text block"; - } - else if (op == UNDO_IBLOCK) { - ops = "Insert text block"; - } - else if (op == UNDO_INDENT) { - ops = "Indent "; - } - else if (op == UNDO_UNINDENT) { - ops = "Unindent "; - } - else if (op == UNDO_COMMENT) { - ops = "Comment "; - } - else if (op == UNDO_UNCOMMENT) { - ops = "Uncomment "; - } - else { - ops = "Unknown"; - } - - printf("Op (%o) at %d = %s", op, i, ops); - if (op >= UNDO_INSERT_1 && op <= UNDO_DEL_4) { - i++; - printf(" - Char is "); - switch (op) { - case UNDO_INSERT_1: case UNDO_BS_1: case UNDO_DEL_1: - printf("%c", utxt->buf[i]); - i++; - break; - case UNDO_INSERT_2: case UNDO_BS_2: case UNDO_DEL_2: - printf("%c%c", utxt->buf[i], utxt->buf[i + 1]); - i += 2; - break; - case UNDO_INSERT_3: case UNDO_BS_3: case UNDO_DEL_3: - printf("%c%c%c", utxt->buf[i], utxt->buf[i + 1], utxt->buf[i + 2]); - i += 3; - break; - case UNDO_INSERT_4: case UNDO_BS_4: case UNDO_DEL_4: - { - unsigned int uc; - char c[BLI_UTF8_MAX + 1]; - size_t c_len; - uc = utxt->buf[i]; i++; - uc = uc + (utxt->buf[i] << 8); i++; - uc = uc + (utxt->buf[i] << 16); i++; - uc = uc + (utxt->buf[i] << 24); i++; - c_len = BLI_str_utf8_from_unicode(uc, c); - c[c_len] = '\0'; - puts(c); - break; - } - } - } - else if (op == UNDO_DBLOCK || op == UNDO_IBLOCK) { - i++; - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - - printf(" (length %d) <", linep); - - while (linep > 0) { - putchar(utxt->buf[i]); - linep--; i++; - } - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - printf("> (%d)", linep); - } - else if (op == UNDO_INDENT || op == UNDO_UNINDENT) { - i++; - - charp = utxt->buf[i]; i++; - charp = charp + (utxt->buf[i] << 8); i++; - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - - printf("to <%d, %d> ", linep, charp); - - charp = utxt->buf[i]; i++; - charp = charp + (utxt->buf[i] << 8); i++; - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - - printf("from <%d, %d>", linep, charp); - } - - printf(" %d\n", i); - i++; - } -} -#endif - static void txt_undo_store_uint16(char *undo_buf, int *undo_pos, unsigned short value) { undo_buf[*undo_pos] = (value) & 0xff; |