kill fbuf_at(), eliminating static analyzer warning #1348

This commit is contained in:
nick black 2021-09-03 05:17:36 -04:00
parent cd14e914fa
commit 39f9dd3b96
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 2 additions and 10 deletions

View File

@ -107,7 +107,7 @@ endif()
# global compiler flags
add_compile_definitions(_FORTIFY_SOURCE=2)
add_compile_options(-Wall -Wextra -W -Wshadow -Wformat -Wformat-security
-fexceptions -fstrict-aliasing)
-fanalyzer -fexceptions -fstrict-aliasing)
# don't use REQUIRED with subsequent find_package() operations; we use
# feature_summary + set_package_properties to fail in one fell swoop.

View File

@ -30,14 +30,6 @@ typedef struct fbuf {
// header-only so that we can test it from notcurses-tester
static inline char*
fbuf_at(fbuf* f, uint64_t at){
if(at > f->used){
return NULL;
}
return f->buf + at;
}
#ifdef MAP_POPULATE
#ifdef MAP_UNINITIALIZED
#define MAPFLAGS (MAP_POPULATE | MAP_UNINITIALIZED)
@ -168,7 +160,7 @@ fbuf_putc(fbuf* f, char c){
if(fbuf_grow(f, 1)){
return -1;
}
*fbuf_at(f, f->used++) = c;
f->buf[f->used++] = c;
return 1;
}