From ce84101939fad9e8bf5a79052d415efc2c3748f6 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 14 Aug 2020 04:56:11 -0400 Subject: [PATCH] egcpool_extended_gcluster: a warning --- src/lib/egcpool.h | 1 + src/lib/render.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/egcpool.h b/src/lib/egcpool.h index 603d87ba1..ffc6928a4 100644 --- a/src/lib/egcpool.h +++ b/src/lib/egcpool.h @@ -252,6 +252,7 @@ cell_egc_idx(const cell* c){ return c->gcluster & 0x00fffffflu; } +// only applies to complex cells, do not use on simple cells __attribute__ ((__returns_nonnull__)) static inline const char* egcpool_extended_gcluster(const egcpool* pool, const cell* c) { uint32_t idx = cell_egc_idx(c); diff --git a/src/lib/render.c b/src/lib/render.c index c691cfdb6..a0f8937ae 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -510,8 +510,7 @@ term_putc(FILE* out, const egcpool* e, const cell* c){ return -1; } }else{ - const char* ext = egcpool_extended_gcluster(e, c); - if(ncfputs(ext, out) == EOF){ + if(ncfputs(egcpool_extended_gcluster(e, c), out) == EOF){ return -1; } }