ref: 0e08ced81733310c153e42d88a480cdf01757853
parent: 99a99580a846558d681ca628d7ca69c8dcea41b1
author: cancel <cancel@cancel.fm>
date: Mon Nov 26 02:31:08 EST 2018
Remove redundant casts
--- a/field.c
+++ b/field.c
@@ -116,8 +116,8 @@
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 + (Isz)offs_y;
- Isz x0 = (Isz)x + (Isz)offs_x;
+ 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];
@@ -136,8 +136,8 @@
Glyph glyph) {
Isz f_height = f->height;
Isz f_width = f->width;
- Isz y0 = (Isz)y + (Isz)offs_y;
- Isz x0 = (Isz)x + (Isz)offs_x;
+ 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;