From 7d081dd7f5534a50af3aeaa45b1241eec9aa03cb Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Mon, 19 Sep 2016 15:50:43 -0400 Subject: [PATCH] removed the completely unused backify loop system --- buffer/4coder_buffer_abstract.cpp | 1 - buffer/4coder_gap_buffer.cpp | 84 ------------------------------- 2 files changed, 85 deletions(-) diff --git a/buffer/4coder_buffer_abstract.cpp b/buffer/4coder_buffer_abstract.cpp index 16b79e25..22e14af6 100644 --- a/buffer/4coder_buffer_abstract.cpp +++ b/buffer/4coder_buffer_abstract.cpp @@ -12,7 +12,6 @@ #define Buffer_Init_Type cat_4tech(Buffer_Type, _Init) #define Buffer_Stringify_Type cat_4tech(Buffer_Type, _Stringify_Loop) -#define Buffer_Backify_Type cat_4tech(Buffer_Type, _Backify_Loop) inline_4tech void buffer_stringify(Buffer_Type *buffer, i32 start, i32 end, char *out){ diff --git a/buffer/4coder_gap_buffer.cpp b/buffer/4coder_gap_buffer.cpp index 10c847a7..d795e191 100644 --- a/buffer/4coder_gap_buffer.cpp +++ b/buffer/4coder_gap_buffer.cpp @@ -177,90 +177,6 @@ buffer_stringify_next(Gap_Buffer_Stringify_Loop *loop){ loop->data = loop->base + loop->pos; } -typedef struct Gap_Buffer_Backify_Loop{ - Gap_Buffer *buffer; - char *data, *base; - i32 pos, end; - i32 size; - i32 absolute_pos; - i32 separated; -} Gap_Buffer_Backify_Loop; - -internal_4tech Gap_Buffer_Backify_Loop -buffer_backify_loop(Gap_Buffer *buffer, i32 start, i32 end){ - Gap_Buffer_Backify_Loop result = {0}; - - ++start; - if (0 <= end && end < start && start <= buffer->size1 + buffer->size2){ - result.buffer = buffer; - result.base = buffer->data; - - if (end < buffer->size1){ - result.end = end; - } - else{ - result.end = end + buffer->gap_size; - } - - if (start <= buffer->size1){ - result.separated = 0; - result.pos = 0; - } - else{ - if (end < buffer->size1){ - result.separated = 1; - } - else{ - result.separated = 0; - } - result.pos = buffer->size1 + buffer->gap_size; - } - - if (!result.separated && result.pos < result.end){ - result.pos = result.end; - } - - result.size = start - result.pos; - result.absolute_pos = result.pos; - if (result.absolute_pos > buffer->size1){ - result.absolute_pos -= buffer->gap_size; - } - result.data = result.base + result.pos; - } - - return(result); -} - -inline_4tech i32 -buffer_backify_good(Gap_Buffer_Backify_Loop *loop){ - i32 result = (loop->buffer != 0); - return(result); -} - -internal_4tech void -buffer_backify_next(Gap_Buffer_Backify_Loop *loop){ - Gap_Buffer *buffer = loop->buffer; - i32 temp_end = 0; - - if (loop->separated){ - loop->separated = 0; - temp_end = buffer->size1; - loop->pos = 0; - loop->absolute_pos = 0; - if (loop->pos < loop->end){ - loop->absolute_pos = loop->end; - loop->pos = loop->end; - } - } - else{ - temp_end = 0; - loop->buffer = 0; - } - - loop->size = temp_end - loop->pos; - loop->data = loop->base + loop->pos; -} - internal_4tech i32 buffer_replace_range(Gap_Buffer *buffer, i32 start, i32 end, char *str, i32 len, i32 *shift_amount, void *scratch, i32 scratch_memory, i32 *request_amount){