shithub: orca

Download patch

ref: c934f9f177372c9675c98eff6d416895d1e8a4c4
parent: ee55f70fdc4a4a89740718fd9e3274bfa82d54a9
author: cancel <cancel@cancel.fm>
date: Mon Dec 3 05:27:36 EST 2018

Remove unused fns from field.h/.c

--- a/field.c
+++ b/field.c
@@ -68,45 +68,6 @@
   }
 }
 
-Glyph field_peek(Field* f, Usz y, Usz x) {
-  Usz f_height = f->height;
-  Usz f_width = f->width;
-  assert(y < f_height && x < f_width);
-  if (y >= f_height || x >= f_width)
-    return '\0';
-  return f->buffer[y * f_width + x];
-}
-
-Glyph field_peek_relative(Field* f, Usz y, Usz x, Isz offs_y, Isz offs_x) {
-  Isz f_height = f->height;
-  Isz f_width = f->width;
-  Isz y0 = (Isz)y + offs_y;
-  Isz x0 = (Isz)x + offs_x;
-  if (y0 >= f_height || x0 >= f_width || y0 < 0 || x0 < 0)
-    return '.';
-  return f->buffer[y0 * f_width + x0];
-}
-
-void field_poke(Field* f, Usz y, Usz x, Glyph glyph) {
-  Usz f_height = f->height;
-  Usz f_width = f->width;
-  assert(y < f_height && x < f_width);
-  if (y >= f_height || x >= f_width)
-    return;
-  f->buffer[y * f_width + x] = glyph;
-}
-
-void field_poke_relative(Field* f, Usz y, Usz x, Isz offs_y, Isz offs_x,
-                         Glyph glyph) {
-  Isz f_height = f->height;
-  Isz f_width = f->width;
-  Isz y0 = (Isz)y + offs_y;
-  Isz x0 = (Isz)x + offs_x;
-  if (y0 >= f_height || x0 >= f_width || y0 < 0 || x0 < 0)
-    return;
-  f->buffer[y0 * f_width + x0] = glyph;
-}
-
 static inline bool glyph_char_is_valid(char c) { return c >= '#' && c <= '~'; }
 
 void field_fput(Field* f, FILE* stream) {
--- a/field.h
+++ b/field.h
@@ -9,12 +9,6 @@
 void field_copy(Field* src, Field* dest);
 void field_fill_subrect(Field* field, Usz y, Usz x, Usz height, Usz width,
                         Glyph fill_char);
-Glyph field_peek(Field* field, Usz y, Usz x);
-Glyph field_peek_relative(Field* field, Usz y, Usz x, Isz offs_y, Isz offs_x);
-void field_poke(Field* field, Usz y, Usz x, Glyph glyph);
-void field_poke_relative(Field* field, Usz y, Usz x, Isz offs_y, Isz offs_x,
-                         Glyph glyph);
-
 void field_fput(Field* field, FILE* stream);
 
 typedef enum {